SwiftUI has been officially released with Xcode 11 and in this introductory step by step tutorial we are going to build an app which lists hiking trails near Silicon Valley. Get started by creating new Xcode project using Single View App template, name it “HikingSiliconValley” and make sure to select “SwiftUI” as User Interface. Get …
Month: September 2019
How to customize the appearance and behavior of UI elements in SwiftUI using modifiers
SwiftUI modifiers can be applied to views in order to customize their appearance. Modify a Text view to make it bold: Text(“Simple Swift Guide”).bold() Multiple modifiers can be applied at the same time. Modify a Text view to make it bold, italic, underlined and change text color to red at the same time: Text(“Simple Swift Guide”) …
How to use stacks: HStack, VStack and ZStack in SwiftUI (Equivalent of UIStackView in UIKit)
Using stacks in SwiftUI allows you to arrange multiple views into a single coherent view with certain properties. HStack allows to arrange its child views in a horizontal line. VStack allows to arrange its child views in a vertical line, and ZStack allows to overlap its child views on top of each other. Stacks can …
How to customize shortcuts bar above the keyboard with UITextInputAssistantItem on iPad
iPadOS has a support to customize shortcuts bar displayed above the keyboard with your own buttons. You can utilize two areas in the shortcuts bar – a leading area which is positioned before the typing suggestions and a trailing area which is positioned after the typing suggestions. Each area is organized into its own groups …