It’s time to learn Swift. After Swift first release in 2014, now more and more people start using Swift as their program language in iOS. Therefore, I decide to use Swift in my current project, loading people first name, last name and phone number from contact. This will be a good project to learn Swift from beginning.
When we create new project in Xcode, it will use Swift language by default. The only different between Objective-c and Swift is there is no .h and .m file any more. There is only one .swift file which we can declare class inside. In my new project, there is only two .swift file. One is AppDelegate.swift; the other one is ViewController.swift. All my logic to get people information from contact are in ViewController.swift. Now, I will start to show you how to get people first name, last name, and phone number from contact. All example source code will use swift.
Read more