This isn't tutorial, just be the collection of tutorials. If you wanna have a walkthrough of iOS development, follow these steps. Please do not forget to complete attached assignments.
Step 1: Understand swift syntax
- Use playground to try. https://www.raywenderlich.com/143771/swift-tutorial-part-1-expressions-variables-constants
- Distinguish between Optional and non-optional variable (? and ! variable)
- Distinguish between “let” and “var”
- Understand “guard”, “if let”, “defer”
- Struct, enum, class
Tip: Just need to answer my above questions.
For more detail: https://itunes.apple.com/us/book/the-swift-programming-language-swift-3-1-edition/id1002622538?mt=11
Step 2: Get started with UI
-
Pre: Try to create XCode project (Single view application)
-
2.1 Simple elements:
- I generally classify simple UI elements into 3 groups:
- Not interact with user: UILabel, UIImageView
- Simple UIControl handled by IBAction: UIButton, Switch, Stepper, Slider, Segment…
- Simple UIControl handled by delegate (and IBAction): UITextField, TextView, UIWebview v.v…
- To getting started with these elements, you have to know:
- How to create IBOutlet, what is IBOutlet?
- How to create IBAction, what is IBAction, how to know if a control has IBAction or not?
- How to implement delegate, and what for?
- I generally classify simple UI elements into 3 groups:
TIP: Just need to answer my above questions.
- IBOutlet + IBAction: http://www.codingexplorer.com/hello-world-first-ios-app-swift/
- Delegate sample: http://sourcefreeze.com/uitextfield-and-uitextfield-delegate-in-swift/
-
2.2 Autolayout:
- Autolayout: flexible layout UI element with all of device sizes (have to practice autolayout for all of your assignment or demo, because it’s not difficult to use, but maybe make beginner confused.)
- “Size-Classes”: Different layouts for different sizes of device.
TIP:
This is too hard for imaging so you’d better watch video instead of reading tutorial
Video: https://www.youtube.com/watch?v=7iT9fueKCJM
Document tutorial: https://www.appcoda.com/auto-layout-guide/
-
2.3 Understand data type:
- Single element: Int, Double, Float, String, Date, Bool, Data
- Set of elements: Array, Dictionary
-
2.4 ImageAsset
- Understand difference between point and pixel in iOS
- What are abc.png, abc@2x.png, abc@3x.png?
Assignment 01: Create an calculator like this:
Step 3: Advance of UI element:
-
3.1 Complex UI element:
- UITableView (Have to know, this is very common): http://www.codingexplorer.com/getting-started-uitableview-swift/
- UICollectionView (Have to know, very common): http://rshankar.com/uicollectionview-demo-in-swift/
- UIScrollView (not usually but recommended, because UITableView and UICollection is inherited from UIScrollview): https://www.raywenderlich.com/122139/uiscrollview-tutorial
- UIPickerView (Nice to have or you can familiar it later): http://sourcefreeze.com/ios-uipickerview-example-using-swift/
TIP: Have to understand clearly delegate.
Ref: https://useyourloaf.com/blog/quick-guide-to-swift-delegates/
-
3.2 UIViewController, or container:
- NavigationController (Have to know) https://swiftludus.org/how-to-navigate-between-view-controllers-in-ios/
- TabbarController (Have to know) https://makeapppie.com/2016/07/06/tab-bar-controllers-in-xcode-8-storyboards/
- UISearchController (Recommended) https://www.raywenderlich.com/113772/uisearchcontroller-tutorial
- SplitViewController, Popover (Rarely, nice to have, skippable)
Assignment 02: Create karaoke application. Download the requirement and resources from here.
Step 4: Connect to server and local database
-
4.1 Connect to database using CoreData
- Fetch, insert, delete, select, update
- Tutorial: https://www.raywenderlich.com/145809/getting-started-core-data-tutorial
Assignment 03: Apply core data to karaoke application. Download the requirement and resources from here.
-
Pre: research sync and async
- What difference?
- Dispatch to switch queue (from current to main queue, from main queue to others)
- Have to make sure the UI Code is in Main Queue.
- Tutorial: https://www.raywenderlich.com/148513/grand-central-dispatch-tutorial-swift-3-part-1
-
4.2 Connect to server using API:
- Call API to get data (URLRequest, UISession) http://mrgott.com/swift-programing/30-work-with-rest-api-in-swift-3-and-xcode-8-using-urlsession-and-jsonserialization
- Parse json data:
- Apple framework: http://stackoverflow.com/questions/39423367/correctly-parsing-json-in-swift-3
- SwiftyJSON (cocoapods): https://github.com/SwiftyJSON/SwiftyJSON
Assignment 04: Create food recipes using API. Download the requirement and resources from here.
Step 5: Advance
- Extension (~ Category of ObjC): Add function to existed class (HAVE TO KNOW)
- Read and write a file:
- What is application sandbox
- Which folders are writable?
- NSFileManager
- Ref: http://www.theappguruz.com/blog/working-ios-file-management-using-swift
- Cocoapods (Simple way to integrate 3rd party framework into application) (RECOMMENDED) https://www.raywenderlich.com/97014/use-cocoapods-with-swift
- Visit Cocoacontrols for more new useful frameworks)
- iOS application life cycle (SHOULD HAVE) https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html
- CoreAnimation (NICE TO HAVE) https://makeapppie.com/2016/06/28/how-to-use-uiimagepickercontroller-for-a-camera-and-photo-library-in-swift-3-0/
- Create custom UI element (NICE TO HAVE)
- UIImagePickerController (Take photo + browse photo from camera roll)
- With dictionary & array: Flat, flatmap, filter (NICE TO HAVE)