SecureField in SwiftUI is a simple control that shows an editable text interface while masking user input to keep it private just in case anyone was watching over their shoulder. SecureField is great for creating secure password input text fields and it works exactly the same as regular TextField. We’ve covered TextField extensively in a previous …
Month: October 2019
SwiftUI TextField complete tutorial
TextField in SwiftUI is a simple control that shows an editable text interface (equivalent to UITextField in UIKit). Because TextField allows a user to type text, it also needs a way of storing the entered text in a State variable which can then be used to read the input. The appearance of TextField can further be …
SwiftUI Text View complete tutorial
Text is a view in SwiftUI which displays one or more lines of text. Experiment with the code presented below on your own to get a feel of how to work with Text view in practice. In its simplest form, to display one line of text, use it like that: Text(“SwiftUI Text View Tutorial”) To …
How to make HTTP PUT request with JSON as Data in Swift
In this tutorial we’re going to learn how to make an HTTP PUT request using uploadTask(with:from:) method by sending a JSON dictionary as a Data structure. In general, PUT request is great for creating a new resource or overwriting it. As you can see from Apple’s documentation, the uploadTask method looks like this: func uploadTask(with request: URLRequest, …
How to create a single view iOS app in Xcode – Beginners guide
In this introductory, step by step tutorial, I’m going to walk you through the basic steps of creating a Single View App in Xcode for either SwiftUI or Storyboard development. This tutorial assumes that you have a Mac computer running the most recent version of macOS and that you have an iTunes account set up. …
How to add NavigationView to List in SwiftUI and show detail view using NavigationLink
In previous posts we learned how to create a List with custom rows and how to customize a List (using sections, header and footer). Today, we’re going to add a NavigationView to our List and implement a detail view for each row in the List using NavigationLink. First, we need to embed our List in NavigationView and set …
How to customize List in SwiftUI with sections, header and footer
In previous post, we learned how to create a List with custom rows. Today, we are going to extend our List by adding a section with a header and a footer. On top of that, we’re going to use a technique which hides empty rows in the List to make it look like this: This …