Author: Answertopia

  • Creating a Customized SwiftUI ProgressView

    The SwiftUI ProgressView, as the name suggests, provides a way to visually indicate the progress of a task within an app. An app might, for example, need to display a progress bar while downloading a large file. This chapter will work through an example project demonstrating how to implement a ProgressView-based interface in a SwiftUI…

  • Working with Gesture Recognizers in SwiftUI

    The term gesture is used to describe an interaction between the touch screen and the user which can be detected and used to trigger an event in the app. Drags, taps, double taps, pinching, rotation motions and long presses are all considered to be gestures in SwiftUI. The goal of this chapter is to explore…

  • SwiftUI Animation and Transitions

    This chapter is intended to provide an overview and examples of animating views and implementing transitions within a SwiftUI app. Animation can take a variety of forms including the rotation, scaling and motion of a view on the screen. Transitions, on the other hand, define how a view will appear as it is added to…

  • Basic SwiftUI Graphics Drawing

    The goal of this chapter is to introduce SwiftUI 2D drawing techniques. In addition to a group of built-in shape and gradient drawing options, SwiftUI also allows custom drawing to be performed by creating entirely new views that conform to the Shape and Path protocols. Creating the DrawDemo Project Launch Xcode and select the option…

  • Building Context Menus in SwiftUI

    A context menu in SwiftUI is a menu of options that appears when the user performs a long press over a view on which a menu has been configured. Each menu item will typically contain a Button view configured to perform an action when selected, together with a Text view and an optional Image view.…

  • Building Tabbed Views in SwiftUI

    The SwiftUI TabView component allows the user to navigate between different child views either by selecting tab items located in a tab bar or, when using the page view tab style, by making swiping motions. This chapter will demonstrate how to implement a TabView based interface in a SwiftUI app. An Overview of SwiftUI TabView…

  • Building SwiftUI Grids with LazyVGrid and LazyHGrid

    In previous chapters we have looked at using stacks, lists and outline groups to present information to the user. None of these solutions, however, are particularly useful for displaying content in a grid format. With the introduction of iOS 14, SwiftUI now includes three views for the purpose of displaying multicolumn grids within a user…

  • A SwiftUI List, OutlineGroup and DisclosureGroup Tutorial

    The previous chapter covered the List, OutlineGroup and DisclosureGroup views and explored how these can be used to visually present hierarchical information within an app while allowing the user to selectively hide and display sections of that information. This chapter will serve as a practical demonstration of these features in action through the creation of…

  • An Overview of SwiftUI List, OutlineGroup and DisclosureGroup

    The preceding chapters explored the use of the SwiftUI List view to display information to users in an ordered manner. Lists provide a way to present large amounts of information to the user in a navigable and scrollable format. The features of the List covered so far, however, have not introduced any way to display…

  • A SwiftUI List and Navigation Tutorial

    The previous chapter introduced the List, NavigationStack, and NavigationLink views and explained how these can be used to present a navigable and editable list of items to the user. This chapter will create a project that provides a practical example of these concepts. About the ListNavDemo Project When completed, the project will consist of a…