Post

Replies

Boosts

Views

Activity

Large Title Navigation Bar Overlaps when switching tabs
Using a navigation controller in a tab bar controller the large title glitches when switching tabs.SceneDelegate.swiftif let windowScene = scene as? UIWindowScene { let window = UIWindow(windowScene: windowScene) let tabBarController = UITabBarController() tabBarController.viewControllers = [UINavigationController(rootViewController: ViewController()), UIViewController()] window.rootViewController = tabBarController self.window = window window.makeKeyAndVisible() }ViewController.swiftself.view.backgroundColor = .systemBackground self.title = "Main" self.navigationController?.navigationBar.prefersLargeTitles = true self.navigationItem.largeTitleDisplayMode = .always scrollView = UIScrollView(frame: self.view.bounds) self.view.addSubview(scrollView) let contentView = UIView(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 1400)) contentView.backgroundColor = .gray self.scrollView.addSubview(contentView) scrollView.contentSize.height = 1700Steps to reproduce:Scroll down until the large title collapses into the small titleSwitch to the second tabSwitch back to the first tabResult: The scroll view is still scrolled down but the large title now overlaps the content. When scrolling a little bit, it snaps back to the small title.This does not happen when it’s a table or collection view instead of the scroll view.This started happening in iOS 13. Did I miss some change in the behavior or is this a bug? Does someone know a workaround?
1
1
2.6k
Dec ’19
Collection View insets and large title issues
FB7732283I am currently having an issue with table and collections views and their insets in conjunction with large title navigation bars. When you scroll up until the title transitions to the small variant, there is no margin between the content and the navigation bar in the case of an inset grouped table view or a collection view. To mitigate that I tried to use contentInsets.top on that table view. While there is now a top margin, when I scroll there's this weird behavior where the scroll view snaps halfway through and when scrolling until the title transitions to the small variant again, there's no margin any more. Am I missing something very obvious or how can I achieve this in the correct way?A video of that problem can be seen in this tweet of mine https://twitter.com/ps3zocker/status/1270641775192018944
0
0
785
Jun ’20
SwiftUI Toolbar back button on macOS
I have a layout similar to Music or Podcasts, where I have a sidebar and a grid content area. When clicking on one of the items in the grid I want to open a full screen detail view just like Music does. My question is: How can I display a back button in the toolbar? I only figured out how to add buttons to the trailing side of the toolbar. Is this even possible in pure SwiftUI?  .toolbar {             Button(action: showSearch) {                 Label("Add Game", systemImage: "plus")             }         }
2
0
4.0k
Jun ’20
UIMenu in Mac Catalyst
When I'm using this code to display a toolbar item in Mac Catalyst to show the new UIMenu context menu behavior, the toolbar item is disabled because there's no primary action. Is this a bug or does this need special care on Mac Catalyst to work?     func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {         if (itemIdentifier == addLinkButtonIdentifier) {             let barButtonItem = UIBarButtonItem(title: "Test", image: nil, primaryAction: nil, menu: addLinkContextMenu)             barButtonItem.accessibilityLabel = "Add Link"                          let button = NSToolbarItem(itemIdentifier: itemIdentifier, barButtonItem: barButtonItem)                          return button         }                  return nil     } }
2
0
1.4k
Jun ’20
Core Data and Diffable Data Source usage
Hi! I've set up a sample project to test out the usage of Core Data and Diffable Data Sources and I was wondering what the correct setup is. When fetching 15.000 items with the NSFetchedResultsController and the old data source method, the app takes up about 5.8 MB. When doing the same with a manual fetch, it takes about 13.9 MB. And when using NSFetchedResultsController in conjunction with diffable data source, it uses around 13.3 MB. Am I right in assuming that using diffable data source with NSFetchedResultsController is removing the memory optimization (not loading all objects at once)? And therefore the biggest difference between a manual fetch and a NSFetchedResultsController fetch is the automatic updating? What's the recommended way to use Core Data today? The way I see it, using NSFetchedResultsController with the classic data source model is the most efficient? And using manual fetching or using NSFetchedResultsController with diffable data source yields around same memory usage?
1
0
1.3k
Jul ’20
Disable automatic iCloud sync with SwiftData
Is there a way to use SwiftData without automatic iCloud sync? I’d like to do that manually using my own CloudKit solution or CKSyncEngine. SwiftData automatically picks up any CloudKit containers though and I have not seen an option to disable this behavior. Setting cloudKitContainerIdentifier to nil does still pick the first available CloudKit container. Just in case this is a bug: FB12276416 Sample: let configuration = ModelConfiguration(cloudKitContainerIdentifier: nil) let modelContainer = try! ModelContainer(for: [GamesCollection.self], configuration) print(modelContainer.configurations) // [SwiftData.ModelConfiguration(url: …, name: …, sharedAppContainerIdentifier: …, cloudKitContainerIdentifier: Optional("iCloud.CloudKit.com.+++")
13
4
3.7k
Jun ’23
Stickers broken on iOS 18 / iPhone 16 after restoring from backup
[Detailed feedback FB15232205] Since I restored my new iPhone 16 Pro from a previous iPhone 15 Pro backup, I can't use stickers any more. The stickers gallery is filled with clear stickers that I can't interact with. Deleting does nothing. I also can't add new stickers. They appear for a second and then disappear again. iCloud sync is also not working. Other devices are fine. When restoring the phone without backup, everything works fine. Is it possible this is caused by the iOS 18.0 version that's shipping with the new iPhones? I was only offered another iOS 18.0 update in Settings later on. Updating to 18.1 beta 5 today did not fix it either. From what I gather from the logs, there's a database corruption happening. I've seen various posts across the internet who have this issue specifically after setting up their new iPhone. fehler 22:08:24.677501+0200 stickersd error: (11) Fatal error. The database at /private/var/mobile/Library/Stickers/stickers.stickerdb is corrupted. SQLite error code:11, 'database disk image is malformed' fehler 22:08:24.677615+0200 stickersd error: exception fetching row for object with ID: Fatal error. The database at /private/var/mobile/Library/Stickers/stickers.stickerdb is corrupted. SQLite error code:11, 'database disk image is malformed' with userInfo of { NSFilePath = "/private/var/mobile/Library/Stickers/stickers.stickerdb"; NSSQLiteErrorDomain = 11; } fehler 22:08:24.677679+0200 stickersd error: Unhandled error occurred during faulting: Error Domain=NSSQLiteErrorDomain Code=11 "(null)" UserInfo={NSFilePath=/private/var/mobile/Library/Stickers/stickers.stickerdb, NSSQLiteErrorDomain=11} ({ NSFilePath = "/private/var/mobile/Library/Stickers/stickers.stickerdb"; NSSQLiteErrorDomain = 11; }) fehler 22:08:24.677700+0200 stickersd fault: Unhandled error (NSSQLiteErrorDomain, 11) occurred during faulting and was ignored: Error Domain=NSSQLiteErrorDomain Code=11 "(null)" UserInfo={NSFilePath=/private/var/mobile/Library/Stickers/stickers.stickerdb, NSSQLiteErrorDomain=11} problem 22:08:24.677736+0200 stickersd CoreData: Unhandled error (NSSQLiteErrorDomain, 11) occurred during faulting and was ignored: Error Domain=NSSQLiteErrorDomain Code=11 "(null)" UserInfo={NSFilePath=/private/var/mobile/Library/Stickers/stickers.stickerdb, NSSQLiteErrorDomain=11} fehler 22:08:24.678107+0200 stickersd database corruption at line 79182 of [1b37c146ee] fehler 22:08:24.678757+0200 stickersd error: (11) Fatal error. The database at /private/var/mobile/Library/Stickers/stickers.stickerdb is corrupted. SQLite error code:11, 'database disk image is malformed' fehler 22:08:24.678783+0200 stickersd error: exception fetching row for object with ID: Fatal error. The database at /private/var/mobile/Library/Stickers/stickers.stickerdb is corrupted. SQLite error code:11, 'database disk image is malformed' with userInfo of { NSFilePath = "/private/var/mobile/Library/Stickers/stickers.stickerdb"; NSSQLiteErrorDomain = 11; } fehler 22:08:24.678807+0200 stickersd error: Unhandled error occurred during faulting: Error Domain=NSSQLiteErrorDomain Code=11 "(null)" UserInfo={NSFilePath=/private/var/mobile/Library/Stickers/stickers.stickerdb, NSSQLiteErrorDomain=11} ({ NSFilePath = "/private/var/mobile/Library/Stickers/stickers.stickerdb"; NSSQLiteErrorDomain = 11; }) fehler 22:08:24.678826+0200 stickersd fault: Unhandled error (NSSQLiteErrorDomain, 11) occurred during faulting and was ignored: Error Domain=NSSQLiteErrorDomain Code=11 "(null)" UserInfo={NSFilePath=/private/var/mobile/Library/Stickers/stickers.stickerdb, NSSQLiteErrorDomain=11} problem 22:08:24.678858+0200 stickersd CoreData: Unhandled error (NSSQLiteErrorDomain, 11) occurred during faulting and was ignored: Error Domain=NSSQLiteErrorDomain Code=11 "(null)" UserInfo={NSFilePath=/private/var/mobile/Library/Stickers/stickers.stickerdb, NSSQLiteErrorDomain=11} fehler 22:08:24.678878+0200 stickersd database corruption at line 79182 of [1b37c146ee] fehler 22:08:24.678903+0200 stickersd error: (11) Fatal error. The database at /private/var/mobile/Library/Stickers/stickers.stickerdb is corrupted. SQLite error code:11, 'database disk image is malformed' fehler 22:08:24.678931+0200 stickersd error: exception fetching row for object with ID: Fatal error. The database at /private/var/mobile/Library/Stickers/stickers.stickerdb is corrupted. SQLite error code:11, 'database disk image is malformed' with userInfo of { NSFilePath = "/private/var/mobile/Library/Stickers/stickers.stickerdb"; NSSQLiteErrorDomain = 11; } fehler 22:08:24.678953+0200 stickersd error: Unhandled error occurred during faulting: Error Domain=NSSQLiteErrorDomain Code=11 "(null)" UserInfo={NSFilePath=/private/var/mobile/Library/Stickers/stickers.stickerdb, NSSQLiteErrorDomain=11} ({ NSFilePath = "/private/var/mobile/Library/Stickers/stickers.stickerdb"; NSSQLiteErrorDomain = 11; }) fehler 22:08:24.678972+0200 stickersd fault: Unhandled error (NSSQLiteErrorDomain, 11) occurred during faulting and was ignored: Error Domain=NSSQLiteErrorDomain Code=11 "(null)" UserInfo={NSFilePath=/private/var/mobile/Library/Stickers/stickers.stickerdb, NSSQLiteErrorDomain=11}
9
7
2.8k
Sep ’24