
Colin, an iOS developer from Hong Kong with over a decade of experience, introduces this course for junior to mid-level developers, sharing practical insights you can apply to your projects.
Learn to build an interactive enrollment form with SwiftUI and Compose frameworks, featuring form validation, dynamic show/hide fields, inline error messages, and robust update and submit button behavior.
Understand the requirements, pursue technical design before coding, build the app from scratch, and add unit and snapshot testing to create a reusable template for interactive forms.
Learn to build an enrollment form for a sports team using swiftui and compose, with name validation, regex checks, a gender picker, and dynamic uniform size fields.
learn to plan software design before coding with diagrams and team discussions, then bind form data to the user interface using swiftui and compose frameworks, with validators and submission controls.
Create and configure a SwiftUI Xcode project to build a base form app, adjust deployment targets to iOS 16.0+, rename the form view, and run the app to verify.
Create the name field in a SwiftUI form, implementing the error protocol and inline error view, plus the name field validator and data binding for validation.
Create a phone form field with robust error handling for empty or invalid input, using regex validation, a dedicated form field view, and updates to form data and layout.
Create a gender field by defining a gender data type with male, female, and other, binding it to a segmented picker, and adding a simple validator in the form.
Extend the form with uniform fields by adding a toggle for uniform size and a picker linked to a secondary screen, wired to validation and conditional UI.
Create a submit button with enabled state binding and a click handler, green when enabled and gray when disabled, and output the form data as json for submission using Combine.
Write unit tests for gender and uniform size data types, validating id and display title. Run tests to ensure they pass in the master form test target.
Audit and implement unit tests for validators across name, form field, gender, and uniform size. Validate error messages for empty, too short, too long, and invalid inputs, including uniform requirements.
Unit test the form data object in a SwiftUI app by validating data bindings, validators, and error states. Confirm submit button status and JSON submission data.
Master snapshot testing of SwiftUI forms using Swift Snapshot Testing. Install the dependency in Xcode, create snapshot tests for the form view, and verify initial, unhappy, and happy flows.
Summarizes building an interactive form with SwiftUI and compose frameworks from requirements to design and implementation. Includes data binding with observable objects, validators, and comprehensive unit and snapshot tests.
Explore building forms with SwiftUI and compose frameworks, using a 500-line template, embracing single responsibility principles, and validating views with Swift snapshot Testing.
Explore how to extend your interactive form project using SwiftUI and compose frameworks, applying design before coding, unit testing, and snapshot testing, while sharing feedback and future topics.
To build a "web" form, you usually need to validate data, hide or show related fields, display errors, and update the "submit button" status. I always find it challenging to create an interactive form in an iOS App because we don’t have a certain architecture or design pattern to follow.
After Apple released SwiftUI and Compose frameworks in 2019, things got much easier. However, it still needs a bit of design effort to make the code testable and maintainable. That’s why I was inspired to make this course, in which I will teach you how to build an interactive form with SwiftUI and Compose frameworks.
Steps:
1. Understand the requirements of the project
2. Do the technical design with software design principles
3. Build the App step by step from scratch with Xcode
4. Add unit testing and snapshot testing and reach a testing coverage around 93%
What you will learn within this course :
How to leverage SwiftUI to build interactive iOS Apps.
How to decouple logics to make the code more testable and maintainable.
A well-designed template for building interactive forms that you can use in your project for free.
The best software engineering practices like designing before coding, unit testing, and snapshot testing, etc.