iOS Developer toolkit
If you are into iOS Development or you just got your first new MacBook and you are about to dive in, this is a list of things you must know about, so you keep up with the pace.
Swift have been announced in Apple WWDC 2014, and it was a major announcement from Apple in a WWDC keynote, and it showed what kind of path Apple is taking with its ecosystem. Swift runs Apple’s stock apps but millions of apps on the App Store. 2 years later, Swift have gone open source and became one of the most used programming language in the word. From hosting web servers to running across all available platforms, Windows, Linux, macOS, Swift is now more than mature and spending your time deepening your knowledge will land you great opportunity in the future. One major I had to tell you about, is how good the direction is taking as a programming language. Driven by the community, and managed by the awesome team at Apple, tons of feature have been added in the last couple of years. GCD or Grand central dispatch is a common to every iOS developer, right ? For the beginners
It is Apple library that let us deal with all the asynchronous programming in Swift
Basically, every UI language has to deal with parallel programming. Which means we can do certain stuff or heavy operation on the background without letting the user wait.
Async / Await
Yes, that’s right ! You probably have heard of (You really should), Swift will get support for Async / Await and will make our code cleaner and avoid the Pyramid of doom 😱. At this date, it is currently in review process and will make it’s way to release soon. You can read more about it here, or follow the latest Swift news here.
Swift 5.5 is out, and it contains async/await, actors and many more improvements and features that we, developers can benefit from. Checkout this revision history to find out the latest versions log.
I think Augmented Reality is more than just a trend. This technology will persist and find its way in our every day life. Simply by looking at Apple direction seeking hardware integration with LiDAR, Augmented Reality will be a thing in a year or two on all Apple devices.
Apple made available ARKit which is a set of tools that simplify the integration of AR functionalities. It’s currently on its second version, which added multiple device interaction.
It’s currently considered as a great approach by the market which give customers a chance to try before they buy in a unique experience that have will enhance brand value and achieve more sales.
You can check a curated list of the best ARKit project I found on GitHub.
SwiftUI is a declarative programming language, which basically means you declare UI components and let the system handles it depend on the condition you described. Most questions newbie have been asking, should you learn SwiftUI or UIKit ?
To answer their questions
Yes, UIKit is a must, but you should consider some of your time for SwiftUI.
Let me recapitulate. SwiftUI had been out for almost two years and has been getting updates and new features in every Xcode and iOS or macOS release.
Once you try it, you will love it.
Mobile frameworks were always competing for TimeToPublish kpi or easy to get started. Let’s be clear, easy stands for how much the framework offer for boilerplate code, and it’s one of the best of Flutter (apart from being cross-platform) is how fast you can develop a POC or an application that is ready to publish while UIKit is kind of harsh (you will get used to) to build a simple app and use a set of basic components.
SwiftUI comes in as a real contender to simplify all the process needed by the UIKit framework. It lets you develop a basic or complex app in record time, support multiple screen sizes and multiple platform. Indeed, apps that support iPadOS can basically run on macOS with only a simple toggle, and it’s called MacCatalyst.
Beware, there is always a catch
While SwiftUI is not in beta anymore, it’s likely you will have to change a certain part of the code every new release due to Apple’s work in progress. Some things may break but most of the time, it’s just a minor, and you will get going.
Here, you can find great SwiftUI tutorials published by Apple. But you can go even deeper and check this list of the best about SwiftUI
The list is not complete, but I think it’s enough for you to get started.
Apple latest addition to its framework was SwiftUI that used an entirely new approach on how we develop for Apple’s platform. One of the great set of complementary was the Combine Framework. It’s basically Apple’s response to RxSwift or more precisely to the reactive programming paradigm.
Rx stands for reactive extension
And it’s so popular in many programming languages these days. It lets you deal with streams of data, which you need to observe, so the UI react automatically to the changes. It all happens in an asynchronous manner, and that’s why this is so popular in Front-end programming language, where dealing with a non-blocking UI is a must.
Let me show a basic example using Combine where I fetch a user profile name and address from a server and affect it to labels.
This example uses MVVM which you really should consider when developing your applications, and it got easier with Apple latest frameworks.
Yep, they have been there for a long time. Apple’s debugging tools are quite handy when it comes to searching for that little bug that causing memory leak or some misplaced UI components.
Let’s start with the debugger. It is one of the useful tool in Swift and Objective-C. While they are built on top of C and C++, they have the privilege to use all the tools that are already made. LLDB is one of the best debugger and is being maintained over the years.
Use the power of `po`
When you set a breakpoint at a certain line of your code, the application will pause and the debugger tool will show up in Xcode. Using the command `po variable name`will let you access the current variable value. `po`stands for print object, but it can do more, it let’s execute code directly on the device.
Let’s say you have an Endpoint to consume in your application, and you are facing an issue where sometimes it doesn’t decode correctly (BTW, you should be using Apple’s Codable class to deal with external representation like Json).
Break point on that line, and
po try! decoder.decode(..) // decoder will crash and let you know what part didn't convert properly
You can literally `po`everything running on your application. You can access UI components memory like a UILabel and change its text.
Did you ever ask why you placed a view somewhere and on runtime it never gets its correct position ?
It is a built-in tool that can establish a visual view hierarchy that let you see the constraints, properties of each of your viewLayer. It’s a real great tool you should take a look at.
XCTest & XCUITest
Apple announced XCTest Framework at WWDC 2014. And over the years it’s been developed and enhanced giving the end developer a great tool to measure, validate, diagnostic it’s application through the development process maintaining a stable level in performance and automating the test process of the app crashes after code or structures changes.
A developer that write unit test is 10 times appreciated and considered than a developer writing only code, and this could help you a lot at getting a role at your favorite company.
- It is linked directly to Apple’s framework and works natively with Xcode so no third parties imports needed.
- Easy to write, to understand, to diagnostic a problematic block of code with all the measure numbers and Xcode debugging messages.
- Written in Swift
- Does not have access to hardware. Simulating a basic test on device hardware state like not enough memory or disk space, throttled CPU, slow internet can not be done using XCTest.
- Run unit test in a separate block, or the workflow may become slow and unresponsive.
- Reports are not exportable.
As we are early in the year, I believe you need to set your goals and ensure you make them happen and one essential goal, is to publish right away the app you’ve been working on a long time ago or your new side project. Publishing is a process that every developer should go through, dealing with reviewers, preparing the app description, reading about guidelines.
So here are some best practice you should consider :
This is your first impression, first attraction to a scrolling-through user. Imagine that the user doesn’t really know what he really wants. A good describing screenshots, with good storytelling through a nice series of screenshots.
Your app description is your best-selling point. Go through the experience, what the final user will get when using your app. Talk about the added value and not only about features.
- Small Business Program
You are not a million-dollar company, right ? So if your app contains in-app purchases, you should register for this program. 15% on each transaction is quite a few encouraging dollars if you happen to be an indie dev.
It will never let you down 👊🏻. Share your app with a group of indies, talk about it with your friends and family. You have a product, and you need to sell it because it will not sell by his own.
Behind every great ecosytem is a great community.
Yes, the iOS community is full of great, supportive and helpful people. You can explore, ask or watch for the biggest sharing their finds, thoughts which will make you gain experience and knowledge. Twitter, Reddit are the most notable platform you should begin to explore.
Here, is a bunch of links where you should start looking.
You are ready !
Primal Knowledge acquiring will get you a great background and skills in problem-solving, situation evaluating, etc…
Through those lines, I shared what I have been acquiring through my findings, reading and my journey as an iOS Developer. Hope you learned something today.
If you have any question, let me know in the comments and Clap if you learned something new.
Reach me out on Twitter.