翻译于 2017/03/09 20:48
0 人 顶 此译文
Exactly one year ago, I had been working as an Android developer. At that time, I did not have any knowledge about iOS programming, even I had never used any Apple products. It, however, was in the past, I have been developing both iOS and Android apps in parallel.
Today, after looking back, I want to share the syllabus of iOS programming course that I created by myself for one-month studying.
In my personal experience, I really recommend that Android developers learn to develop iOS apps. It sounds weird but don’t get me wrong. There is a reason: Expanding your knowledge widely helps you to go deeper in your field.
“If you do something and it turns out pretty good, then you should go do something else wonderful, not dwell on it for too long. Just figure out what’s next.”?—?Steve Jobs
Coming back to the main topic, I started by writing my own schedule for one month, and of course, every resources were completely free.
一年前，我还是一个 Android 开发者。那时候我没有任何 iOS 编程相关的知识，我甚至没用过任何苹果的产品。然而，这已成为过去，现在我已经能同时开发 iOS 和 Android 应用了。
现在，我想给大家传授一下我一个月学习 iOS 编程的秘诀。
我非常推荐 Android 开发者学习开发 iOS 应用。这听起来很奇怪，但值得一试，原因是：扩宽知识面可以帮助你在自己的领域中更加深入。
You can learn Objective-C instead but I really recommend that you go with Swift. It is a friendly and easy to learn.
Apple official resource is the first place I visited. Read through basic concepts and get your hand dirty by coding them along on Xcode.
Besides, you can try Swift-learning course on Udacity. Although the website said that it will take about 3 weeks, but you can complete it in several days (several hours/days).
In my case, I spent one week on learning Swift. So, if you have time, there are several following resources you can explore:
Let’s move to a visual and interesting part. UIKit helps your work to be seen and interacted on iOS devices. It sounds good, doesn’t it.
In my case, I went to search for a free course on Udacity. Fortunately, I found it. UIKit Fundamental Course
At first, iOS Auto Layout was quite strange to me.The reason was that when developing Android apps, I used to implementing its interface via layout xml files and saw the result visually, almost never used drag-and-drop features. iOS, however, is totally different.
After spending a while on practicing to understand Auto Layout mechanism, it was pretty awesome that I learnt something else beyond usual Android design style.
Besides, in Xcode, you can make transition between screens by just using dragging their connection in Storyboard, while Android requires some lines of code.
There are various features that you can explore.
Furthermore, you can check out more iOS UIKit tutorials in “Core Concepts” section of iOS Raywenderlich page.
现在来到可视化部分。UIKit 使工作内容在 iOS 上呈现，并与 iOS 设备互动。
我在 Udacity 上搜索免费的 UIKit 基础课程。
起初，我觉得 iOS 自动布局非常奇怪。在开发 Android 应用的时候，我通常在 xml 文件中布局界面，其结果是可以看到的，几乎不需要使用拖放功能。然而 iOS 完全不同。我花了一些时间，通过实践了解自动布局机制之后，我学到了超越常规 Android 设计风格的东西。
此外，在 XCode 中制作屏幕过渡只需要向 Storyboard 中拖入它们的连接，这在 Android 需要一些代码才能实现。
而且，你可以在 iOS Raywenderlich 页面的“核心概念”中找到更多 iOS UIKit 教程。
At the time you become familiar with UIKit, you can display data to users and retrieve data from them. It is great.
Next move is to store data that users can get them back even the app is closed. What I mean here is to keep data in user’s device hard drive but not in a remote server.
In iOS apps, you have several options:
NSUserDefaults : is a key-pair type that is similar to SharePreferences in Android)
NSCoding / NSKeyedArchiver : serializes compliant classes to and from a data representation and stores it in File System or via NSUserDefaults
Core Data : is iOS super-powerful framework
Others: SQLite, Realm, and etc.
Now many iOS developers prefer Realm over Core Data but I recommend to learn Core Data because it is the iOS official persistent framework and when you understand its core structure and implementation, you can move the mountain.
The resources that I went through includes:
熟悉 UIKit 之后，你可以向用户展示数据并从他们那接收数据。
NSUserDefaults：键值对类型，就像 Android 中的 SharePreferences
NSCoding / NSKeyedArchiver：在兼容类和数据持久之间进行序列化并通过 NSUserDefaults 保存到文件系统中
Core Data：iOS 超强大的框架
与 Core Data 相比，现在很多 iOS 开发者都更喜欢 Realm。不过我推荐学习 Core Data，因为它是 iOS 官方推出的持久化框架，只要你理解了它的核心结构和实现，就可以举一反三。
We are living in internet era, so your app should connect with the outside world and exchange information with others. Let’s move to the next lesson: iOS networking. You learn to work with REST API in iOS. It is important thing to remember that you should not use any third-party libraries at the moment. Let’s complete this lesson in iOS built-in frameworks.
In the future you have a lot of chances to work with cool http networking libraries like Alamofire , but we are learning now. Going with basic and official things before swimming into others.
Recommended courses and tutorials:
NSURL Protocol tutorial by Raywenderlich
NSURL Session tutorial by Raywenderlich
Fundamental Networking course by Udacity
“Knowing is not enough. Let’s apply”.?—?Leonardo da Vinci
You have many tools in your hand after following your iOS self-studying journey. You can program in Swift, sketch iOS app interface by using Story board and UIKit, persist data on device’s storage, and exchange information with the world via internet by using iOS Networking.
You are awesome, man. Let’s build whatever you want.
We are developers who make cool and valuable stuffs to make our tough world easier. So, you can try to build iOS app that improve your daily work, help your little brother, or even solve a global problem. Finally, I recommend that you publish it on Apple store. It helps you feel good and keep going on.
3 years ago, I published my first Android app (a note-taking app) on Google Play after learning Android for 1 months. 1 years ago, I also published my first iOS app (a weather app) on Apple Store after 1 month self-studying. They were both simple stupid at first, but they kept me being motivated and improving day by day.
You are better and I bet on it. So, let’s create something and show it to the world.
Note: There are many good resources out there, you can pick them up by searching Google. The tutorials and courses above are just my favorite selection.