Search results for

column

2,048 results found

Post

Replies

Boosts

Views

Activity

Reply to Remove gap between lazyvgrids in vstack
It's better to Paste as Paste and Match Style to avoid all the extra lines: 1. import SwiftUI 2. struct SecondView: View { 3. 4. var columns = [ 5. GridItem(.fixed(100), spacing: 0.1), 6. GridItem(.fixed(100), spacing: 0.1), 7. GridItem(.fixed(100), spacing: 0.1), 8. GridItem(.fixed(100), spacing: 0.1), 9. GridItem(.fixed(100), spacing: 0.1) 10. ] 11. let principalData: convertCSVtoArray 12. 13. var body: some View { 14. let numArrays = principalData.cvsData.count 15. let numElementsPerArray = principalData.cvsData[0].count 16. 17. VStack{ 18. Text() 19. Text(Historical Data) 20. .font(.title) 21. .padding(5) 22. Divider() 23. LazyVGrid( 24. columns: columns, 25. alignment: .center, 26. spacing: 0) 27. { 28. ForEach(0..<1) {row in 29. ForEach(0.. Could you post a screenshot to illustrate the problem ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to Illegal NSTableViewDataSource
Hello Claude:func showRegisteredStudents() { guard (NSApplication.shared.delegate as? AppDelegate) != nil else { return } let managedContext = (NSApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let fetchRequest = NSFetchRequest(entityName: Registration) fetchRequest.returnsObjectsAsFaults = false fetchRequest.sortDescriptors = [NSSortDescriptor(key: lastName, ascending: true)] do { let readItems = try managedContext.fetch(fetchRequest) as! [NSManagedObject] print (There are (readItems.count) items) _ = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.persistentContainer.viewContext, sectionNameKeyPath: nil, cacheName: nil) // Configure Fetched Results Controller print(Records are (readItems)) items = readItems print(There are (items.count) items)// NOW items is filled self.tableView.reloadData() return() fatalError(Failed to fetch employees: (error)) } } } extension RegistrationReportsViewController: NSTableViewDataSource,NSTableViewDelegate{ // Da
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20
Reply to How can I change the background color of a focused item of a NSTableView?
Here is a more simplified example of the app: import SwiftUI struct NSTableViewWrapper: NSViewRepresentable { class Coordinator: NSObject, NSTableViewDataSource, NSTableViewDelegate { var parent: NSTableViewWrapper init(parent: NSTableViewWrapper) { self.parent = parent } func numberOfRows(in tableView: NSTableView) -> Int { 1 } func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { return NSTextField(labelWithString: Item) } func tableView(_ tableView: NSTableView, rowActionsForRow row: Int, edge: NSTableView.RowActionEdge) -> [NSTableViewRowAction] { return [NSTableViewRowAction(style: .destructive, title: Delete) { _, _ in }] } } func makeCoordinator() -> Coordinator { return Coordinator(parent: self) } func makeNSView(context: Context) -> NSScrollView { let scrollView = NSScrollView() let tableView = NSTableView() let column = NSTableColumn(identifier: NSUserInterfaceItemIdentifier(Column)) tableView.addTableColumn(column
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’25
Reply to CollectionView in TableView
But actually when i try to connect my ViewCollection with my ViewController, i recieve Error Outlets cannot be connected to repeating content. When i try to create it manualy, inside my function tableView(), the column which contains the ViewCollection isn't recognise.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’18
Reply to Make method less repetative
Oh, ok. I had misunderstood what you are trying to accomplish.FWIW, besides the fact there is not what you want, maybe i should have written in this way...private func generateLoserLocationFunction(numberOfPlayers: Int) -> (column: Int, row: Int) -> (column: Int, row: Int) { switch numberOfPlayers { case 8,16,32: return { row, column in let newCol = -2 * column switch (column,numberOfPlayers) { case (0,_): return (newCol, row / 2) case (1,8), (2,16), (3,32): return (newCol, row ^ 1) case (1,16): return (newCol, 3 - row) case (1,32): return (newCol, (row + 4) % 8) case (2,32): return (newCol, row) default: return (newCol, 0) } } default:abort() } }But going back to you problem, so, if i understand well, it's a case of premature optimization, like in our example of colors:func generateGetColorFunction(numberOfPlayers: Int) -> () -> UIColor { if numberOfPlayers == 8 { return { return UIColor.redColor() } } else if numberOfPlayers == 16 { return { return UI
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
Reply to How to declare a TableColumn with nullable field?
Just ran into this issue too when working through a simple struct with Strings. A table of mostly strings with some columns sensibly optional Strings. The compiler message displayed in Xcode 13.3 is: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions So not helpful. Removing the path does seem to work, but the docs would suggest that the column will no longer participate in sorting state of the table. I too can think of use cases where I have optional data but want the rest of the non-optional Strings to be sorted (either at the bottom or the top).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’22
Reply to Using Apple sign in with Developer ID for a Mac Catalyst app distribution
So I guess what the ADP column really means is applications sold on the App Store, right ? Right. And the Apple Development signing your use when developing such apps. If you distribute your product independently, reference the Developer ID column. It is a little frustrating not to be able to use this feature directly I can’t really comment on the policy here — Sign in with Apple is definitely outside of my area of expertise — so all I can do I clarify what that policy is. ps The term ADP name makes more sense in the corresponding iOS reference. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Code Signing SubTopic: Entitlements Tags:
Mar ’22