Hi, thanks for visiting!

My name's Sam Kelleher, and I am a Senior Full-Stack Web Developer / Software Architect based in London. This website mostly contains a sample of work from my portfolio, tips, and best practices for building web applications.

Crypto App using SwiftUI

Crypto App using SwiftUI

In my recent day-to-day work, I don't come into much contact with writing vanilla iOS apps directly. Despite being quite knowledgable in mobile app development, and the Swift programming language, I don't use these skills often.  For this reason, I often in spare time (such as waiting at airports) write small apps, and review tutorials for using the latest advancements in programming languages like Swift, and the associated tooling like Xcode.

In this example, I wrote a totally vanilla Swift app from scratch, this time implemented using SwiftUI for the first time - which evolves from work I've done previously using the really old story boards or UIKit.

Native programming has been quite slow to keep pace with very rapid web development.  I'm not sure of the reasons why, probably due to specific hardware requirements of mobile operating systems. Previously on Objective-C you had to to resource counting and allocate and deallocate memory resources in a very manual way, which hardly was a concern for web development.

Fast forward several years, Swift is beginning to look a lot like JavaScript, very similar syntax and style and the basics of async/await are also here now.  I remember when C# got this advancement years after browsers got Promises.  SwiftUI is very similar UI in code using a declarative syntax not too dissimilar to what we do in React with JSX.  You can also use function calls instead of JSX to write UI code in this way.  The principle is the same, the UI is rendered to a specific input shape; thus we don't need to worry about consistency or resource management as the system can handle that for us automatically.

The only real difference beyond that is how to trigger 'renders', which is where the bindings etc used from Swift come in and work quite well.

In this example app, I connect to third party APIs, download and parse data in a type safe way handling errors. And allow the user to browse a catalog of coins, and add them to a portfolio which is stored locally.  As the data refreshes, so does the UI.  Out of the box the UI design of SwiftUI is very modern, meaning, with a relatively simple input we can write a quite sleek and fast and reliable app.

Even simple apps using React native still feel a bit laggy to me.  Most use cases I encounter in business have simple uses in apps which is why I keep my skills on Swift up to date.

In Category Experiments/Tags   iOS