Category Archives: Swift

iOS app – The word clock

By | 06/10/2020

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()

By | 23/09/2020

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

By | 28/08/2020

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:

SwiftUI – Slider

By | 12/08/2020

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

By | 21/07/2020

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 »

Swift – Unit Test

By | 17/07/2020

In this post, we will see how to create a Unit Test in Swift, in order to test a function called IsNumberEven used to check if a number in input is either even or odd. First of all, we create a Swift file called Core, where we will define the function IsNumberEven: [CORE.SWIFT] Obviously function… Read More »

SwiftUI – TabView

By | 19/06/2020

In this post, we will see how to create a TabView, used to show two different Pages. We start, creating two SwiftUI views called Page1 and Page2: [PAGE1.SWIFT] [Page2.swift] Then, we will add another SwiftUI view called TabMenu where, we will define the TabView: [TABMENU.SWIFT] We have done and, if we run the application, this… Read More »

SwiftUI – Picker

By | 27/05/2020

In this post, we will see how to add a Picker for selecting Sex in the form created in: How to create a Form First of all, we define an array with all the items to display in the picker and then we define a variable where we will save the Picker’s item chosen: Then,… Read More »