I'd like to persist the path on a sidebar selection, so when user comes back to the sidebar selection, they land where they were before. Unexpectedly, the path gets cleared when sidebarSelection is changed from the NavigationStack that uses the path to something else. Is this an intended behavior? How to workaround it? Using TabView is one way, but TabView has its own problems, so I'm wondering if there's a solution within NavigationSplitView first. Here is a minimal reproduce of the issue: struct Home2: View { private enum SidebarSelection: CaseIterable, Identifiable { var id: Self { self } case files, tags } @State private var sidebarSelection: SidebarSelection? = .files @State private var path: [Int] = [] var body: some View { NavigationSplitView { List(SidebarSelection.allCases, selection: $sidebarSelection) { selection in switch selection { case .files: Label(Files, image: custom.square.stack) case .tags: Label(Tags, systemImage: grid) } } } detail: { switch sidebarSelection { case .files: NavigationStac
Search results for
column
2,050 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
hii have same issue using just the sticker app. It should be showing a different colored mouse in each column, some show correctly others dont...each has a unique name
Topic:
App & System Services
SubTopic:
Core OS
Tags:
I'm having a problem with flexbox on iOS9. See ieee-ac.org for an example. It overlays and overprints columns that should have been stacked vertically. iOS8 works fine but not iOS9. Could it be the same problem that's described here?
Topic:
Safari & Web
SubTopic:
General
Tags:
In SwiftUI, the inspectorColumnWidth modifier is meant to control the width of an inspector column within a TableView. The ideal parameter of this modifier should set the initial width of the inspector column, and the system should remember the user-adjusted width for subsequent launches. However, in the beta version of SwiftUI you're using, it seems that the ideal width might not be respected on initial launch. Workarounds: While waiting for potential updates or bug fixes from Apple, here are a few workarounds you can consider to achieve your desired behavior: Set Minimum Width to Ideal Width: Since you want to guarantee the initial width while allowing users to reduce the width, you can set the minimum width to the same value as the ideal width. This way, users won't be able to resize the inspector column to a width smaller than the ideal width. This could be a suitable approach if you're okay with users having a fixed minimum width of 550. TableView() .inspector(isPresented: $sta
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
— All NSTableViews use NSTableColumn for their columns.— There are two ways of showing content in a table column:The old way uses subclasses of NSCell (like NSTextFieldCell), called a NSCell-based table view. The new way uses NSTableCellView, called a view-based table view. You should always use a view-based table view, and never the old way. (The old way is supported so that existing code doesn't stop working.)— In a view-based table view, you can still use objectValueForTableColumn, but you don't have to. Your table cells (NSTableCellView) has an objectValue property, that must be made to refer to an object that supplies data to the controls inside the table cell (buttons, text fields, etc). There are three ways of doing that:1. In your viewForTableColumn method, after you create the cell, you can simply set the property: NSTableCellView *cellView = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; cellView.objectValue = …2. In your data source, you can implement objectValueForT
Topic:
UI Frameworks
SubTopic:
AppKit
Tags:
hi,if you're willing to turn the Excel file into tab-separated text, it is easy to read the data into whatever is your data model. assuming your spreadsheet has column titles along its top row, the code below will give you a dictionary for every data row in the spreadsheet, keyed by the column titlesvar theDatabase = YourDatabase() // whatever is your database model // read the file as one big string var fileContents:String do { fileContents = try String(contentsOfFile: destinationPath, encoding: String.Encoding.utf8) } catch let error { print(Error reading file: (error.localizedDescription)) fileContents = } guard fileContents.count>0 else { return theDatabase } // split out records (separated by returns) let records = fileContents.split { $0 == r } // first record is field names, i.e., column titles let fieldNames = findFields(String(records[0])) // all remaining records are data, so match each with field names of record 0 for k in 1..<records.count { let values = findField
Topic:
Programming Languages
SubTopic:
Swift
Tags:
I slept on the problem and managed to find a workaround, although it's not a complete one.If I implement the delegate method -browser:numberOfRowsInColumn:, NSBrowser recognizes my object as an old-style delegate and will send all of the optional delegate methods. However, as I mentioned, this also severly limits the usability of NSBrowser because now calls to -itemAtRow:inColumn: and similar methods throw an exception that they are not supported.My solution (and by solution I mean hack) is to subclass NSBrowser and implement my own -itemAtRow:inColumn: method, like this:- (id)itemAtRow:(NSInteger)row inColumn:(NSInteger)column { NSMatrix* columnMatrix = [self matrixInColumn:column]; NSCell* cell = [columnMatrix cellAtRow:row column:0]; return cell.objectValue; }Since all of the cells in the NSMatrix are bound to the objects in the NSTreeController, the item of any given [row,column] is a well-known value. (Why NSBrowser can't do this is beyond me.)It doesn't solve the problem of -p
Topic:
UI Frameworks
SubTopic:
AppKit
Tags:
Oh I see. That's unfortunate but I can work around it by comparing the title property values. Thanks a ton for all your help. btw I changed the ObservableObjects to use generics. It doesn't seem to have an effect on functionality-wise. Everything works ok. However (this issue actually persisted before changing it to generics too), the SwiftUI preview for this view doesn't get rendered. swift class MenuViewObservableT: MenuItem: ObservableObject { var onButtonTap: ((MenuItem) - Void) = { _ in } } struct UserTypeMenuView: View { @ObservedObject var observable: MenuViewObservableMenu.UserType private let columns = [ GridItem(.flexible(), spacing: 20), GridItem(.flexible(), spacing: 20) ] var body: some View { ScrollView { LazyVGrid(columns: columns, spacing: 20) { ForEach(Menu.UserType.allCases, id: .self) { item in MenuButtonMenu.UserType(item: item, action: observable.onButtonTap) } } .padding(.horizontal) .padding([.top, .bottom], 20) } } } struct UserTypeMenuView_Previews: PreviewP
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
I see I forgot to enable email notifications of replies... fixed. I'm using a Swift table with 4 columns. In testing I replaced the columns with a fixed Text view to see if that was an issue. It wasn't. There was in issue in row: closure to the table in that the array consisted of large-ish structs and a lot of time was being taken allocating and freeing memory to copy the array entries. I changed the struct to a class and saved about 40% of the delay time. Still, there is something going on. When I select an item in the table the user experience is 1) the row turns blue, 2) longish delay, 3) text in the first column changes color. Normally lots of other stuff goes on but I disabled all of it looking for the source of the longish delay. That delay is the hang reported above. If I show system libraries it looks like this: Note that I also scrolled the tracks to show View Body and the Core Animation Commits -- fwiw I am not doing any additional animation over whatever is built into Sw
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
but then I will have to add it to each individual column If you need to repeat the same functionality for the context menu, put that in function and make the Button action call that same function. Probably obvious to many. But seems to be the only work around if you want the context menu for the row to be consistent. I too want a single context menu definition for a Table row. In UIKit you have to select the defined cell to reveal the context menu, clicking on places which are effectively empty space doesn't open the context menu. The trick here is to expand your cell to fit the column width. Out of the box Table { }.contextMenu{ } doesn't seem to work at all. I've attached the modifier to the Table and see no context menus at all. So it seems we are stuck with attaching the context menu to the contents of the TableColumn and each column if you want it appear across the row. It forces you to define the content closure, you can't use the TableColumn defaults. Still feels like being a
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
In the Build setting, I searched for unused. I saw the setting (3 columns in project, 4 in Targets)Resolve, myApp (in target only), myApp and iOS DefaultI wanted the alerts , so I set all to Yes except for the last column which is set to No and that I cannot change.That was my ScreenShot.the reading your answer, I realized that I was checking if it was working with Instance Var and it was not working but I just check inside a func and it work.I guess it must be the normal behaviour for instance var to not give the alert.Thank you Claude31, I think it's not the first time you help me !
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
I'm not sure I made my problem clearWhile I set the values in the table using the tableView method I'm allowing the user to change the values in the tableview by making the cells in the second column editable.I want to know how to retrieve the new values the user has entered from the table.I notice there are two versions of the tableView function. the first is called by the tableview to populate the cells.I'm unclear as to how/when the second version of the function is called:func tableView(tableView: NSTableView, setObjectValue object: AnyObject?, forTableColumn tableColumn: NSTableColumn?, row: Int) { an example of how to get the value for row n, column i of a tableview would be appreciated.Thanks for your help!
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Why is there no toggle button above? What do you mean by toggle button? Do you mean the button that hides and shows the sidebar? This is only present when the horizontalSizeClass is .regular. On an iPhone in portrait mode, it won't appear. And why is the menu always showing? What menu are you talking about? I cant see the detiail view anymore If you want to see the detail view, you need to select an item from the list. As I said before, the two-column layout with the sidebar toggle button is only present when the horizontalSizeClass is .regular. In your screenshot (an iPhone in portrait mode) the NavigationSplitView collapses down to a single column layout and acts more like a NavigationStack.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
I'm having the exact same issue but it seems to be confined to list and column views. I can't click the fourth item from the top whether it's a file or folder. Quite bizarre.
Topic:
App & System Services
SubTopic:
Core OS
Tags:
IB. but i also have 6 cells, each with a different image in it. its showing 6 cells in 2 columns, exactly like i want it to, but its all the same cell, just repeated, and very small
Topic:
Developer Tools & Services
SubTopic:
General
Tags: