Search results for

column

2,062 results found

Post

Replies

Boosts

Views

Activity

How To Make Equal Heights CollectionView Groups Using UICollectionViewCompositionalLayout
I have a UICollectionViewLayout grid with three columns. Each item in the column has a cell full of text. I would like all the columns to be the same height as the tallest item in the group. Using UICollectionViewCompositionalLayout I'm having a hard time getting the desired results. I created a EqualHeightsUICollectionViewCompositionalLayout subcalss to check the cell attributes in layoutAttributesForElements and stores the largest cell height in a row. This seems to work good intially, but when the collectionview invalidates, the cell sizes are not always correct. How can I fix this? Here is an example project, and here is a stack overflow post class EqualHeightsUICollectionViewCompositionalLayout: UICollectionViewCompositionalLayout{ var largestDict: [Int: CGFloat] = [:] let columns = 3 override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { let attributes = super.layoutAttributesForElements(in: rect) if let attributes = att
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
2.6k
Sep ’22
Error building instrumentspackage with latest Xcode 13.3
I have a schema building an instruments package. After updating to Xcode 13.3 it fails with: BuildInstrumentsPackage ....instrdst... /Applications/Xcode.app/Contents/Developer/usr/bin/instrumentbuilder ... Assertion failed: (_columnToInterpolationExpressionMapping[column] == nil), function -[XRPackageModelingRuleSystem setColumnInterpolation:expression:definesLayoutScope:], file XRPackageModelingRuleSystem.m, line 422. Command BuildInstrumentsPackage failed with a nonzero exit code I don't have a clue what's going wrong. Any hint?
6
0
2.1k
Sep ’22
Reply to How to display [Link]?
What do you mean by displaying the links? (1) Is it showing them repeatedly in a row/column? (2) Or do you want the links to be interpolated in some standard text? I would recommend using an array of a custom type that can then each be converted into a Link view, instead of storing the actual view. Something like this: struct DisplayedLink { let title: String let url: URL } let links: [DisplayedLink] = [ ... ] Option 1: // any suitable layout container VStack { ForEach(links, id: .self) { link in Link(link.title, destination: link.url) } } Option 2: var linksText: AttributedString { var str = AttributedString(text comprised of the links' titles) for link in links { if let range = str.range(of: link.title) { str[range].link = link.url } } return str } // the linked text is coloured and tappable Text(linksText)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to TVOS 15 to Xcode 13 doesn’t pair
I have the same problem, but it started after I successfully paired an ATV (Model A2169, 4K, 2nd Gen) running 15.6 to MBP - I then upgraded the ATV to tvos 16, after which it refuses to pair (just like other posters report), but in my case, resetting the wifi on MBP does not fix the problem. Basically, I cannot pair ATV to MBP after tvos 16 update to the ATV. Any advice from Apple would be appreciated. (I tried a full reset on the ATV as well; MBP running XCode ) UPDATE: After running through the loop of reconnecting a dozen times and doing another full reset on the ATV, I tried double-clicking the ATV name in the left column, and for some unknown reason it then kicked-off the connection process and it seems to have succeeded. The remaining issue is that TVML app that runs fine in the Apple TV 4k (at 1080, 2nd Gen) simulator is crashing on the ATV running tvos 16.
Sep ’22
Reply to Network Extension capability missing in dev portal
It's between Developer and Enterprise (but closer to Developer) Interesting. if it is better (and easier) to buy the ADP. It’s definitely easier to join the developer programme; that puts you on a very well-trodden path. Whether it’s better is not something I can answer; it’s not my money after all (-: Regardless, if an education account gets different capabilities it’s clear that we need a new column in that Supported capabilities (iOS) doc. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Code Signing SubTopic: Entitlements Tags:
Sep ’22
Reply to Network Extension capability missing in dev portal
You definitely need the Networks Extensions capability to create… well… network extensions. If that’s not showing up under the Capabilities tab in Developer > Account > Certificates, Identifiers & Profiles > Identifiers > [your app ID] then you won’t be able to make progress on this task. Is the lack of this capability on the portal due to the education licence? Possibly. My go-to reference for this stuff is Developer Account Help > Reference > Supported capabilities (iOS). It doesn’t have a column for education accounts, so it’s not clear whether they fall under ADP (paid developers) or Apple Development (unpaid developer using a Personal Team). If you look through the capabilities that you do have access to, which column does it best match? Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Code Signing SubTopic: Entitlements Tags:
Sep ’22
RealityKit Entity.loadAsync method leaks
I am building a simple SwiftUI Augmented Reality app that allows to display a 3D model from a list of models. ScrollView { LazyVGrid(columns: Array(repeating: item, count: 3), spacing: 3) { ForEach(items, id: .self) { item in ZStack { NavigationLink(destination: ItemDetailsView(item: item)) ) { ListItemCell(item: item, itemUUID: (item.uuid), imageURL: item.imageURL) } } .aspectRatio(contentMode: .fill) } } } .navigationTitle((list.listName)) When I tap on a ListItemCell, I load a UIViewRepresentable to display the AR model. func makeUIView(context: Context) -> ARView { // Create arView for VR with background color let arView = ARView(frame: .zero, cameraMode: .nonAR, automaticallyConfigureSession: false) arView.environment.background = .color(UIConfiguration.realityKit3DpreviewBackgroundColor) // Set world anchor let worldAnchor = AnchorEntity(world: .zero) arView.scene.addAnchor(worldAnchor) // Load 3D model loadAsset(at: worldAnchor, context: context) // Setup camera setupCamera(on: worldAnchor)
4
0
1.7k
Sep ’22
Reply to Xcode's Vim Mode - further development?
Xcode vim mode got me really excited, but it is just missing a few commands that I depend on: . (repeat, this is crucial) Ctrl+v (column/vertical select), and Shift+I (insert in all lines of a vertical select) And to a lesser degree I also use these often: Ctrl+a, Ctrl+x (increment, decrement) :w (save because it's annoying to mentally switch between to Cmd+s) :%s///g
Sep ’22
Reply to Xcode Full Vim Support
Xcode vim mode got me really excited when I discovered, but it is just missing a few commands that I depend on: . (repeat, this is crucial) Ctrl+v (column/vertical select), and Shift+I (insert in all lines of a vertical select) And to a lesser degree I also use these often: Ctrl+a, Ctrl+x (increment, decrement) :w (save because it's annoying to mentally switch between to Cmd+s) :%s///g
Sep ’22
Reply to ongoing work on Xcode Vim mode
Xcode vim mode got me really excited, but it is just missing a few commands that I depend on: . (repeat, this is crucial) Ctrl+v (column/vertical select), and Shift+I (insert in all lines of a vertical select) And to a lesser degree I also use these often: Ctrl+a, Ctrl+x (increment, decrement) :w (save because it's annoying to mentally switch between to Cmd+s) :%s///g
Sep ’22
Reply to SwiftUI Table Limit of Columns?
I am attempting to overcome the 10 columns limitation of Table This is Crashing the compiler with this error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions Code: import SwiftUI //--------------------------------------------------------------------------------------------- struct TestStruct : Identifiable { var id = UUID () var name : String var val : Int } //--------------------------------------------------------------------------------------------- struct ContentView: View { @State var testData : [ TestStruct ] = [ TestStruct ( name: Leopold, val: 1 ), TestStruct ( name: Napoleon, val: 2 ) ] var body: some View { VStack { Table ( testData ) { Group { TableColumn ( Name ) { testStruct in Text ( testStruct.name ) } TableColumn ( Value ) { testStruct in Text ( String ( testStruct.val ) ) } } } } } } //--------------------------------------------------------------------------------------------- struct ContentView_Pr
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to Question about code in SwiftUI tutorials
A List shows a row for each item you supply, in a single column: List { Text(A List Item) Text(A Second List Item) Text(A Third List Item) } Because the example is using a list of Landmark objects, they have to be Identifiable, so there's an id parameter for each one. The syntax is saying: Go through each item in the set of Landmark objects: landmarks Create a variable we can refer to when we're using each one: landmark Add a row using the LandmarkRow view, and supply the current landmark to that view so the view can use the data. In Xcode if you put your cursor onto a variable, you'll see where else that variable is used, so if you click on landmark on the first line of code you shared, it would be highlighted in the second line, too: List(landmarks, id: .id) { >->->landmark<-<-< in LandmarkRow(landmark: >->->landmark<-<-<) }
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’22
Reply to implementing form behaviour in custom inputs
iOS 16 You can use the new Grid API with a custom alignment for the labels. Grid(alignment: .leadingFirstTextBaseline) { GridRow { Text(Username:) .gridColumnAlignment(.trailing) // align the entire first column TextField(Enter username, text: $username) } GridRow { Label(Password:, systemImage: lock.fill) SecureField(Enter password, text: $password) } GridRow { Color.clear .gridCellUnsizedAxes([.vertical, .horizontal]) Toggle(Show password, isOn: $showingPassword) } } ‎ iOS 15 and earlier You can achieve this through the use of custom alignment guides and a custom view that wraps up the functionality for each row. extension HorizontalAlignment { private struct CentredForm: AlignmentID { static func defaultValue(in context: ViewDimensions) -> CGFloat { context[HorizontalAlignment.center] } } static let centredForm = Self(CentredForm.self) } struct Row { private let label: Label private let content: Content init(@ViewBuilder content: () -> Content, @ViewBuilder label: () -> Label) { self.labe
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22