Mastering SwiftUI Development by Building Pomodoro Tracker — Step 1: Introducing Swift and SwiftUI
In case Pomodoro is a new term for you: let me give you a quick idea,
“It is a simple technique of making sure your 20mins of work is really is a 20mins of work: no Facebook, WhatsApp or 9GAG “
You set a timer for 20mins, and start working. A deep one. Once timer off, you are free to do anything for 5mins. After several of these 20mins of work, you are elligible to have 15–20mins of rest. You decide how many 20mins of work are worth a 15–20mins of rest. Here is a simple illustration of those techniques:
Simple, right? It is. It’s dead simple! But it can boost your productivity at an amazing rate!
In series of these articles, I am going to teach you how to develop a Pomodoro tool that reside seamlessly in your macOS menubar. Subsequent series will teach you how to develop similar tool for iOS.
So, let’s start!
What is SwiftUI?
SwiftUI to Apple, is what Universal Windows Platform/UWP to Microsoft. It’s the latest incarnation of Apple ammunition to make developing application in their ecosystem powerful, robust yet easy. Being the sole dictator of their own ecosystem, Apple have no competition in this regard. XCode as their IDE for SwiftUI feels polished and tightly integrated to all of Apple target device: iOS/macOS/WatchOS/tvOS.
What is The Differences between Swift and SwiftUI?
Firstly, before Swift, there is Objective-C: a Smalltalk + C like programming language developed by NeXT for its NEXSTEP operating system. Being descendand of NEXSTEP, Apple use Objective-C as their programming language. During its natural course of evolution, Apple then invented Swift to be the successor of Objective-C with important features: safer and easier than Objective-C.
Finally, SwiftUI is a toolset for Swift to create declarative user interface for Apple intended target device: iOS/macOS/watchOS/tvOS.
Can SwiftUI Create Android Application?
For the moment, no. SwiftUI is still Apple paradigm for their own ecosystem. Swift in itself is an open source project. This mean, it’s already working in Windows (hell yeah!). But as SwiftUI is a GUI tool, this mean it’s not easily translateable to other environment than Apple (you can’t possible think Apple will implement their sleek Apple UX for Android user, right?)
But, if at the moment you want to use Swift and develop only one code base for either iOS or Android, you may check SCADE. Albeit a paid solution, it’s cheap for its advantage. In my opinion, Apple will not making SwiftUI accessible to Android users anytime soon.
NOTE: try to differentiate between Swift and SwiftUI. Swift (the language) is open source and cross platform. While SwiftUI (the UI framework) is closed source and only works on Apple
So, What’s Next?
Now that we have a basic understanding of the term in Swift ecosystem, in th next article we are going to start developing our first SwiftUI application. You system simply need to have BigSur (or latest one) installed. As for the device, a base Macbook Air M1 is perfect to develop this application. While for intel based system, a Macbook Pro 8gb is recommended. You can’t work comfortable in a base Intel Macbook Air (only 4gb there).
Stay tune!