In this tutorial we’re going to learn how to build a horizontal, linear progress bar indicator in SwiftUI. The sample app will include two buttons – one will simulate the progress and will keep updating the progress bar with new value, and the other will simply reset the progress bar to its initial state. Start …
Month: November 2019
How to add image to Xcode project in SwiftUI
In this introductory tutorial you’re going to learn how to add images to SwiftUI Xcode project and use them in your SwiftUI code. First of all, you need to have an image available on your Mac which you’d like to use in your SwiftUI app. If you don’t have one, feel free to download it …
How to use custom fonts in Swift iOS app using SwiftUI
There are several steps you need to perform in order to add a custom font to your Swift iOS app. The steps outlined below apply to both SwiftUI and UIKit apps. This tutorial assumes that you already have your font files handy on your Mac (if not, don’t worry, at the end of the tutorial …
SwiftUI Font tutorial
Learn how to use fonts in SwiftUI and customize Text view in SwiftUI with number of Font options such as design, size, weight, color and others. SwiftUI lets you customize Text by applying a .font() modifier. The default iOS font is called San Francisco and if you don’t explicitly change it, then all of your text will …
How to present a sheet modally in SwiftUI
In this tutorial we’re going to learn how to present a new sheet view modally in SwiftUI after pressing a button. In order to achieve it, use .sheet() modifier on the Button view. In its simplest form, the .sheet() modifier takes as an argument a binding which tells it whether to show the sheet, and …
How to add button to navigation bar in SwiftUI
In this tutorial we’re going to learn how to add buttons and images to navigation bar in SwiftUI’s NavigationView. In order to achieve this goal we’re going to use the navigationBarItems modifier which lets you specify leading and/or trailing bar items (e.g., buttons, images or other SwiftUI views). Leading items are being added to the left side …