Search results for

“column”

2,085 results found

Post

Replies

Boosts

Views

Activity

Reply to How to frozen a few columns for NSTableView
In the Width inspector (Command-Option-5), set the column's width, minimum and maximum all to the same value.Then, in the Attributes inspector for the table, make sure the Column Sizing menu is set to something other than First Column Only, depending how you want the rest of the columns to resize.
Topic: UI Frameworks SubTopic: AppKit Tags:
Feb ’16
CollectionViewCell switch back to single column once UImage is assigned
Hi I am building a simple multi column CollectionView here and trying to add 3 cell in a row. Well, in short the column and rows looks all fine if I comment the below code. which is no image and text assigned to cells. let framework = list[indexPath.item] cell.configure(framework) However, once uncommented, only a single cell is displayed per row and the image doesn't seem to be resizing automatically. Can you please advise. Below is the ViewController. import UIKit class FrameworkListViewController: UIViewController { @IBOutlet weak var collectionView: UICollectionView! let list: [AppleFramework] = AppleFramework.list override func viewDidLoad() { super.viewDidLoad() collectionView.dataSource = self collectionView.delegate = self } } extension FrameworkListViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return list.count } func collectionView(_ collectionView: UICollectionView, cellForItemA
Topic: UI Frameworks SubTopic: UIKit
1
0
55
May ’25
Swiftui Table statement conditional table columns
Is it possible to have conditional table columns for a swifui Table statement? Like for this code TableColumn(Image) { artPiece in if let imageData = artPiece.artImage.first, let image = UIImage(data: imageData!) { Image(uiImage: image) .resizable() .frame(width: 50, height: 50) } else { Image(systemName: photo) .resizable() .frame(width: 50, height: 50) } } .customizationID(Image) TableColumn(Name, value: .artName) .customizationID(Name) TableColumn (Art ID, value: .artPieceID) { artPiece in Text(String(artPiece.artPieceID)) } .customizationID(Art ID) have a conditional TableColumn for this part of my SWIFTDATA model var artDefinedFields: [ArtDefinedFields] = [] or if I change the variable string array to this var artDefinedFields: [ArtDefinedFields] = Array(repeating: ArtDefinedFields(), count: 10), initialize the array with None and only create a TableColumn when there is aArtDeginedFields value other than None
3
0
665
Aug ’24
Two column SplitViewController side-by-side in regular size class
Hello, I configured a SplitViewController in Storyboard. Master and detail controller are each connected to a separate NavigationController that each has a separate TableViewController as root view controller. The master view controller is connected to the detail view controller to show detail in the segue. In code i set preferredDisplayMode = .allVisible to always show master and detail view controller side-by-side in regular size class. That worked well in iOS 13. Now, using latest iOS 14 beta the initial view shows the detail view controller instead of master even in regular size class only one view controller is shown at the same time. In Storyboard Two Columns is selected and i set One Column Beside as Display Mode and Tile as Behavior. Unfortunately that didn't help to restore the behavior as in iOS 13.
1
0
795
Aug ’20
Reply to Hide/Show tableview columns?
Did you already succeed to hide only the current column ? You should use func tableView(NSTableView, mouseDownInHeaderOf: NSTableColumn) Which tells the delegate that the mouse button was clicked in the specified table column’s header. Note: do you intend to do multiple selection in the popup ? May be not the best UI option. Why not a popover where to select the columns ? In this func, you can test for right click before calling popup. To change width of a column: let zeroWidth = 0.0 self.tableView.tableColumns[column].width = zeroWidth
Aug ’20
Reply to Safari does better than Firefox, but better isn’t good.
Another issue: If --count is set to 1 as result of round: --count: calc(round(down, calc(sqrt(var(--images))), 1) + 1); grid-template-columns: repeat(var(--count), 1fr); grid-template-columns: 1fr; isn’t the same (in Safari)! The first line results in 2 columns, not in one! Looks like the same reason. Because grid-template-columns: repeat(calc(var(--count) -0.01), 1fr); gives one column.
Topic: Safari & Web SubTopic: General Tags:
May ’23
Reply to Peculiar EXC_BAD_ACCESS, involving sparse matrices
the sparseMatrix function with comments: extension Array where Element == [Double] { // A sparse matrix is a mattrix where all zero's are ommitted. // Normal matrix: Sparse matrix: // 0 1 0 1 // 1 3 0 1 3 // 4 0 2 4 2 // Find the sparse matrix of this matrix. Returns an array of doubles containing the values of the sparse matrix (omitting all zero's) and a SparseMatrixStructure containing information about where the columns start and where the rows start. The values array of the sparse matrix above would be [1, 4, 1, 3, 2]. func sparseMatrix() -> (structure: SparseMatrixStructure, values: [Double]) { let columns = self.transpose() // Get the row indices of the matrix. The row indices of the sparse matrix above would be // [1, 2 column 0 // 0, 1, column 1 // 2] column 2 var rowIndices: [Int32] = columns.map { column in column.indices.compactMap { indexInColumn in if column[indexInColumn] != 0 { return Int32(indexInColumn) } return nil } }.reduce
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’24
Apple News Format 2 column container with different widths
https://developer.apple.com/documentation/apple_news/collection_display#see-alsoHi, I have a container using the following with a nested image and text component that both take 50% of the width of the container which is great for mobile, but for tablet, I'd like to be able to specify the maxwidth of only the image so that it takes 30% or a column span of 3 for larger displays. Does anyone know how to achieve that type of layout?contentDisplay: { type: collection, gutter: 15, rowSpacing: 30, distribution: wide, variableSizing: true }thanks!
0
0
631
Oct ’18
Reply to Help Loading an External CSV File on iOS in Swift
I was able to load a CSV into a TabularData based SwiftUI app -- loading and displaying was no issue ... but, HOW to update a value in a column. I created a bindable textfield for the columns in the table, and it displays the value for the rows/columns, and while the code to update the column compiles, it never updates the value in the DataFrame. Is a DataFrame read only ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
NSBrowser Column Resizing Causes NSWindowWillStartLiveResizeNotification to be posted even though the window isn't being resized.
I have an NSBrowser inside a window. When I start resizing a column I noticed a peculiar behavior: it causes NSWindowWillStartLiveResizeNotification to get posted for the NSWindow the browser is inside (and did end gets posted when column resizing finishes). The browser is not the NSWindow contentView but a descendant of the contentView. I have my reasons for caring (I'm currently listening for these window resize notifications) but my code naively assumes that NSWindowWillStartLiveResizeNotification - NSWindowDidEndLiveResizeNotification indicates a window resizing session, not a column resizing session for the NSBrowser. This is in contrast to NSOutlineView. When resizing columns in NSOutlineView the window resize notifications do not get posted. NSBrowser deliberately kicks it off: -[NSWindow _startLiveResize]; -[NSBrowser _resizeColumn:withEvent:] () So this seems quite intentional but is it necessary in modern macOS? Should I file a bug? I already did FB20298148
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
120
Sep ’25
Reply to NSPersistentCloudKitContainer - how to reset CoreData+CloudKit after failed automatic migration (while still in development environment)
Additional info to my questions above: even if I delete the app from the test device reset the Development Environment in the CloudKit dashboard for my apps container then reinstall the app out of Xcode the same skipping migration error shows up in the console. This does not make sense to me. Why after all CoreData DBs on test device(s) have been cleared and newly compiled code has been installed on device. Shouldn't Xcode use the current NSManagedObjectModel as the new zero generation model, and thus not need any migration!? What do I miss here? Or is this a CoreData bug? P.S. the log shows these lines: Skipping migration for 'ANSCKMETADATAENTRY' because it already has a column named 'ZDATEVALUE' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column named 'ZNEEDSUPLOAD' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column named 'ZNEEDSLOCALDELETE' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column nam
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’21
Reply to Sorting NSTableView
Setting the sort descriptor prototype of a table column allows the column to inform the table view of how it should be sorted when the user clicks that column's header. (Again, the table view isn't able to sort itself, but it informs the data source or, if so bound, its array controller, which sorts the data.)It also allows the table view to show an indicator in the header of the primary-sorting column.If your table doesn't have headers or will only ever have one column or isn't otherwise user-sortable, then you don't need to set the column's sort descriptor prototype.
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’15
Reply to Converting json to html table
Try to avoid things like NSArray if you're writing new Swift code. Be explicit about your types whenever possible.print(<table><thead>) if let columns = json[columns] as? [[String : String]] { for column in columns { let label = column[label]! print(<th>(label)</th>) } } print(</thead><tbody>) if let rows = json[rows] as? [[String : [String]]] { for row in rows { print(<tr>) for value in row[values]! { print( <td>(value)</td>, terminator: ) } print(</tr>) } } print(</tbody></table>)
Oct ’15
Reply to How to frozen a few columns for NSTableView
In the Width inspector (Command-Option-5), set the column's width, minimum and maximum all to the same value.Then, in the Attributes inspector for the table, make sure the Column Sizing menu is set to something other than First Column Only, depending how you want the rest of the columns to resize.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Feb ’16
CollectionViewCell switch back to single column once UImage is assigned
Hi I am building a simple multi column CollectionView here and trying to add 3 cell in a row. Well, in short the column and rows looks all fine if I comment the below code. which is no image and text assigned to cells. let framework = list[indexPath.item] cell.configure(framework) However, once uncommented, only a single cell is displayed per row and the image doesn't seem to be resizing automatically. Can you please advise. Below is the ViewController. import UIKit class FrameworkListViewController: UIViewController { @IBOutlet weak var collectionView: UICollectionView! let list: [AppleFramework] = AppleFramework.list override func viewDidLoad() { super.viewDidLoad() collectionView.dataSource = self collectionView.delegate = self } } extension FrameworkListViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return list.count } func collectionView(_ collectionView: UICollectionView, cellForItemA
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
55
Activity
May ’25
Swiftui Table statement conditional table columns
Is it possible to have conditional table columns for a swifui Table statement? Like for this code TableColumn(Image) { artPiece in if let imageData = artPiece.artImage.first, let image = UIImage(data: imageData!) { Image(uiImage: image) .resizable() .frame(width: 50, height: 50) } else { Image(systemName: photo) .resizable() .frame(width: 50, height: 50) } } .customizationID(Image) TableColumn(Name, value: .artName) .customizationID(Name) TableColumn (Art ID, value: .artPieceID) { artPiece in Text(String(artPiece.artPieceID)) } .customizationID(Art ID) have a conditional TableColumn for this part of my SWIFTDATA model var artDefinedFields: [ArtDefinedFields] = [] or if I change the variable string array to this var artDefinedFields: [ArtDefinedFields] = Array(repeating: ArtDefinedFields(), count: 10), initialize the array with None and only create a TableColumn when there is aArtDeginedFields value other than None
Replies
3
Boosts
0
Views
665
Activity
Aug ’24
Two column SplitViewController side-by-side in regular size class
Hello, I configured a SplitViewController in Storyboard. Master and detail controller are each connected to a separate NavigationController that each has a separate TableViewController as root view controller. The master view controller is connected to the detail view controller to show detail in the segue. In code i set preferredDisplayMode = .allVisible to always show master and detail view controller side-by-side in regular size class. That worked well in iOS 13. Now, using latest iOS 14 beta the initial view shows the detail view controller instead of master even in regular size class only one view controller is shown at the same time. In Storyboard Two Columns is selected and i set One Column Beside as Display Mode and Tile as Behavior. Unfortunately that didn't help to restore the behavior as in iOS 13.
Replies
1
Boosts
0
Views
795
Activity
Aug ’20
Reply to Hide/Show tableview columns?
Did you already succeed to hide only the current column ? You should use func tableView(NSTableView, mouseDownInHeaderOf: NSTableColumn) Which tells the delegate that the mouse button was clicked in the specified table column’s header. Note: do you intend to do multiple selection in the popup ? May be not the best UI option. Why not a popover where to select the columns ? In this func, you can test for right click before calling popup. To change width of a column: let zeroWidth = 0.0 self.tableView.tableColumns[column].width = zeroWidth
Replies
Boosts
Views
Activity
Aug ’20
Reply to Safari does better than Firefox, but better isn’t good.
Another issue: If --count is set to 1 as result of round: --count: calc(round(down, calc(sqrt(var(--images))), 1) + 1); grid-template-columns: repeat(var(--count), 1fr); grid-template-columns: 1fr; isn’t the same (in Safari)! The first line results in 2 columns, not in one! Looks like the same reason. Because grid-template-columns: repeat(calc(var(--count) -0.01), 1fr); gives one column.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Peculiar EXC_BAD_ACCESS, involving sparse matrices
the sparseMatrix function with comments: extension Array where Element == [Double] { // A sparse matrix is a mattrix where all zero's are ommitted. // Normal matrix: Sparse matrix: // 0 1 0 1 // 1 3 0 1 3 // 4 0 2 4 2 // Find the sparse matrix of this matrix. Returns an array of doubles containing the values of the sparse matrix (omitting all zero's) and a SparseMatrixStructure containing information about where the columns start and where the rows start. The values array of the sparse matrix above would be [1, 4, 1, 3, 2]. func sparseMatrix() -> (structure: SparseMatrixStructure, values: [Double]) { let columns = self.transpose() // Get the row indices of the matrix. The row indices of the sparse matrix above would be // [1, 2 column 0 // 0, 1, column 1 // 2] column 2 var rowIndices: [Int32] = columns.map { column in column.indices.compactMap { indexInColumn in if column[indexInColumn] != 0 { return Int32(indexInColumn) } return nil } }.reduce
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’24
Apple News Format 2 column container with different widths
https://developer.apple.com/documentation/apple_news/collection_display#see-alsoHi, I have a container using the following with a nested image and text component that both take 50% of the width of the container which is great for mobile, but for tablet, I'd like to be able to specify the maxwidth of only the image so that it takes 30% or a column span of 3 for larger displays. Does anyone know how to achieve that type of layout?contentDisplay: { type: collection, gutter: 15, rowSpacing: 30, distribution: wide, variableSizing: true }thanks!
Replies
0
Boosts
0
Views
631
Activity
Oct ’18
Reply to How to adjust Splitview size?
Unable to understand what you mean.I've got a splitview with 3 columns,Are the 3 columns in the detailView ?Because I do not see how you would create a splitView with 3 partsHow do you define these 3 columns ?
Replies
Boosts
Views
Activity
Aug ’19
Reply to Help Loading an External CSV File on iOS in Swift
I was able to load a CSV into a TabularData based SwiftUI app -- loading and displaying was no issue ... but, HOW to update a value in a column. I created a bindable textfield for the columns in the table, and it displays the value for the rows/columns, and while the code to update the column compiles, it never updates the value in the DataFrame. Is a DataFrame read only ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
NSBrowser Column Resizing Causes NSWindowWillStartLiveResizeNotification to be posted even though the window isn't being resized.
I have an NSBrowser inside a window. When I start resizing a column I noticed a peculiar behavior: it causes NSWindowWillStartLiveResizeNotification to get posted for the NSWindow the browser is inside (and did end gets posted when column resizing finishes). The browser is not the NSWindow contentView but a descendant of the contentView. I have my reasons for caring (I'm currently listening for these window resize notifications) but my code naively assumes that NSWindowWillStartLiveResizeNotification - NSWindowDidEndLiveResizeNotification indicates a window resizing session, not a column resizing session for the NSBrowser. This is in contrast to NSOutlineView. When resizing columns in NSOutlineView the window resize notifications do not get posted. NSBrowser deliberately kicks it off: -[NSWindow _startLiveResize]; -[NSBrowser _resizeColumn:withEvent:] () So this seems quite intentional but is it necessary in modern macOS? Should I file a bug? I already did FB20298148
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
0
Boosts
0
Views
120
Activity
Sep ’25
Reply to NSPersistentCloudKitContainer - how to reset CoreData+CloudKit after failed automatic migration (while still in development environment)
Additional info to my questions above: even if I delete the app from the test device reset the Development Environment in the CloudKit dashboard for my apps container then reinstall the app out of Xcode the same skipping migration error shows up in the console. This does not make sense to me. Why after all CoreData DBs on test device(s) have been cleared and newly compiled code has been installed on device. Shouldn't Xcode use the current NSManagedObjectModel as the new zero generation model, and thus not need any migration!? What do I miss here? Or is this a CoreData bug? P.S. the log shows these lines: Skipping migration for 'ANSCKMETADATAENTRY' because it already has a column named 'ZDATEVALUE' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column named 'ZNEEDSUPLOAD' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column named 'ZNEEDSLOCALDELETE' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column nam
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’21
MacOS 15.1 no longer showing photos EXIF data in Finder in column view
Anyone else notice that Finder no longer shows most photos exif data when in column mode - usually it appears below the photos image.
Replies
0
Boosts
0
Views
348
Activity
Nov ’24
Reply to Sorting NSTableView
Setting the sort descriptor prototype of a table column allows the column to inform the table view of how it should be sorted when the user clicks that column's header. (Again, the table view isn't able to sort itself, but it informs the data source or, if so bound, its array controller, which sorts the data.)It also allows the table view to show an indicator in the header of the primary-sorting column.If your table doesn't have headers or will only ever have one column or isn't otherwise user-sortable, then you don't need to set the column's sort descriptor prototype.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’15
Reply to Converting json to html table
Try to avoid things like NSArray if you're writing new Swift code. Be explicit about your types whenever possible.print(<table><thead>) if let columns = json[columns] as? [[String : String]] { for column in columns { let label = column[label]! print(<th>(label)</th>) } } print(</thead><tbody>) if let rows = json[rows] as? [[String : [String]]] { for row in rows { print(<tr>) for value in row[values]! { print( <td>(value)</td>, terminator: ) } print(</tr>) } } print(</tbody></table>)
Replies
Boosts
Views
Activity
Oct ’15