Search results for

“column”

2,091 results found

Post

Replies

Boosts

Views

Activity

Swift - access attribute in array of core data entities in a table column via a variable
The below code works. I pass in an array of core data entities and display attributes in a table. In the second table column I use a switch case statement to handle the 3 possible attributes I want to display. I could eliminate the switch case if I could figure out how to access a given core data attribute via a variable that contains the specific attribute name but have been unable to determine how to do so. Two attempts are commented out in the code. struct DataTable: View { private var closingValues: Array var heading: String var attribute: String init(closingValues: [TradingDayPrices], heading: String, attribute: String) { self.closingValues = closingValues self.heading = heading self.attribute = attribute } var body: some View { Text(heading) .foregroundColor(.black) .font(Font.custom(Arial, size: 18)) .bold() .padding(.top, 10) Table(self.closingValues) { TableColumn(Date) { value in HStack { Spacer() Text(dateToStringFormatter.string(from: value.timeStamp!)) Spacer() } } .width(100) TableColum
1
0
908
Apr ’23
Reply to TabularData Framework: DataFrame as a List in SwiftUI
Here's a working example for Mac OS (but should be the same for iOS except for the URL setup for the incoming csv file). The csv test data are in 3 columns, with headers of Name, Position and Score - so as to test data types of String, Integer and Double. The Data Model (ViewModel) import Foundation import TabularData class DataModel { static let shared = DataModel() @Published var dataTable: DataFrame? init() { getData() } func getData() { var url: URL? do { url = try FileManager.default.url(for: FileManager.SearchPathDirectory.downloadsDirectory, in: FileManager.SearchPathDomainMask.userDomainMask, appropriateFor: nil, create: true) } catch{ print(Failed to get Downsloads URL (error)) return } let csvOptions = CSVReadingOptions(hasHeaderRow: true, ignoresEmptyLines: true, delimiter: ,) let fileURL = url?.appendingPathComponent(TestCSV.csv) do { dataTable = try DataFrame(contentsOfCSVFile: fileURL!,columns: nil, rows: nil, types: [Name:CSVType.string,Position:CSVType.integer,Score:CSVType.d
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’22
Reply to SwiftUI Collection View
I agree these are not technically collection views or table views.What I meant and would like to achieve is a grid layout (like in Music's album library, Apple Books' library, etc.) or cascading layout (e.g. Pinterest) natively in SwiftUI.According to SwiftUI's documentation, a List is a container that presents rows of data arranged in a single column. What I'm looking for is a container that present data arranged in several columns and rows.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’19
Reply to UITabBarController as secondary controller in UISplitViewController is producing 2 navigation bars in compact view
When using the column based split view controller, it presumes that clients want a navigation controller in each of its non-compact columns and will wrap a view controller in one of not provided. This is primarily so that collapsing (when it moves from multiple to single column) behaves deterministically and automatically. So what is happening is you're getting a tab bar controller wrapped in a navigation controller with additional navigation controllers inside – and thus double navigation bars. Realistically this may be a case where you want to create your own custom view controller container instead of using UISplitViewController, as I'm not sure how many of the edge cases you would hit might be resolved.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’23
Reply to Illegal NSTableViewDataSource
You use it here : if let cell = tableView.makeView(withIdentifier: (tableColumn!.identifier), owner: self) as? NSTableCellView {if I have different cell prototypes for each colum, then I create an identifier for each.extension RegistrationReportsViewController: NSTableViewDelegate { func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { if tableColumn == nil { return nil } // Extra safety var cellIdentifier = var cellContent = let registration = fetchedResultsController.fetchedObjects! [row] let column = tableView.tableColumns.firstIndex(of: tableColumn!)! switch column { case 0: cellContent = registration.lastName ?? cellIdentifier = CellIdLastName // The one you give in IB of course case 1: cellContent = registration.firstName ?? cellIdentifier = CellIdFirstName // Take care of uppercases case 2: cellContent = registration.middleName ?? cellIdentifier = CellIdMiddleName default: break } if let cell = tableView.makeView(withIdentifier: N
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20
Reply to How do I create a tableview with a variable number of columns where the extra columns have checkboxes in them?
Your reply was quite helpful and I quit trying to figure how to get bindings working with this. Too much behind the scenes magic wasting my time.Once I knew I was looking for a solution avoiding bindings, I found a couple gems in the TableViewPlayground sample code that I am pretty sure are not explicitly mentioned in the documentation. Below are details of what I had to do to get a tableView operating without bindings, which IMO, is far easier than bindings once you are aware of the process.VERY IMPORTANT KEYS to building View based DATASOURCE TableViews1. USE BASIC UI items (NSButton), NOT NSTableCellView2. Contrary to #1, you can use NSTableCellView for TextFields, imageViews IF... see below.3. Add your basic UI Items directly to the NSTableColumn, delete provided the NSTableCellView.4. Carefully implement tableView:inTableView viewForTableColumn:inTableColumn row:inRow.Maybe (probably) I am blind, but I trusted the default mechanisms in Interface Builder regardingbuilding tables. Well, they are probably a
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’17
Reply to UITabBarController is unsupported as viewController
I just ran into this too. The way I was able to get around it was to edit the SplitViewController in the storyboard and set the Style to 'Unspecified'. I think this is the 'classic' mode for SplitViewControllers, as opposed to the 2-column vs 3-column styles that Apple is now encouraging. I think maybe the Build For iPad WWDC video explains the roadmap for where SplitViewControllers are going. We will all eventually have to rethink how our UI's work.
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’20
Reply to How to remove all columns from NSOutlineView?
I don't understand the question. Under what circumstances would it be useful to get rid of all columns?>> in case the NSOutlineView has an outline table columnThis is not a case in any reasonable sense. The defining feature of an outline view is that is has an outline column.What's the exact error message you got from trying to use removeTableColumn: on the outline column? I wouldn't be surprised (as an unrelated issue) if the error message is incorrect for historical reasons.
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’18
Reply to More info on restore state between split and tab hierarchies needed please
For the UISVC behavior: Use the delegate methods, -splitViewController:topColumnForCollapsingToProposedTopColumn: and splitViewController:displayModeForExpandingToProposedDisplayMode: to set up which vc's are displaying the data. Just return the value that's proposed (presuming that's what you want—if you have set a vc for the compact column, the compact column will be proposed for the collapse). If you want to reparent view controllers at that time, be careful. In the long run, it's probably easier to have separate vc instances.
Topic: UI Frameworks SubTopic: General Tags:
Jun ’20
Reply to How to use combo box cell in a tableView
I get an error when I added the following statement NSComboBoxCell.delegate = self The error was no delegate member for NSComboBoxCell.. So, I created a new test project which had a single view and a tableView that I added a comboBox to one of the columns without trying to use a datasource, I expected to see Item 1, Item 2 .. etc. in the column, but again nothing. Also, the comboBox is editable. There must be something basic I am missing. Still looking for an example..
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’21
Swift - access attribute in array of core data entities in a table column via a variable
The below code works. I pass in an array of core data entities and display attributes in a table. In the second table column I use a switch case statement to handle the 3 possible attributes I want to display. I could eliminate the switch case if I could figure out how to access a given core data attribute via a variable that contains the specific attribute name but have been unable to determine how to do so. Two attempts are commented out in the code. struct DataTable: View { private var closingValues: Array var heading: String var attribute: String init(closingValues: [TradingDayPrices], heading: String, attribute: String) { self.closingValues = closingValues self.heading = heading self.attribute = attribute } var body: some View { Text(heading) .foregroundColor(.black) .font(Font.custom(Arial, size: 18)) .bold() .padding(.top, 10) Table(self.closingValues) { TableColumn(Date) { value in HStack { Spacer() Text(dateToStringFormatter.string(from: value.timeStamp!)) Spacer() } } .width(100) TableColum
Replies
1
Boosts
0
Views
908
Activity
Apr ’23
Reply to TabularData Framework: DataFrame as a List in SwiftUI
Here's a working example for Mac OS (but should be the same for iOS except for the URL setup for the incoming csv file). The csv test data are in 3 columns, with headers of Name, Position and Score - so as to test data types of String, Integer and Double. The Data Model (ViewModel) import Foundation import TabularData class DataModel { static let shared = DataModel() @Published var dataTable: DataFrame? init() { getData() } func getData() { var url: URL? do { url = try FileManager.default.url(for: FileManager.SearchPathDirectory.downloadsDirectory, in: FileManager.SearchPathDomainMask.userDomainMask, appropriateFor: nil, create: true) } catch{ print(Failed to get Downsloads URL (error)) return } let csvOptions = CSVReadingOptions(hasHeaderRow: true, ignoresEmptyLines: true, delimiter: ,) let fileURL = url?.appendingPathComponent(TestCSV.csv) do { dataTable = try DataFrame(contentsOfCSVFile: fileURL!,columns: nil, rows: nil, types: [Name:CSVType.string,Position:CSVType.integer,Score:CSVType.d
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to 10.12 filling up with swap files...killing disk
>Consider the columns shown in this shot from El Capitan:Consider we're not allowed to see inline images/screenshots here.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’16
Reply to SwiftUI Collection View
I agree these are not technically collection views or table views.What I meant and would like to achieve is a grid layout (like in Music's album library, Apple Books' library, etc.) or cascading layout (e.g. Pinterest) natively in SwiftUI.According to SwiftUI's documentation, a List is a container that presents rows of data arranged in a single column. What I'm looking for is a container that present data arranged in several columns and rows.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’19
Reply to uistackview
Sorry the question is how to build the 2 column 23 rows by program, not with interface builder.
Replies
Boosts
Views
Activity
Oct ’15
Reply to How do I use the nonsymmetric_general function from Accelerate?
The matrix must be in column-major layout. I missed that somehow. Reading too quickly I guess. :)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to UITabBarController as secondary controller in UISplitViewController is producing 2 navigation bars in compact view
When using the column based split view controller, it presumes that clients want a navigation controller in each of its non-compact columns and will wrap a view controller in one of not provided. This is primarily so that collapsing (when it moves from multiple to single column) behaves deterministically and automatically. So what is happening is you're getting a tab bar controller wrapped in a navigation controller with additional navigation controllers inside – and thus double navigation bars. Realistically this may be a case where you want to create your own custom view controller container instead of using UISplitViewController, as I'm not sure how many of the edge cases you would hit might be resolved.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to Illegal NSTableViewDataSource
You use it here : if let cell = tableView.makeView(withIdentifier: (tableColumn!.identifier), owner: self) as? NSTableCellView {if I have different cell prototypes for each colum, then I create an identifier for each.extension RegistrationReportsViewController: NSTableViewDelegate { func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { if tableColumn == nil { return nil } // Extra safety var cellIdentifier = var cellContent = let registration = fetchedResultsController.fetchedObjects! [row] let column = tableView.tableColumns.firstIndex(of: tableColumn!)! switch column { case 0: cellContent = registration.lastName ?? cellIdentifier = CellIdLastName // The one you give in IB of course case 1: cellContent = registration.firstName ?? cellIdentifier = CellIdFirstName // Take care of uppercases case 2: cellContent = registration.middleName ?? cellIdentifier = CellIdMiddleName default: break } if let cell = tableView.makeView(withIdentifier: N
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’20
Reply to How do I create a tableview with a variable number of columns where the extra columns have checkboxes in them?
Your reply was quite helpful and I quit trying to figure how to get bindings working with this. Too much behind the scenes magic wasting my time.Once I knew I was looking for a solution avoiding bindings, I found a couple gems in the TableViewPlayground sample code that I am pretty sure are not explicitly mentioned in the documentation. Below are details of what I had to do to get a tableView operating without bindings, which IMO, is far easier than bindings once you are aware of the process.VERY IMPORTANT KEYS to building View based DATASOURCE TableViews1. USE BASIC UI items (NSButton), NOT NSTableCellView2. Contrary to #1, you can use NSTableCellView for TextFields, imageViews IF... see below.3. Add your basic UI Items directly to the NSTableColumn, delete provided the NSTableCellView.4. Carefully implement tableView:inTableView viewForTableColumn:inTableColumn row:inRow.Maybe (probably) I am blind, but I trusted the default mechanisms in Interface Builder regardingbuilding tables. Well, they are probably a
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’17
Reply to Internal testers cannot see app in Testflight app
Correct; the 'invitations sent' column is blank. I stated that issue along with pointing Apple to this very forum thread in my earlier escalation with them.
Replies
Boosts
Views
Activity
Feb ’20
Reply to UITabBarController is unsupported as viewController
I just ran into this too. The way I was able to get around it was to edit the SplitViewController in the storyboard and set the Style to 'Unspecified'. I think this is the 'classic' mode for SplitViewControllers, as opposed to the 2-column vs 3-column styles that Apple is now encouraging. I think maybe the Build For iPad WWDC video explains the roadmap for where SplitViewControllers are going. We will all eventually have to rethink how our UI's work.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’20
Reply to How to remove all columns from NSOutlineView?
I don't understand the question. Under what circumstances would it be useful to get rid of all columns?>> in case the NSOutlineView has an outline table columnThis is not a case in any reasonable sense. The defining feature of an outline view is that is has an outline column.What's the exact error message you got from trying to use removeTableColumn: on the outline column? I wouldn't be surprised (as an unrelated issue) if the error message is incorrect for historical reasons.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’18
Reply to More info on restore state between split and tab hierarchies needed please
For the UISVC behavior: Use the delegate methods, -splitViewController:topColumnForCollapsingToProposedTopColumn: and splitViewController:displayModeForExpandingToProposedDisplayMode: to set up which vc's are displaying the data. Just return the value that's proposed (presuming that's what you want—if you have set a vc for the compact column, the compact column will be proposed for the collapse). If you want to reparent view controllers at that time, be careful. In the long run, it's probably easier to have separate vc instances.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’20
Reply to How to use combo box cell in a tableView
I get an error when I added the following statement NSComboBoxCell.delegate = self The error was no delegate member for NSComboBoxCell.. So, I created a new test project which had a single view and a tableView that I added a comboBox to one of the columns without trying to use a datasource, I expected to see Item 1, Item 2 .. etc. in the column, but again nothing. Also, the comboBox is editable. There must be something basic I am missing. Still looking for an example..
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’21
Reply to SwiftUI - Split View on iPad problem
SwiftUI uses the default two column behaviour that does what you are experiencing. I had to use a UISplitView at the top level of my app to get around that.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’21