IOS APp DEVELOPMENT

Do not forget convenient methods & constructions Swift provides you with.

Swift Logo

Swift has many unique (and not that unique) constructions, methods, approaches that other languages lack. As a result, many people moving to Swift from another language do not leverage its power.

Here is a list of things many people ignore while working on iOS apps.

For case:

In case you have an [Any]array or NSOrderedSet, you don’t need to check the type of each element in if let element = element as? SomeType { inside of a for loop. There is an easier approach:

Don’t forget about enumerated()

Forget about for i in 0..<object.count, you don’t need it in most cases. But if you need…


iOS App Development

In this tutorial, we will add a ContextMenu to the grid items and implement actions for goals in our SwiftUI app. We will use Combine, Core Data and the MVVM pattern.

Screenshot provided by the author

In this tutorial, we use the latest version of Xcode (12.4) and macOS Big Sur (11.2.2) for the moment of writing.

In this tutorial, we will use the app developed in the Complex SwiftUI App Tutorial. Part 2. Main View tutorial, so I recommend going through it. Otherwise, if you do not want to do this, you can simply download the starter project here.

What We Will Do Today

Today, we will make our goals marked as done for today and start storing records on how we perform over time. Also, we will add editing and deleting goals. …


iOS App Development

In this tutorial, we will add a view and its viewModel for the main screen of our SwiftUI app. We will use Combine, Core Data, MVVM pattern and Protocols.

Screenshot provided by the author

In this tutorial, we use the latest version of Xcode (12.4) and macOS Big Sur (11.2.1) for the moment of writing.

In this tutorial, we will use the app developed in the Complex SwiftUI App Tutorial. Part 1. Designing Model tutorial, so I recommend going through it. Otherwise, if you do not want to do this, you can simply download the starter project here.

What We Will Do Today

Today, we will create a view that will present a grid of your goals and another one to add new ones. We will make our code clean and testable and make sure the grid of goals…


iOS App Development

In this series of tutorials, we will create a complex app using SwiftUI, Combine, Core Data, MVVM pattern, and Protocols.

Photo by Kari Shea on Unsplash

In this tutorial, we use the latest version of Xcode (12.4) and macOS Big Sur (11.2) for the moment of writing.

There is no shortage of SwiftUI tutorials nowadays, so everyone can find something that works most for them. I created such a series of tutorials too.

But those tutorials are mostly for beginners and do not cover much of the additional features that SwiftUI or Combine have. Nor do they have complex architecture or logic.

In this series, we will create a complex app with several views, several Core Data entities, and a lot of under-the-hood things. …


iOS App Development

Another approach to DI in Swift 5.1+ with Property Wrappers.

Photo by Alex Knight on Unsplash

If you’re a developer, you probably know that Dependency Injection is required in any decent project. You can’t live without it, since it helps you make your project testable, helps to loosen tightening between your classes and brings many other advantages.

But also, you might know DI forces you to write an extra code and init methods take a ridiculously huge number of parameters. Imagine you need to create ImageDownloader that has dependencies on NetworkManager (to download an image), FileManager (to cache the image), NotificationCenter (to post a notification when the image is downloaded) and AnalyticsManager (to log if there…


Photo by Halacious on Unsplash

He did not want to pull the trigger. Yet, he had no other option.

His exact copy was staring at him. The situation was terrifying. He could not believe he had made a mistake in his calculations and the teleportation did not work.

Well, actually, it did work… in a way. Instead of moving him instantly from one place to another, the machine created a copy of him.

It was far from being a good decision to try teleportation on himself, now it was obvious, but it was not a time to think about it, now he had to fix…


iOS App Development

A guide to using Core Data to store data in your iOS app

Photo by Campaign Creators on Unsplash

In this tutorial we’ll add Core Data as a persistent storage to our To-do list app. You’ll see how easy it is to add a database to your app using Apple’s framework CoreData. Also, since we were using Protocols and hid all the logic behind them in our app, it should be pretty easy to add Core Data and replace the current temporary data storage layer in the app.

In the tutorial, we use the latest version of Xcode (11.5) and macOS Catalina (10.15.4) for the moment of writing.

You can use this tutorial on its own, yet we’re going…


Health Improvement

I quit added sugar for 21 days and share what’s happened so far with my body and mind

Photo by Brigitte Tohm on Unsplash

I’d always had a sweet tooth. Couldn’t help it, I just used to eat a lot of sweets, chocolate, cookies every day. When I changed my job and my employer had free coke, I started drinking coke a lot as well.

We all know it’s bad for our bodies, teeth, blood sugar level, energy, there’s no surprise for anyone. But, friend, it’s so finger-licking good! Actually, it was.

I heard that to obtain a new habit or get rid of an old one, we need to make a commitment and stick to it for 21 days in a row. After…


iOS App Development

In this tutorial we’ll create a framework for your app. It’s a good way to divide your app into independent modules and allow to reuse your code in different apps.

Photo by Caspar Camille Rubin on Unsplash

In this tutorial, we use the latest version of Xcode (11.3.1) and macOS Catalina (10.15.4) for the moment of writing.

Usually, it’s a good idea to divide your app into separate parts. It allows you to make your modules even more independent, test them separately, reuse code and even create independent frameworks and deliver them into your app using Swift Package Manager (SPM), CocoaPods or Carthage supporting different versions for different apps.

Sounds awesome, right? But even if it doesn’t, let’s create a new framework and we’ll see how good it is.

You can use this tutorial on its own…


iOS App Development

In this tutorial, we will create a simple To-do list app, learn how to reuse views in Lists, implement interaction with the model and dynamic update of views. We will use the brand new frameworks, SwiftUI and Combine, released by Apple in 2019. We will use the MVVM pattern and the Protocol-Oriented Programming paradigm.

In this tutorial we use the latest version of Xcode (11.3.1) and macOS Catalina (10.15.4) for the moment of writing.

SwiftUI and Combine are brand new frameworks introduced on WWDC 2019 by Apple that dramatically change the way we develop iOS apps. These frameworks make our work faster and more convenient, help us write readable code and allow us to test code easier.

Alex Zarr

Lifelong learner, iOS Developer striving for self improvement

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store