Zone of Development

by Damiano Abballe

Category: Swift

SwiftUI – How to call a Rest API with Combine

In this post, we will see how to consume a Rest API in Swift with Combine.We will use a Rest API that it will get us the list of the annual holiday for Italy in 2022. But first of all, what is Combine?From Apple web site:“The Combine framework provides a declarative Swift API for processing […]

Read More

SwiftUI – MVVM

In this post, we will see how to implement MVVM pattern in SwiftUI.But, what is MVVM pattern?From wikipedia:“Model–view–viewmodel (MVVM) is a software architectural pattern that facilitates the separation of the development of the graphical user interface (the view) – be it via a markup language or GUI code – from the development of the business logic or back-end logic (the model) so that the view is not dependent on any […]

Read More

SwiftUI – How to display an Enum in a Picker

In this post, we will see how to display an Enum in a Picker.First of all, we start creating a new project called ViewEnum where we will add a file called LstCars, used to define an Enum consisting of a list of car brands: [LstCars.swift] Finally, we define a Picker in the file ContentView where […]

Read More

SwiftUI – How to show an Alert

In this post, we will see how to implement an Alert in SwiftUI. We create a project called AlertTest and add this code in the file ContentView: [ContentView.swift] This is all and now, if we run the application, this will be the result:

Read More

SwiftUI – Tips for button

In this post, we will see three tips that might help us to create buttons in our applications. First of all, we open Xcode, we create an iOS project called TestButton and we add three buttons: Then, we create a new Swift file called ButtonStyleCustom where we will define the style that we will use […]

Read More

iOS app – The word clock v. 2.0

I am very happy starting the 2021 with the new version of TheWordClock.In these release, I have fixed some bugs and I have introduced the alarm clock. If you want to download it, find “Thewordclock” in the App Store or go to:https://apps.apple.com/it/app/thewordclock/id1533151993?l=en

Read More

SwiftUI – How to create a Splash Screen

In this post, we will see how to create a Splash Screen with SwiftUI. First of all, we create a “Single View App” project: Then, we add a SwiftUI file called Page1 where we will define our principal view: [Page1.swift] The view is very easy and simple but, it isn’t the main goal of the […]

Read More

iOS app – The word clock

Finally, I have deployed my app called ”The word clock”.It is a nice word clock for iPhone, where minutes and hours aren’t static but they change their position.This is the first version and it shows only the time.In the next version, I will add other features like alarm and widget. If you want to download […]

Read More

SwiftUI – clipShape()

In this post, we will see how to use clipShape() in order to clip an image controlling its shape.But what is clipShape()?From Apple developer web site:“Sets a clipping shape for a view.Use clipShape(_:style:) to clip the view to the provided shape. By applying a clipping shape to a view, you preserve the parts of the […]

Read More

SwiftUI – How to show a sheet view modally

In this post, we will see how to show a sheet view modally in Swift, after pressing a Button. We start creating a SwiftUI view called Page2, that it will be the sheet view: [Page2.swift] Then, we define the started page called ContentView, where we will add a button used to show the Page2 view: […]

Read More