Post

Replies

Boosts

Views

Activity

Reply to Index out of range, SwiftUI
The problem is not the onTapGesture (the onTapGesture is also a placeholder), the problem is that valori has fewer elements than valoriAsseX, I want that if valori[I] doesn't exist it becomes 0. Don't look at the onTapGesture, it's not a problem
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’21
Reply to @AppStorage with Date in SwiftUI
extension Date: RawRepresentable { public var rawValue: String { self.timeIntervalSinceReferenceDate.description } public init?(rawValue: String) { self = Date(timeIntervalSinceReferenceDate: Double(rawValue) ?? 0.0) } } This one works Thank you!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to App increases size even if I delete data (Core Data)
You should probably have to recreate the database completely, just keeping existing records. If you can explain better your solution it would be better for me In any case, does this cause you problem or is this for understanding ? It does not create me a direct problem, however I want to find a solution, because if you think about it, if you add and delete data every day for 100 days, even if there is no data (in the app) there will be a lot of MB occupied by the app in the iPhone Storage. Thank You!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Collapse button NavigationView SideBar SwiftUI
Does your actual code show the collapse button ? Yes Here is a very similar code struct ContentView: View { var body: some View { NavigationView{ List{ NavigationLink { Text("Hello") } label: { Text("Hello") } NavigationLink { Text("World") } label: { Text("World") } } .navigationTitle("Test") } } } What I want to really achieve is the sidebar that is used in the iPad Settings app, if you know how to do that, it would be perfect. Thank You very much
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’21
Reply to Siri Shortcuts with CoreData
import CoreData struct PersistenceController { static let shared = PersistenceController() let container: NSPersistentContainer init() { container = NSPersistentContainer(name: "SiriShort") guard let fileContainer = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.SiriShortcut2")?.appendingPathComponent("SiriShort.sqlite") else { fatalError("Shared file container could not be created.") } let storeDescription = NSPersistentStoreDescription(url: fileContainer) storeDescription.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey) storeDescription.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey) container.persistentStoreDescriptions = [storeDescription] container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { fatalError("Unresolved error \(error), \(error.userInfo)") } }) container.viewContext.automaticallyMergesChangesFromParent = true container.viewContext.mergePolicy = NSMergeByPropertyStoreTrumpMergePolicy } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21