iOS for the Android developer [0.002]
Howdy!
After releasing ver 0.001 of this, I got a few suggestions on what to cover next. So I’ll do a quick info pruning.
- I will not be teaching you swift, the language. You can write Java, you’d be fine :). Feel free to ask me questions though.
- I’ll be doing a one to one or one to many mapping of controls and widgets for iOS and Android.
- I’ll be putting resources on how to use said widgets.
So, for this article I’ll pick the UIViewController [View, Swift file], UITextField, UILabel/UITextView, UITableView, UIButton, UISwitch and UIPickerview.
Here’s a one to one mapping of simple iOS widgets to corresponding Android widgets.
- UIViewController -> Your layout xml to be inflated by your activity. The Activity java file is an equivalent of the UIViewController’s swift file. You make your class a subclass of the UIViewController and link it with your ViewController on the storyboard. When moving between Activities, you use ‘Intents’, on iOS, those are called ‘Segues’. Resources (https://developer.apple.com/library/content/featuredarticles/ViewControllerPGforiPhoneOS/)
- UITextField -> EditText or AppCompatEditText (https://developer.apple.com/reference/uikit/uitextfield , https://grokswift.com/uitextfield/)
- UILabel -> Lined TextView issh. [Factor in customizations] (https://www.dotnetperls.com/uilabel-swift)
- UITextView -> Displaying large amount of text (http://swiftdeveloperblog.com/uitextview-and-uitextviewdelegate-example-in-swift/)
- UITableview -> Recyclerview or Listview (https://www.weheartswift.com/how-to-make-a-simple-table-view-with-ios-8-and-swift/)
- UIButton -> Button (https://www.dotnetperls.com/uibutton-swift)
- UIPickerview -> Spinner (http://codewithchris.com/uipickerview-example/)
- UISwitch -> RadioButton (https://www.ioscreator.com/tutorials/uiswitch-tutorial-in-ios8-with-swift)
On demystifying XCode, I found a web resource that breaks it down was much more better than I had in mind, url below.
Note: While you can easily switch between the display mode and text editing mode for your layouts on Android. iOS doesn’t allow such freedom. You either drag and drop or programmatically create your views.
I’ll get more detailed as I write more articles.
P.S: This article was written in a rush, sort of. ✌🏾 I figured I should mention one other important thing. “Cocoapods”…. Basically, is a tool for managing libraries and dependencies in your project. Think adding dependencies to your app.gradle file. Check out https://cocoapods.org/ on how to setup and use. There are a lot of libraries for Swift and Obj-C projects. A few are listed below.
- Alamofire — For network calls.
- SwiftyJson — For serializing and deserializing json [I use EVReflection]
- SDWebImage — Picasso? Glide?
- MBProgressHUD — For displaying customized progress dialogs