What are the best resources for learning iOS development?
2016-11-08 21:47
549 查看
What are the best resources for learning iOS development?
Article Source: https://www.quora.com/What-are-the-best-resources-for-learning-iOS-development?redirected_qid=1992810 Not interested in a 3rd party workaround. I'm looking to learn Swift, Objective-C, and Cocoa. My programming background is web-based.
Question merged
You were redirected because this question was merged with What
are the best new resources for learning iOS development in 2014?
Richard
Henry, Mobile
Product Designer at Quora
Updated
Jun 7, 2014 · Featured in Forbes
I learned everything I needed to know initially about iOS development from the Stanford
CS 193P videos, and the videos
from the most recent WWDC.
Tips for the CS 193P videos:
Just watch the first 2-3 videos without building anything yourself
Then start over and follow along by building a simple hobby app that is more fun than the boring app the professor is building
Keep watching the videos in order as you have time, but start skipping around to the parts that contain what you need to know
Download slides as a PDF whenever you can, makes it easier to jump around and use code samples
You don't need to be drawing and using
drawRect:as
much as the professor seems to want to, using subviews or sublayers to create simple shapes will probably be a lot easier at first
You probably need to watch the first 7 before you start to get a real grip on the key tools that you will need to build an app, but you can certainly start hacking on something much more quickly
Tips for the WWDC videos:
Expect most of them to not be useful from an initial learning perspective
Some are really useful though because of the sample code in the slides, I remember the Core Animation video and slides being especially helpful
Understanding
UIKit Rendering from 2011 is really useful for understanding how to work with views, layers, layout and rendering
So are the UIScrollView sessions, maybe start with 2011 and work your way up to today, also the most entertaining WWDC session by far
Also take a look at Apple's sample code whenever you're stuck on a particular API for usage
Remember to option click a method name in Xcode to see it's arguments or get to the docs page
Expect these parts of iOS development to be the hardest:
Understanding protocols and delegates (don't try to gloss over this section of the CS 193P videos or you will be so confused later)
Figuring out where to put code (I'll post a few general tips below)
Memory management (with ARC this is fairly simple now, just try to get an understanding of the difference between strong/weak references, be a little wary of blocks, and eventually learn how to
use the allocations/leaks instruments)
Where to Put Code
Some really general tips on code organization:Expect your app to be a sort of tree of references from the
AppDelegateto
one class instance (like a main
UIViewController),
which will have references to other class instances (like a
UIViewand
other
UIViewControllers),
and so on
In a
UIViewController,
expect to do most of your setup in
viewDidLoad
At first, you can probably do most of what you need to do without subclassing
UIViewat
all, unless you need to use
drawRect:or
override other
UIViewmethods,
using a view instead of a view controller is mostly organizational
In a
UIView,
do most of your setup (i.e. creating subviews) in
init(save
drawRect:for
actual drawing only)
If you're trying to create a more complex layout, don't forget about
layoutSubviewsfor
adjusting subview frames and so on
For now, bias to using properties instead of ivars, you can create a private
@interfaceif
you don't want to expose a property to other classes
Read the documentation for
UIViewController's
viewWillAppear,
viewDidAppear,
viewWillDisappear,
and
viewDidDisappear(all
pretty succinct and once you start to do anything remotely complex you will need to override these methods)
Persisting Data
You should considerNSUserDefaultsa
good alternative to Core Data or SQLite if all you want to do is persist a few objects and don't need to query them (i.e. give me objects where…). This is what the pros do, and user defaults has the upside of being much easier to understand as a beginner.
It's basically a persistent dictionary, or a key value store. For pure data retrieval, Core Data and SQLite are not faster than user defaults — they are all reading from disk.
"The Best Way"
Once you get to the point where you're starting to care about code style, or if you're just wondering how an experienced programmer might do something, I like the NYTimesObjective-C Style Guide.
The Future
As you progress you should try to get into a habit of skimming at least the high level documentation for every method you're using or overriding. Sometimes the documentation will make you aware of surprising side effects, or alternative ways of doing the samething that might be better for your use case. This is the best way to become really familiar with Foundation and UIKit.
Once you're even further along on your iOS development journey, you might enjoy reading NSHipster —
a pretty entertaining blog that documents useful but overlooked APIs or Obj-C features.
64.1k Views · View
Upvotes · Answer requested by Jackson
Mohsenin
相关文章推荐
- The best resources for learning exploit development
- The best resources for Windows Phone 7 Development
- What are some good resources for learning about machine learning? Why
- What are some good resources for learning about Artificial Neural Networks
- What are the best practices for building something like a News Feed?
- What are the best talks/lectures related to big data/algorithms/machine learning?
- What are some good class projects for machine learning using MapReduce?
- What are the Three Layers of Web Development?
- What is the best free memory leak detector for a C/C++ program and its plug-in DLLs
- What is the best way to implement a heartbeat in C++ to check for socket connectivity?
- Tips for the best development tools
- What skills are needed for machine learning jobs
- What's the best Linux server for you? == 最佳Linux服务器发行版
- The best practices to design URIs for resources
- The Standard Librarian: What Are Allocators Good For?
- The Standard Librarian: What Are Allocators Good For?
- What ESB systems work the best for .Net stack
- The Standard Librarian: What Are Allocators Good For?
- The Standard Librarian: What Are Allocators Good For?
- The Standard Librarian: What Are Allocators Good For?