What are the best resources for learning iOS development?
来源:互联网 发布:淘宝专业版店铺装修 编辑:程序博客网 时间:2024/04/29 19:00
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,
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:
Tips for the WWDC videos:
Expect these parts of iOS development to be the hardest:
Some really general tips on code organization:
You should consider
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.
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 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.
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
AppDelegate
to one class instance (like a mainUIViewController
), which will have references to other class instances (like aUIView
and otherUIViewControllers
), and so on - In a
UIViewController
, expect to do most of your setup inviewDidLoad
- At first, you can probably do most of what you need to do without subclassing
UIView
at all, unless you need to usedrawRect:
or override otherUIView
methods, using a view instead of a view controller is mostly organizational - In a
UIView
, do most of your setup (i.e. creating subviews) ininit
(savedrawRect:
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 on - For 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 classes
- Read the documentation for
UIViewController
'sviewWillAppear
,viewDidAppear
,viewWillDisappear
, andviewDidDisappear
(all pretty succinct and once you start to do anything remotely complex you will need to override these methods)
Persisting Data
You 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 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 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.
1 0
- What are the best resources for learning iOS development?
- 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 the best talks/lectures related to big data/algorithms/machine learning?
- Best Machine Learning Resources for Getting Started
- What are the best study methods?
- What are the Best Study Methods?
- Tips for the best development tools
- What are the Three Layers of Web Development?
- What are the best ways to learn self discipline?
- What skills are needed for machine learning jobs?
- What skills are required for machine-learning jobs?
- Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?
- The Best BootStrap Resources
- The Best BootStrap Resources
- [Office] Resources for Office Development
- The Standard Librarian: What Are Allocators Good For?
- 内连接、外链接、自然连接、全连接
- 欢迎使用CSDN-markdown编辑器
- Webservice请求以及个人简单的封装分享
- WikiOI 4163 hzwer与逆序对 (归并排序)
- 读书笔记《编写高质量代码》高质量的HTML
- What are the best resources for learning iOS development?
- 算法-如何判断链表有环
- 杭电acm1020
- HDU 2838 Cow Sorting [树状数组]【数据结构】
- 使用jqueryUI和corethink实现的类似百度的搜索提示
- js正则表达式基本语法
- Canopy算法
- Karel,规范你的Java编程思维及编程习惯!
- .text()与.html()与.val()的区别