Posts

Post not yet marked as solved
0 Replies
794 Views
I started to develop an application using iOS15 and the new .searchable modifier. I have a simple layout with some placeholder results on the main page and a search field attached to the navigationBar. Currently, if the user loads the page and looks at the results (even scrolls a bit) will not be able find the search field as it's hidden by default. The user needs to scroll in reverse for the search bar to appear. How is this a good for UX? The only workaround is the drawer placement with .always, but that will make the navigation title inline. I really want to achieve the result from the Notes app, that has the search bar visible all the time. Any workaround? Was this feature really tested by anyone in a real app?
Posted Last updated
.
Post not yet marked as solved
4 Replies
1.3k Views
I'm trying to validate by app with the latest Xcode 13 RC. I found out that what was building well on Xcode 12, is not longer compiling on 13 RC. For example, I started getting:  Cannot find type 'CKRecord' in scope in a class that already has the import CoreData statement. In iOS 14 I didn't have to import CloudKit. If I add the import CloudKit statement, it compiles fine and runs on a iOS 15 simulator but it no longer works on iOS 14. I started getting the following runtime error: dyld: Library not loaded: /System/Library/Frameworks/_CoreData_CloudKit.framework/_CoreData_CloudKit   Referenced from: /Users/andrei/Library/Developer/CoreSimulator/Devices/8554B734-4894-4DD0-A8FA-6C20983F3A49/data/Containers/Bundle/Application/73F15947-880B-4902-A640-689C139DE4C4/***.app/***   Reason: image not found dyld: launch, loading dependent libraries DYLD_SHARED_CACHE_DIR=/Users/andrei/Library/Developer/CoreSimulator/Caches/dyld/20G95/com.apple.CoreSimulator.SimRuntime.iOS-14-5.18E182 DYLD_ROOT_PATH=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 14.5.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/andrei/Library/Developer/Xcode/DerivedData/***-fuozrngfgzmoluasjlbqzfiahbvg/Build/Products/Debug-iphonesimulator:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 14.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 14.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 14.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 14.5.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.fram Any ideas?
Posted Last updated
.
Post not yet marked as solved
4 Replies
1.6k Views
My app is composed from 2 components: iOS app (public facing) + macOS app (where I will feed in public info). Both will share the same codebase for Services and Model. The app will have public content (that will be stored in the public db - and only I will have the option to modify) and private content that each user will be able to create on their private database. The model is basically simple: An entity A with primitive fields AF1, AF2, AF3 An entity B with primitive fields BF1, BF2 A OneToMany relation between A and B (A can have many B). The problematic flow: I save info to the public db via Mac app (check it via CK dashboard) I validate the data on the iOS app via a real device (bring app the background, bring app to foreground, wait a couple of seconds and the data is there) I do various tests like: Adding a new B to A -> save -> check or updating a B -> save -> check. Most of the time everything works like a charm (obvious the data comes with a delay, but it comes). The problem is that sometimes when I update via macAPP, I get partial data on the iOS app (e.g. the A table is always updated (by checking the primate fields) and the B relations will never get updated. Notes:the CK dashboard if up to date each time I trigger a save from Mac app on the iOS app, when the records don't reach the device, I manually check the sqlite DB and I can confirm that it's inconsistent. I blame the coredatastack, but I really didn't get much info for public database setup. My CoreDataStack is shared on both apps and looks like this: 		 		let cloudStoreLocation = storeDirectory.appendingPathComponent("cloud.sqlite") 		let cloudStoreDescription = NSPersistentStoreDescription(url: cloudStoreLocation) 		cloudStoreDescription.configuration = privateCloudStoreName 		cloudStoreDescription.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.ABC") 		cloudStoreDescription.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey) 		cloudStoreDescription.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey) 		let publicCloudStoreLocation = storeDirectory.appendingPathComponent("cloud-public.sqlite") 		let publicCloudStoreDescription = NSPersistentStoreDescription(url: publicCloudStoreLocation) 		publicCloudStoreDescription.configuration = publicCloudStoreName 		var cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.ABC") 		cloudKitContainerOptions.databaseScope = .public 		publicCloudStoreDescription.cloudKitContainerOptions = cloudKitContainerOptions 		 		if isiOSApp { // only iOS will load a private store 				container.persistentStoreDescriptions = [cloudStoreDescription, publicCloudStoreDescription] 		} else { 				container.persistentStoreDescriptions = [publicCloudStoreDescription] 		} 		container.loadPersistentStores(completionHandler: { (_, error) in 				guard let error = error as NSError? else { return } 				fatalError("###\(#function): Failed to load persistent stores:\(error)") 		}) 		container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy 		container.viewContext.transactionAuthor = "appauthname" 		container.viewContext.automaticallyMergesChangesFromParent = true 		do { 				try container.viewContext.setQueryGenerationFrom(.current) 		} catch { 				fatalError("###\(#function): Failed to pin viewContext to the current generation:\(error)") 		} 		NotificationCenter.default.addObserver( 				self, selector: #selector(type(of: self).storeRemoteChange(_:)), 				name: .NSPersistentStoreRemoteChange, object: nil)
Posted Last updated
.
Post not yet marked as solved
0 Replies
701 Views
I'm having some trouble setting an initial sqlite seed for my project. I'm using the public database and I exported the initial .sqlite, .sqlite-shm, .sqlite-wal files in the project bundle. The files are consumed properly and the seed is reflected on my device, but when I test on a different device (signed in with another iCloud account), I get a reimport and the error: Failed to set up CloudKit integration for store: NSSQLCore: 0x13e9171d0 (URL: file:///var/mobile/Containers/...CloudPublic.sqlite) Error Domain=NSCocoaErrorDomain Code=134405 "(null)" UserInfo={PFCloudKitOldUserIdentityKey=_***, PFCloudKitNewUserIdentityKey=_YYY, NSCloudKitMirroringDelegateResetSyncReasonKey=3} Sending 'NSCloudKitMirroringDelegateWillResetSyncNotificationName' with reason: 'AccountChange' Is there any way around this for setting an initial sqlite seed?
Posted Last updated
.
Post not yet marked as solved
0 Replies
575 Views
HI! I'm developing an app that uses CloudKit as it's main database. I have a relatively small database (around 200 entries, each with 2-3 relationships) that I offer pre-populated as as the public database (new in iOS 14). I noticed that the CK mirroring is very very slow. I get the first 5-6 transactions in a matter of seconds an that I have to wait around 2 minutes for all the data to populate. As I can't show partial results (I can't allow the user to see the main entity if it's relations are not fetched yet) this is a big problem for me. Is there a way to speed up the CK mirroring process? (make it more efficient)? How can I diagnose what is taking that much? Apple recommended in the last WWDC to use this public database as an initial set of data, but people will get frustrated if the initial app load takes 2 minutes :o
Posted Last updated
.