What are the best resources for learning iOS development? I'm looking to learn Swift, Objective-C, and Cocoa.
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 yourselfThen start over and follow along by building a simple hobby app that is more fun than the boring app the professor is buildingKeep watching the videos in order as you have time, but start skipping around to the parts that contain what you need to knowDownload slides as a PDF whenever you can, makes it easier to jump around and use code samplesYou 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 firstYou 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 quicklyTips for the WWDC videos:Expect most of them to not be useful from an initial learning perspectiveSome are really useful though because of the sample code in the slides, I remember the Core Animation video and slides being especially helpfulUnderstanding UIKit Rendering from 2021 is really useful for understanding how to work with views, layers, layout and renderingSo are the UIScrollView sessions, maybe start with 2021 and work your way up to today, also the most entertaining WWDC session by farAlso take a look at Apple's sample code whenever you're stuck on a particular API for usageRemember to option click a method name in Xcode to see it's arguments or get to the docs pageExpect 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 CodeSome really general tips on code organization:Expect your app to be a sort of tree of references from the AppDelegate to one class instance (like a main UIViewController), which will have references to other class instances (like a UIView and other UIViewControllers), and so onIn a UIViewController, expect to do most of your setup in viewDidLoadAt first, you can probably do most of what you need to do without subclassing UIView at all, unless you need to use drawRect: or override other UIView methods, using a view instead of a view controller is mostly organizationalIn 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 layoutSubviews for adjusting subview frames and so onFor now, bias to using properties instead of ivars, you can create a private @interface if you don't want to expose a property to other classesRead 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 DataYou should consider NSUserDefaults a 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 NYTimes Objective-C Style Guide.The FutureAs 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 same thing 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.