Combine CoreData and SwiftUI | SwiftyLion
Recently I had to build an app using SwiftUI and CoreData. I thought CoreData was used almost as you would use it with UIKit, but apparently there are some differences. This guide is intended as a summary of my experience using CoreData combined with SwiftUI….
Apple Watch Water Lock | SwiftyLion
Are you planning to create an app that will be used while swimming or doing water activities? If so, you will need to lock the Apple Watch touch screen to prevent accidental taps while submerged. Usage The WatchKit framework provides a method to lock the…
Persistence Controller Example | SwiftyLion
import CoreData struct PersistenceController { static let shared = PersistenceController() static var preview: PersistenceController = { let result = PersistenceController(inMemory: true) let viewContext = result.container.viewContext for _ in 0..<10 { let newItem = Item(context: viewContext) newItem.timestamp = Date() } do { try viewContext.save() } catch…