Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics

Post

Replies

Boosts

Views

Activity

Wrong SF symbol displayed
Hi there! After a few months off, I'm starting a new app. I'm making a TabView like this: import SwiftUI struct ContentView: View {     @State private var tab: Tab = .adventures     var body: some View {         TabView(selection: $tab) {                         Text("Explore")                 .tag(Tab.explore)                 .tabItem {                     Label("Explore", systemImage: "airplane.circle")                 }             Text("Profile")                 .tag(Tab.profile)                 .tabItem {                     Label("Profile", systemImage: "person")                 }         }     }     enum Tab {         case explore, profile     } } As you noticed, I want airplane.circle and person SF Symbols on the TabView but SwiftUI is showing airplane.circle.fill and person.fill in the preview canvas and also when I run the app in the simulator. Why it is forcing me to show those icons? Xcode version: 13.4.1 SF Symbols version: 3.3 iOS deployment target: 15.0 Thank you.
2
0
1.3k
Sep ’22
ShareLink + FileRepresentation: Can't Save to Files
I'm having trouble getting the "Save to Files" option to work with ShareLink. Here's a simple example: struct Item: Transferable {     public static var transferRepresentation: some TransferRepresentation {         FileRepresentation(exportedContentType: .jpeg) { item in // Write a jpeg to disk             let url = URL.documentsDirectory.appending(path: "item.jpeg")             let jpegData = UIImage(named: "testImg")!.jpegData(compressionQuality: 1)!             try! jpegData.write(to: url)             return SentTransferredFile(url)         }     } } struct ContentView: View {     var body: some View {         ShareLink(item: Item(), preview: SharePreview("Test Item"))     } } The ShareSheet presents all of the usual options, but tapping "Save to Files" briefly presents an empty modal before immediately dismissing. The following errors are logged to the console: 2022-09-12 14:19:57.481592-0700 ExportTest[3468:1374472] [NSExtension] Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point's NSExtensionContext subclass must implement `+_allowedItemPayloadClasses`. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error. 2022-09-12 14:19:58.047009-0700 ExportTest[3468:1374472] [ShareSheet] cancelled request - error: The operation couldn’t be completed. Invalid argument Sharing finished with error: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument" at SwiftUI/SharingActivityPickerBridge.swift:266 2022-09-12 14:19:58.584374-0700 ExportTest[3468:1379359] [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:3472 ( 0   AXRuntime                           0x00000001ca77b024 _AXGetPortFromCache + 932 1   AXRuntime                           0x00000001ca77d1d8 AXUIElementPerformFencedActionWithValue + 772 2   UIKit                               0x00000002258b3284 3CB83860-AA42-3F9A-9B6E-2954BACE3DAC + 778884 3   libdispatch.dylib                   0x0000000105078598 _dispatch_call_block_and_release + 32 4   libdispatch.dylib                   0x000000010507a04c _dispatch_client_callout + 20 5   libdispatch.dylib                   0x00000001050820fc _dispatch_lane_serial_drain + 988 6   libdispatch.dylib                   0x0000000105082e24 _dispatch_lane_invoke + 420 7   libdispatch.dylib                   0x000000010508fcac _dispatch_workloop_worker_thread + 740 8   libsystem_pthread.dylib             0x00000001ed9e8df8 _pthread_wqthread + 288 9   libsystem_pthread.dylib             0x00000001ed9e8b98 start_wqthread + 8 ) Additionally, this error is logged when the ShareSheet is first presented (before tapping Save to Files): [ShareSheet] Couldn't load file URL for Collaboration Item Provider:<NSItemProvider: 0x282a1d650> {types = (     "public.jpeg" )} : (null) Has anybody had luck getting custom Transferable representations to work with ShareLink?
6
2
2.9k
Sep ’22
SwiftUI 4 navigation bug on iOS 16?
Hi everyone, I am running into a navigation-related issue that appears to be new in iOS 16/SwiftUI 4. The code below illustrates the problem: struct ContentView: View {   @State private var input: String = ""   var body: some View {     NavigationStack {       VStack {         Spacer()         NavigationLink("Navigate") {           Text("Nested View")         }         Spacer()         TextEditor(text: $input)           .border(.red)           .frame(height: 40)       }       .padding()     }   } } The initial view consists of a navigation link and a text editor at the bottom of the screen. I run the app on an iPhone (or the simulator) in iOS 16 and click on the text editor at the bottom of the screen. This invokes the virtual keyboard, which pushes up the text field. Next, I click on "Navigate" to navigate to the nested view. I navigate immediately back, which brings back the initial view without the keyboard. Unfortunately, the text field isn't pushed back to the bottom and is now located in the middle of the screen. (see attached image) Did anyone experience similar issues? Is there a workaround I could use to force a re-layout of the initial view upon return from the navigation link? Thanks, Matthias
8
2
3.4k
Sep ’22
EditMode Example not working
I tried the example from https://developer.apple.com/documentation/swiftui/editmode. It's not working for me. struct ContentView: View { @Environment(\.editMode) private var editMode @State private var name = "Maria Ruiz" var body: some View { NavigationView { Form { Text(String(editMode!.wrappedValue.isEditing)) if editMode?.wrappedValue.isEditing == true { TextField("Name", text: $name) } else { Text("test") } } .animation(nil, value: editMode?.wrappedValue) .toolbar { // Assumes embedding this view in a NavigationView. EditButton() } } } } It shows the texts "false" and "test", before and after clicking Edit. What am I missing? I'm using XCode 14.0.1 and the deployment target is iOS 16. I also tried on a real iPhone and on iOS 15.5 in the Simulator. Thanks for any help.
3
1
2.2k
Sep ’22
Hyperlinks open in Web browser instead of embedded WKWebView using Swift5/SwiftUI
Good morning! I am developing an iOS app that gets its data from an API and displays it in a list. The list item view has NavigationLink embedded in it that sends users to a detail view. In this detail view, I have some Text views but the issue I am running into is a WKWebView that I have implemented to display some HTML that's is retrieved from the API call. The WKWebView displays the HTML just how I want it to. The issue I have is in the HyperLinks that are displayed in the WKWebView. When a user taps on a link, it opens inside of the web view. Instead of opening in the web view, I would like this link to open in the user's default web browser. I have searched and found ways of doing this in older versions of Swift using classes but my web view is initialized inside of a struct that conforms to the UIViewRepresentable protocol. I don't know how to get links to open in the browser instead of the WebView so any help would be appreciated. Here is the code for my WebView that is being used on the details page. struct NewsItemWebView: UIViewRepresentable { // HTML from API Call     var text: String // Method to create the View     func makeUIView(context: Context) -> WKWebView {         return WKWebView()     } // Method to update the View by changing properties of the WebView     func updateUIView(_ uiView: WKWebView, context: Context) {         uiView.isOpaque = false         uiView.backgroundColor = UIColor.white         uiView.loadHTMLString(text, baseURL: nil)     } } Here is how I am implementing the WebView on DetailView NewsItemWebView(text: item.PageContent) .frame(height: 450) Any help on how I can make links open in a browser would be great. Thanks in advance.
3
1
7.9k
Oct ’22
How to implement multiple selection types in NavigationSplitView?
In the sidebar column of the NavigationSplitView I'd like to have several sections. All the items are fetched with Core Data. View all photos (Photos entity in Core Data) Folder (Folder entity in Core Data) Folder A Folder B Folder C Tags (Tag entity in Core Data) Cat Dog In the content view, I'd like show the items based on the selection in the sidebar. I tried the following with some success but I think there should be another way of doing this. NavigationSplitView() { List(selection: $navigationModel.selectedCategory, content: { NavigationLink(value: Category(type: .all, predicate: NSPredicate(value: true), title: "View all items") ) {                     Text("View all items")                 }   Section { ForEach(folders){ folder in NavigationLink(value: Category(type: .folder, predicate: NSPredicate(format: "folder == %@", folder), title: folder.name) ) { FolderRow(folder: folder) // ... and so on. Another section for tags And in the content: ZStack{ List(selection: $navigationModel.selectedPhoto) {     ContentView(photos: FetchRequest(                   sortDescriptors: [sortDescriptor], predicate: navigationModel.selectedCategory?.predicate,                   animation: .default) //.... How can refractor this code with a better solution? The problem that I'm encountering is that the selection argument in the List accepts only one type of object. But I want to select more that one type of object. Another issue is that this solution won't conform to Codable if I'm thinking correctly and reseting the app state on the next launch would be cumbersome.
2
0
916
Oct ’22
Arabic Text Glitches With PageTabViewStyle
So I have the default language of my app as Arabic so everything goes from RTL but when I changed the default language to Arabic I started encountering this issue that happens when navigating from one view to another view. This issue shows the text inverted in a weird way. here is the image: https://imgur.com/amI8afA (note that this issue goes away if the TabView is not PageTabViewStyle)
2
2
612
Oct ’22
Set filename to use for "Save to Files" with ShareLink?
Isn't there no way to set the default filename to use when we want to save a DataRepresentation to a file? If I export to JSON, the filename is "JSON.json" is used by iOS, even if I set the name to use in SharePreview. struct ContentView: View {     let car = Car(id: UUID(), name: "911", items:                     [Item(id: UUID(),date: .now, desc: "oil change"),                      Item(id: UUID(),date: .now, desc: "Battery")])     var body: some View {         VStack {             ShareLink(item: car, preview: SharePreview(car.name))         }         .padding()     } } extension UTType {     static var car: UTType = UTType(exportedAs: "com.acme.cararchive") } struct Car: Codable {     let id: UUID     let name: String     let items: [Item] } extension Car: Transferable {     static var transferRepresentation: some TransferRepresentation {         DataRepresentation(contentType: .json) { archive in             try JSONEncoder().encode(archive)         } importing: { data in             try JSONDecoder().decode(Car.self, from: data)         }     } } struct Item: Codable {     let id: UUID     let date: Date     let desc: String }
4
0
2.2k
Oct ’22
Crash when presenting UIPrintInteractionController on iOS 16
Starting iOS 16 seeing some crashes related to pdf printing in the crash reporter. It looks like the issue is not so frequent. Also, I'm unable to reproduce the crash. Looks like the app crashes when the print preview dialog is opening. According to crash reports, there are some crashes on different iOS 16 versions: 16.0.0, 16.0.2, and 16.0.3. Printing code: let printInfo = UIPrintInfo.printInfo() printInfo.jobName = "Printing Job Name" self.printViewController = UIPrintInteractionController.shared self.printViewController?.printInfo = printInfo self.printViewController?.printingItem = pdfURL self.printViewController?.present(from: barButtonItem, animated: true) { (controller, completed, error) in self.printViewController = nil } Stack trace: compare_key + 4 (CGPDFObject.c:134) bsearch + 68 (bsearch.c:70) CGPDFDictionaryGetUnresolvedObject + 68 (CGPDFDictionary.c:153) CGPDFDictionaryGetObject + 44 (CGPDFDictionary.c:172) CGPDFDictionaryGetDictionary + 44 (CGPDFDictionary.c:284) get_pages_dictionary + 68 (pdf-reader.c:410) pdf_reader_get_number_of_pages + 76 (pdf-reader.c:557) -[UIPrintPreviewPageFetcher fetchNumberOfItems] + 76 (UIPrintPreviewPageFetcher.m:115) -[UIPrintPreviewViewController collectionView:numberOfItemsInSection:] + 32 (UIPrintPreviewViewController.m:482) -[UICollectionViewData _updateItemCounts] + 220 (UICollectionViewData.mm:335) -[UICollectionViewData isIndexPathValid:validateItemCounts:] + 52 (UICollectionViewData.mm:348) -[UICollectionViewData validatedGlobalIndexForItemAtIndexPath:] + 36 (UICollectionViewData.mm:778) -[UICollectionView _cellForItemAtIndexPath:] + 108 (UICollectionView.m:7112) -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + 1384 (UICollectionView.m:9357) -[UICollectionView _updateRowsAtIndexPaths:updateAction:updates:] + 396 (UICollectionView.m:9104) -[UICollectionView reloadItemsAtIndexPaths:] + 52 (UICollectionView.m:9124) -[UIPrintPreviewViewController reloadVisibleItems:] + 256 (UIPrintPreviewViewController.m:568) __63-[UIPrintPreviewViewController updatePdfURL:options:completed:]_block_invoke_2 + 44 (UIPrintPreviewViewController.m:305) __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 24 (NSOperation.m:1545) -[NSBlockOperation main] + 104 (NSOperation.m:1564) __NSOPERATION_IS_INVOKING_MAIN__ + 16 (NSOperation.m:2189) -[NSOperation start] + 708 (NSOperation.m:2206) There is full stack trace I got from the Organizer Thanks!
13
5
4.9k
Oct ’22
SwiftUI MapKit - MapAnnotation - Publishing changes from within view updates is not allowed, this will cause undefined behavior.
So I'm trying to use MapKit in a SwiftUI project targeting iOS/iPadOS. MapKit is obviously pretty limited in SwiftUI, but I've been getting warnings trying to set up basic annotations for the user to interact with. When I use a basic MapMarker everything is fine (although it's hard to do anything with it), but whenever I do anything with MapAnnotation, I get this warning in Xcode (14.0.1) whenever I move the map around: [SwiftUI] Publishing changes from within view updates is not allowed, this will cause undefined behavior. I'm no SwiftUI expert, and I get how to fix this issue when binding in something like a sheet, but I don't see how what I'm doing with MapAnnotation should be causing this. It looks like a bug to me, possibly complaining about the $region binding, but maybe I'm wrong? Am I doing something wrong or is this a bug? Below is some sample code that reproduces this easily for me (just launch an app with the below code and then drag the map around to see the constant warnings in Xcode). It's mostly an example from here: https://www.hackingwithswift.com/books/ios-swiftui/integrating-mapkit-with-swiftui import SwiftUI import MapKit struct Location: Identifiable {     let id = UUID()     let name: String     let coordinate: CLLocationCoordinate2D } struct ContentView: View {     @State private var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 51.5, longitude: -0.12), span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2))     let locations = [         Location(name: "Buckingham Palace", coordinate: CLLocationCoordinate2D(latitude: 51.501, longitude: -0.141)),         Location(name: "Tower of London", coordinate: CLLocationCoordinate2D(latitude: 51.508, longitude: -0.076))     ]     var body: some View {         Map(coordinateRegion: $region, annotationItems: locations) { location in             MapAnnotation(coordinate: location.coordinate) {                 Circle()                     .stroke(.red, lineWidth: 3)                     .frame(width: 44, height: 44)             }         }         .navigationTitle("Map")         .edgesIgnoringSafeArea(.all)     } }
20
14
9.9k
Oct ’22
Why does custom Binding not update UI
I have a class that I cannot change to ObservableObject with Published members. I tried getting around this by writing my own Binding. Although the value is updated correctly, the UI is not. Why is this. Below is a simple demo view. When it is run and the toggle is clicked, it will print out correctly that the value is changed, but the UI does not update. Why? import SwiftUI class BoolWrapper {   public var value = false {     didSet {       print("Value changed to \(value)")     }   } } let boolWrapper = BoolWrapper() struct ContentView: View {   var body: some View {     Toggle(isOn: Binding(get: {       return boolWrapper.value     }, set: { value in       boolWrapper.value = value     }), label: { Text("Toggle") })   } } struct ContentView_Previews: PreviewProvider {   static var previews: some View {     ContentView()   } }
5
0
4.3k
Oct ’22
SwiftUI bug, when removing a TabView all other tabs have `onAppear` and `onDisappear` triggered
Xcode 14.1 Running on iPhone 14 Pro max simulator 16.1 Code... import SwiftUI struct ContentView: View { @State var loggedIn: Bool = false var body: some View { switch loggedIn { case false: Button("Login") { loggedIn = true } .onAppear { print("🍏 Login on appear") } .onDisappear { print("🍎 Login on disappear") } case true: TabView { NavigationView { Text("Home") .navigationBarTitle("Home") .onAppear { print("🍏 Home on appear") } .onDisappear { print("🍎 Home on disappear") } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button("Logout") { loggedIn = false } } } } .tabItem { Image(systemName: "house") Text("Home") } NavigationView { Text("Savings") .navigationBarTitle("Savings") .onAppear { print("🍏 Savings on appear") } .onDisappear { print("🍎 Savings on disappear") } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button("Logout") { loggedIn = false } } } } .tabItem { Image(systemName: "dollarsign.circle") Text("Savings") } NavigationView { Text("Profile") .navigationBarTitle("Profile") .onAppear { print("🍏 Profile on appear") } .onDisappear { print("🍎 Profile on disappear") } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button("Logout") { loggedIn = false } } } } .tabItem { Image(systemName: "person") Text("Profile") } } .onAppear { print("🍏 Tabview on appear") } .onDisappear { print("🍎 Tabview on disappear") } } } } Video of bug... https://youtu.be/oLKjRGL2lX0 Example steps... Launch app Tap Login Tap Savings tab Tap Home tab Tap Logout Expected Logs... 🍏 Login on appear 🍏 Tabview on appear 🍏 Home on appear 🍎 Login on disappear 🍏 Savings on appear 🍎 Home on disappear 🍏 Home on appear 🍎 Savings on disappear 🍏 Login on appear 🍎 Home on disappear 🍎 Tabview on disappear Actual logs... 🍏 Login on appear 🍏 Tabview on appear 🍏 Home on appear 🍎 Login on disappear 🍏 Savings on appear 🍎 Home on disappear 🍏 Home on appear 🍎 Savings on disappear 🍏 Login on appear 🍏 Savings on appear 🍎 Home on disappear 🍎 Savings on disappear 🍎 Tabview on disappear Error... 10 and 12 in the actual logs should not be there at all. For each tab that you have visited (that is not the current tab) it will call onAppear and onDisappear for it when the tab view is removed.
1
4
910
Nov ’22
Fatal error: UnsafeRawBufferPointer with negative count
I'm using Xcode 14.1 to start a Core Data project. I created a new Project, checking CoreData. The resulting program works in Preview and in the Simulator. I've changed the data from a Item/timestamp to Locations/title. I plan to add more Attributes but that's for later. I think I've got all the Item instances changed to Locations and timestamp to title. It seems to work OK when in Preview for ContentView.swift but crashes in the Simulator with the error Swift/UnsafeRawBufferPointer.swift:946: Fatal error: UnsafeRawBufferPointer with negative count Any suggestions on what I have done wrong? Thanks. PS, the New Project includes the line Text("Select a location") but Select a location doesn't appear in the Preview.
1
1
1.2k
Nov ’22
ShareLink does not offer "save to files" when sharing "Transferable" items
In my app I try to use SwiftUI's ShareLink to offer sharing of the app's documents. I followed this video for defining the exported type and the document type. Unfortunately if I use any ShareLink initializer for sharing Transferable items, the option "save to files" is not offered on the displayed share sheet. (Only "copy" is offered, which works if pasted into the destination directory using the Files app, but that is not an acceptable workaround). PS: com.example.transferabletestis defined as conforming to com.apple.package import SwiftUI import UniformTypeIdentifiers extension UTType{     static let transferableTest = UTType(exportedAs: "com.example.transferabletest") } struct Document:Transferable{     static let filePackageURL = URL.documentsDirectory.appending(components: "0815.transferabletest")    public static var transferRepresentation: some TransferRepresentation {         FileRepresentation(exportedContentType: .transferableTest) { document in             _ = try? FileManager.default.createDirectory(at: Self.filePackageURL, withIntermediateDirectories: false)             FileManager.default.createFile(atPath: Self.filePackageURL.appending(components: "data").path(), contents: "Transferable Test\n".data(using: .utf8))             return SentTransferredFile(Document.filePackageURL)         }     } } struct ContentView: View {     var body: some View {         ShareLink("Share as tranferable item", item: Document(), preview: SharePreview("Test"))     } } Is this a bug? What am I doing wrong? Sharing the document using the ShareLink for URLs does offer "save to files" but I can't use that in my app for various reasons.
3
2
2k
Nov ’22
Conflict between onDrag and selection SwiftUI
There is a conflict when I use selection and onDrag for a list, onDrag blocks the selection on macOS. I think the problem comes from the fact that selection works on mouseDown and the same for onDrag. So, when the mouseDown event is triggered, swiftUI call the last modifier which is onDrag and it doesn't trigger the selection anymore. When I check on the Finder app, I noticed that the selection is triggered on mouseUp, which confirms my theory. Moreover, on finder, they combine onDrag, selection, and doubleClick without any conflict. Therefore, I'm pretty sure there is a workaround, but I can't figure it out... Did anyone already face this issue and found a workaround?
1
1
446
Nov ’22
When set live activity dismissalPolicy: .after(endTime), the dynamic island not working
I have app that shows live activity and countdown till a date... VStack { Text("Countdown till You finish your homework")  Text(countdownTime, style: .timer) } After the time up, the live activity countup, the solution is to update the live activity via backgroundTask and this not always working, really apple sometimes fire the backgroundTask after hours. Another solution is to set dismissalPolicy: .after(countdownTime), but once I did that the dynamic island not working and the activity status is ended after right calling... await activity.end(using: state, dismissalPolicy: .after(countdownTime)) Can anyone help please, users feed back is why you we still see the old task on live activity. How come I can not update live activity? and how come if you set dismissalPolicy .after apple changes the activity status to ended and stop showing the dynamic island?
3
5
1.8k
Nov ’22
How to: Compositional layout with self-sizing rows of N columns where the height of each item is set to the tallest item in its row
Paging Steve Breen! 😄 I've seen this question asked a zillion times but I've never seen an answer. Is it possible to configure compositional layout to give you a grid of N columns (say 2 or 3) where each item in each row/group self-size their height, but the heights of those items are then set to be the height of the tallest item in their row. This is easy to do if you ignore the self-sizing requirement (just use a fixed or absolute item height), but on the surface this doesn't even appear to be possible if you require self-sizing. What I've Tried Configuring a layout where the items are set to a fractional height of 1.0 and their group is set to an estimated height (ex: 100). I was hoping compositional layout would interpret this as, "Please self-size the height of the group and make each item 100% of that height." Unfortunately, compositional layout just uses the estimate you provide for the height as the actual height and no self-sizing occurs at all. Sad panda. 🐼 Use visibleItemsInvalidationHandler to attempt to identify which items share a row and reset their heights to be the height of the tallest item in that row. Sadly, the handler doesn't really have access to the data it needs to do this, nor is it allowed to change frames, nor is it called on the first layout pass, nor does it appear to be supported at all for layouts containing estimated items. In fact, if you try to use it with layouts that support self-sizing, you'll get this error message: [UICompositionalLayout] note: the section invalidation handler cannot currently mutate visible items for layouts containing estimated items. Please file an enhancement request on UICollectionView. Wishing upon a star. Oh, and I also filed a radar asking: FB11776888 Here's a visual aid: I have a little test program as well, but unfortunately I can't upload it here. Happy to share if it would be helpful. Here are a couple snippets: #1 // This doesn't work     private func makeLayout1() -> UICollectionViewCompositionalLayout {         // Item         let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.5), heightDimension: .fractionalHeight(1))         let item = NSCollectionLayoutItem(layoutSize: itemSize)         // Group         let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(100))         let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, repeatingSubitem: item, count: 2)         group.interItemSpacing = .fixed(10)         // Section         let section = NSCollectionLayoutSection(group: group)         return UICollectionViewCompositionalLayout(section: section)     } #2 // This self-sizes the heights of the items, but allows the items in each row to be different heights rather than providing any way to constrain them to the height of the tallest self-sized item in each row     private func makeLayout2() -> UICollectionViewCompositionalLayout {         // Item         let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.5), heightDimension: .estimated(100))         let item = NSCollectionLayoutItem(layoutSize: itemSize)         // Group         let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(100))         let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, repeatingSubitem: item, count: 2)         group.interItemSpacing = .fixed(10)         // Section         let section = NSCollectionLayoutSection(group: group)         return UICollectionViewCompositionalLayout(section: section)     } Options? My guess is that compositional layout simply doesn't support layouts that require a "partial second pass" per group, where the frames of the items can be updated based on information collected during self-sizing the other items in the group (to, for example, force them all to a common height, or align them top/bottom/centered within their group). If that's the case (not supported), I would love a suggestion for where I might override the layout to provide this capability. Thank you! ❤️
4
5
4.8k
Nov ’22