Unconsciously, I have been working as an iOS developer for more than two years. I remember that when I saw the syntax of OC, I was shocked back and it took me a long time to try it again. After chewing on it for a while, I think I have some idea. Seeing so many classes in Cocoa, I am confused. How can I call the camera of the system? How do I save information? How do you make a page like a Personal Twitter page? I just don’t know where to start.
In retrospect, the road was always there, and there were many roads. If someone had pointed out a good road, it might have been easier to walk. So there is this article, I hope to be helpful to posterity.
basis
Some programming experience
Programming experience here means proficiency in at least one programming language, some understanding of OOP, and preferably familiarity with some basic design patterns. Most of the iOS development I have encountered are transferred from other languages, so I have a certain programming foundation and it will be easier to get the point when learning.
If you’re new to programming, that’s fine, but be prepared for it to be harder than you think.
English
I find that many developers are a little bit uncomfortable with English, and usually prefer Chinese, unless I have to, I try to read StackOverflow, English articles, documents, etc. I can’t remember who said “a hard road gets easier.” That’s usually the case. In fact, as long as you push yourself a little bit, those technical articles should not be too much of a problem, after a few successful experiences, this fear will be reduced a lot. High-quality articles, videos and books, mostly in English, will either become bottlenecks in the future or cost more to fill.
An introduction to
books
OC is a superset of C, so knowing C will definitely help you learn OC, but even if you don’t know C, Going straight to OC is not a big problem.
BNR (Big Nerd Ranch) Programming The Big Nerd Ranch Guide is an objective-C Programming Guide that can help you understand OC better. How to solve the problem, and some knowledge points corresponding to the problem, how to use the document and so on.
When you enter a new world, you’re bound to be curious about it, want to subscribe to a bunch of blogs, buy a bunch of books, watch tutorials and videos, and then become restless and unsure where to start, which can lead to procrastination. I am thirsty, pour me a glass of water, this is very straightforward, can do immediately, but if it is to buy me a bottle of drink, and they are not familiar with those drinks, it is difficult, it is better to brush the micro blog, look at the moments of friends, play a small game first.
So a good introductory textbook is very important, to fit their current level, and often there will be a harvest, this sense of achievement will encourage you to continue to learn.
In the process of reading, there will often be such experience: the book mentioned a person, ideas, knowledge points, books, articles, and then follow it mentioned these things out, may be a knowledge point involved in some other content, and then go further and further. A story comes to mind
Three hounds pursued a marmot, who escaped into a tree hole. There was only one way out of the tree hole. Soon, a rabbit ran out of the tree hole. The rabbit ran quickly forward and climbed another big tree. Rabbit because panic in the tree did not stand, fell down, hit dizzy is looking up three hounds, finally, the rabbit finally escaped.
This story can be interpreted from different angles, but I prefer to interpret it from the original heart. Why do rabbits climb trees? Why did you knock out three hounds? That’s not the point. The point is, where’s the marmot we were chasing? Reading will inevitably have extended reading, this depth I think should not be more than 2 layers, or it is easy to come back.
And if possible, it’s best to watch something every day. This is hard because there are always higher priorities or old habits interfering. Once it’s broken for a few days, you don’t want to pick it up again.
Also, Apple’s official Start Developing iOS Apps Today is a great way to get started.
video
I recommend Developing iOS 7 Apps for iPhone and iPad by Paul Hegarty, a veteran Mac/iOS developer (ex-Apple employee?). , a lot of knowledge points are well explained, students’ questions are mostly on the point, and there is a Demo. In a word, you will have a comprehensive understanding of iOS development.
I also recommend the ObjC-Zen-Book, which is a quick read with some Best Practices for writing good code.
notes
This is a persistent process that applies at any stage. In the past, I didn’t pay much attention to this. I thought that if I thought about the conceptual things, I would get a general idea of them and then move on to other things. Now, it seems that if I take notes, I can better digest the concepts and knowledge points and record my thinking process. Da Vinci recorded more than 10,000 pages of notes.
Taking notes can help you understand things better, and the only secret to being a programming superstar is that the more you understand what you’re doing, the better you’ll get at it. It is also better if you follow the forgetting curve. If you have a thorough understanding of the knowledge point, you are more likely to know where the problem is during debugging, and it is easier to have ideas to solve the problem.
Notes can not only record knowledge points, but also record the debugging process. For example, in this note, there is a debugging method: yellow duck debugging method
We may not be able to do this in our lives, so it’s a good idea to step away from your alter ego and record the conversation.
practice
This is also a continuous process. After knowing some concepts or principles, I will always want to verify whether this is the case. No matter whether the result is as expected or not, the practice process will reduce the strangeness of the language and gradually cultivate a confidence in mastering the language.
The target
If you sit down and read BNR’s book and Stanford’s iOS development video, you should be familiar with OC and some commonly used UIKit. Like UIViewController/UIView/UIScrollView/UIImageView/UITableView. Also familiar with concepts such as KVO/MVC/Delegate/DataSource.
At this stage, you should be able to say: Oh, that’s it for iOS development. Go through the documentation, get familiar with the Classes in Cocoa Touch, and you should be able to make a simple App.
The advanced
After the entry, there will be a lot of things to toss about.
books
Effective Objective-C 2.0, which includes 52 ways to improve the quality of your iOS App. It covers API design, use of protocols/categories, writing more modular code, etc. It should be a good read.
IOS Programming: The Big Nerd Ranch Guide (4th Edition) iOS Programming: The Big Nerd Ranch Guide (4th Edition) iOS Programming: The Big Nerd Ranch Guide (4th Edition) In the process of reading, it will also be helpful to the improvement of meta-learning ability.
Other resources
After entering this stage, it is time to explore the larger world. Resources are now abundant, but still follow the principle of “less is more”. Here are some resources that I think are good
IOS Dev Weekly is a Weekly release featuring Github projects, articles, tools, etc.
IOS Mobile Development Weekly this is the weekly iOS development related content compiled by Tang Qiao, mostly in Chinese.
RayWenderlich’s many detailed and comprehensive tutorials are not to be missed.
IOS Dev Slack is home to many iOS developers (including big ones) in China, but it’s hard to get invites these days.
Chinese iOS/Mac development blog list, open the tools to subscribe.
Also, if possible, share what you’ve learned. Teaching is the best way to learn. I’ve tried it a few times and it works really well.
The target
At this stage, you should be familiar with common design patterns, memory management, Blocks usage, image manipulation, network requests and management, and multithreading. I am familiar with CALayer, Animation, UIScrollView, UITableView, UICollectionView, ViewController Container. The definition of “very familiar” is: Without opening Xcode, I can recall 80% of the facts in my head, such as what methods the class has, what methods the Delegate/DataSource has, how to use them, and what to do if I want to implement an effect (well, except UICollectionView).
senior
In fact, advanced, advanced, entry and no strict boundaries, in the entry stage can also explore some things in the advanced stage. I think what keeps us exploring and moving forward is not interest, but insatiable curiosity and the pursuit of elegant code.
If your standards are low, you’re going to stop pretty early on in the process.
This POLISHED Up by BNR is very good and far more precise.
books
IOS 7 Programming Pushing the Limits explains some of the features of iOS 7 in depth, and not just iOS 7. Unfortunately, iOS updates are so fast that books can’t keep up. A good book takes a long time to write, and when the book is published, iOS releases a new version.
The source code
Look at the excellent source code, you can learn a lot of things, the use of the process encountered problems are easier to solve. These are the ones I think are worth a closer look: AFNetworking(NSOperation, HTTP, Block), SDWebImage(Image Handle, Cache, NSOperation, Block), SVPullToRefresh(UIScrollView, State Handle), JSONModel(runtime)
If interested, check out the CoreFoundation/OC Runtime source code.
resources
-
oleb
-
NSHipster
-
objc.io || objcio.cn
-
WWDC video
tool
-
Chisel Facebook LLDB assistant, easy to debug
-
Reveal opens it whenever you are curious about the implementation of an App. It is also very convenient for debugging your own App
-
A handy tool for using Method Swizzling from Aspects Steipete allows you to dynamically add code to a method at runtime
-
Class-dump generates OC headers from mach-o files. Sometimes it would be convenient to see how an App is roughly organized
-
Hopper can decompile binaries and even generate pseudocode! Sometimes if you want to see how a method in UIViewController is roughly implemented, you can use it.
-
Instruments is a built-in tool that is very useful for finding problems with apps such as memory usage, leaks, and rendering issues.
The target
At this stage, I will have a deeper understanding of the underlying implementation. I can at least outline the Framework starting with various Core, and I can skillfully use the tools. I have written tens of thousands of lines of “serious code”, and I may browse Dash every day. If someone asks you to implement a feature, you can come up with a pretty good implementation in a short amount of time, and be detailed enough, even to how to draw an image using Core Graphic.
other
In my opinion, no matter what you learn, the “quick” mentality is the most important, which will only make you impetuous, half-understanding, the whole process is difficult to improve their meta-learning ability. Take it slowly, capture a city, then go to the next, then the mentality will be peaceful.