Zone of Development

by Damiano Abballe

Category: Swift

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

SwiftUI – Slider

In this post, we will see how to create and manage a Slider in Swift, with a min value equal to 0 and a max value equal to 10 (with a step of 1). Moreover, every time Slider will change value, the app will run a method. We open Xcode, we create a “Single View […]

Read More

SwiftUI – Custom Botton style

In this post, we will see how to create a custom button style in Swift. First of all, we create a swift project and we add, in the file ContentView, this code: [ContentView.swift] Obviously the application is very easy, but it isn’t the principal goal of the the post. If we run the application, this […]

Read More