Hi How to create UITableView programmatically with 2 ColumnsThanks
Search results for
column
2,071 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I've looked at lots of Grid examples. I've seen it documented that views within a GridRow are treated as if they were in an HStack. That's not happening for me. I have to explicitly put them into an HStack or they are treated as new rows. Here's my code: @State private var gridRows : Int = 4 @State private var gridCols : Int = 2 @State private var myItems : [Int] = Array(0...8) var body: some View { Group { if myItems.count > 0 { ScrollView([.vertical]) { Grid(alignment: .leading) { ForEach(0..<<--- { ForEach(0..
Topic:
UI Frameworks
SubTopic:
SwiftUI
Using private var columns: [GridItem] = [ GridItem(.fixed(100)), GridItem(.fixed(100)), GridItem(.fixed(100)) ] is the best way to guarantee them to be the same size. Using .flexible will allow to you either set nothing or the min/max. The size will change depending on the content though (and same with adaptive ). For this, you can ensure equal column widths if you make the header the same width for each column.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Do you want to remove a column or a row ?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Of course right after I asked the question I notice this in the release notes 🤦♂️ Conditional views in columns of NavigationSplitView fail to update on some state changes. (91311311) Workaround: Wrap the contents of the column in a ZStack.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
I found a way to turn on/off the menu. If the column Compare/Blame ... is shown the Syntax Coloring menu does not apear. If the right column is not visible one can edit the Color scheme of the code ....
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Can you try moving your mouse over the header row to the right end, and seeing if you get the mouse resizing icon? The columns are resizable widths if you get the mouse over the edge of the first column that you currently see. — Ed Ford, DTS Engineer
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
I think I called that function in wrong way. What do you mean precisely ? You do not call this func yourself. System calls it when needed to populate the given column * row with the content you specify. . And how does this function know which column it want to fill up the value, based on the second parameter I input? because what you specify in returned value depends on column (you test the identifier) and the row (you pick in the appropriate data source).
Topic:
UI Frameworks
SubTopic:
AppKit
Tags:
Just want to clarify, suppose I want to parse a table with multiple columns each separated by “|”, I can do one of the followings and use firstMatch(of: regex) or wholeMatch(of: regex), but they assume fixed number of columns in the table. How do I deal with dynamic number of columns? // using multi-line literal let regex = #/ (|) (? (.*?)(?=|)) (|) (? (.*?)(?=|)) (|) (? (.*?)(?=|)) /# // using RegexBuilder let separator = /|/ let regexBuilder = Regex { separator Capture ( OneOrMore(.any, .reluctant) ) separator Capture ( OneOrMore(.any, .reluctant) ) separator Capture ( OneOrMore(.any, .reluctant) ) separator }
Topic:
App & System Services
SubTopic:
General
Tags:
I have the same issue. It is my understanding that the old 'detail' paradigm no longer applies with the new two-column / three-column styles. It means, that there is no master/detail now, but just primary, supplementary, secondary and compact columns. So even if showDetail works in some cases, it is actually an anomaly. Until we get a first-class segue for 'columns' (eg. showSupplementary, showSecondary, showCompact), we may have to just set things programatically using setViewController(_:for:) methods. Furthermore, I don't think the new documentation prescribes any specific direction in which the settings should be made (eg. Primary -> Supplementary -> Secondary). For example, an app may choose to populate supplementary and secondary at the same time (eg. Supplementary showing the overview of Secondary content), or secondary may drive the supplementary column. (eg. supplementary shows a snippet of secondary content). For these reasons, defining new segues m
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
All examples regarding SwiftUI Tables and sorting work fine, but they also have all the data available immediately. If I load the data in .task, sorting only works on the first column. Test data: struct Customer: Identifiable { let id = UUID() let name: String let email: String let creationDate: Date } func parseDate(from text: String) -> Date { let formatter = DateFormatter() formatter.dateFormat = dd/MM/yyyy return formatter.date(from: text) ?? Date() } func getTestData() -> [Customer] { return [ Customer(name: John Smith, email: john.smith@example.com, creationDate: parseDate(from: 04/11/2015)), Customer(name: Jane Doe, email: jane.doe@example.com, creationDate: parseDate(from: 29/04/2009)), Customer(name: Bob Johnson, email: bob.johnson@example.com, creationDate: parseDate(from: 01/08/2010))] } And here the view: table 1 populates the array in the initializer table 2 loads the content in .task, initially it is empty table 3 loads the content in .task, initially it contains one dummy object
It turns out that the problem isn't with GeometryReader, it's with LazyVGrid. I'm not clear on why, but my grid with 5 columns doesn't always report the same size. I can make it work by adding a 6th column that doesn't get used in the view. Very odd.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Hey there, I was trying to get an overview of the new navigation in the Xcode-14 Beta. I watched the WWDC22 session The SwiftUI Cookbook for Navigation and downloaded the associated sample code https://developer.apple.com/documentation/swiftui/bringing_robust_navigation_structure_to_your_swiftui_app. When trying it out, I noticed that the two-column mode of the NavigationSplitView in portrait mode does not work properly on iOS. In the download version of NavigationCookbook, a click on one of the related recipes in the recipe detail view does not lead to the detail view of the corresponding recipe (portrait format only on iOS), but to the detail of the NavigationSplitView. The only solution I found was to include a NavigationStack in .navigationDestation. Is there a more sophisticated solution other than using @Environment(.horizontalSizeClass) private var horizontalSizeClass to avoid the problem.
And only in LIST mode, in Column mode they do!
Topic:
App & System Services
SubTopic:
Core OS
Tags:
Please explain what you mean by `date column`.
Topic:
Programming Languages
SubTopic:
Swift
Tags: