Basic iOS Cheat Sheet For Android Developers v4 Jakub Chmiel
Basic iOS Cheat Sheet For Android Developers v4 Jakub Chmiel
Developers
This is a short cheat sheet that I created to improve communication in mobile development. As
Android reference I used Kotlin but it should be easy to understand for Java developers too.
Language differences
Objective C is the Java of iOS whereas Swift is very similar to Kotlin. Like Kotlin in Android,
Swift is a preferred language for new projects. Swift is a newer, modern language developed by
Apple to make life easier for developers. Despite that Objective C is still popular and according to
data from JetBrains in 2019, almost 50% of iOS developers still know Objective C.
Kotlin vs Swift
Here I covered Kotlin equivalents in Swift. Note that these equivalents are not identical,
usually have small differences.
Note that both Garbage Collection and ARC manage memory but work in completely different
ways.
Android iOS
null nil
val let
var var
let if let
this self
fun func
when switch
Map Dictionary
Nullable Optional
listener delegate
interface protocol
Framework differences
Lifecycle
Both Android and iOS Frameworks have a lifecycle. But in iOS, there are 2 important functions
that don’t exist.
onActivityResult -> doesn’t exist. You have to use Navigation Controller with delegates (listeners).
Also, note that it’s tough to compare lifecycles from Android and iOS. I think that more detailed
comparison deserves a separate article.
Android iOS
onDestroy viewDidUnload
Creating layouts
iOS is nothing like Android when it comes to layouts. In iOS, most of the layout oriented work is
done using a mouse (like in the ‘Design’ mode in Android Studio) and Swift. For layouts you can
use:
2. Storyboards (one file with many views and navigation). Introduced in iOS 5. Manage many
views and their navigation in one file.
Android iOS
OkHttp AFNetworking/Alamofire/URLSession
Picasso/Glide SDWebImage/KingFisher
Timber CocoaLumberjack
RxJava/RxKotlin RxSwift/Bond
Retrofit Moya
GSON/Moshi SwiftyJSON/Codable
Spek Quick
View differences
Note that iOS doesn’t have ViewGroups because they are regular Views.
Android iOS
TextView Label
ViewPager PageViewController
View.VISIBLE/View.INVISIBLE isHidden
enabled userInteractionEnabled
Spinner PickerView
Summary
It’s good to know Android equivalents in iOS. Usually, it’s better to communicate using names
well known in programming, not only in your framework. But it’s not always possible or just
doesn’t happen.
Update: Check out r/androiddev Reddit discussion about this article which supplements it and
brings many good ideas.