SwiftUI - custom navigation bar title
Andrew Fletcher 12 March 2021 (updated) 3 minutes read
How to remove row separators from a Form or List in SwiftUI?
Andrew Fletcher 5 March 2021 (updated) 2 minutes read
Struggling to hide the SwiftUI separators in a List or Form?
The challenge
Creating the following form, separation lines appeared between NameLayout, FinalPhoto, RawPhoto, ApertureLayout and SubmitButton.
var body: some View { GeometryReader { geometry in Form { // layout elements NameLayout() FinalPhoto() RawPhoto() ApertureLayout() SubmitButton() } } }
Core Data - customising the data model with a enum
Andrew Fletcher 2 March 2021 3 minutes read
Core Data - customising our data model
When you are using Core Data, and let's say that you have a requirement to have an attribute where the options available should be a defined list. Such as "Not Started", "Pending", "In Development" and "Completed". How do you create this as an option in Core Data?
SwiftUI: How to create and manage a List with ObservableObject
Andrew Fletcher 24 February 2021 3 minutes read
Xcode succeeded but nothing happens
Andrew Fletcher 16 February 2021 1 minute read
SwiftUI buttons - isPressed, isEnabled changing colours depending on action or state
Andrew Fletcher 8 February 2021 2 minutes read
Cannot find '' in scope
Andrew Fletcher 29 January 2021 (updated) 1 minute read
SwiftUI - publishing changes from background threads is not allowed
Andrew Fletcher 29 December 2020 (updated) 3 minutes read
The purple warning notification of annoyance recently came my way! I received the following warning:
Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.
What was happening?
The functionality of the code uses URLSession to get a user's name via API and the display is simple piece that initially message of Hello {user}.
SwiftUI - initialiser without initialising and binding parameters errors
Andrew Fletcher 12 March 2021 (updated) 4 minutes read
SwiftUI String to Binding<String> error
Andrew Fletcher 4 August 2020 (updated) 2 minutes read