Search results for

column

2,051 results found

Post

Replies

Boosts

Views

Activity

Reply to Reset Matrix Help
for anyone who might have the same question/problem. here's the sample that works as I wanted. import SwiftUI struct ContentView: View { let numberOfRows = 5 let numberOfColumns = 5 @State var matrix: [[Int]] = Array(repeating: Array(repeating: 0, count: 5), count: 5) @State var selectedRow1 = 0 @State var selectedColumn1 = 0 @State var selectedRow2 = 0 @State var selectedColumn2 = 0 @State var selectedRow3 = 0 var body: some View { VStack { Image(systemName: globe) .imageScale(.large) .foregroundColor(.accentColor) Text(Hello, world!) Form { Section(header: Text(Question 1)) { Picker(Select a row:, selection: $selectedRow1) { ForEach(1...numberOfRows, id: .self) { row in Text((row)) } } .pickerStyle(SegmentedPickerStyle()) Picker(Select a column:, selection: $selectedColumn1) { ForEach(1...numberOfColumns, id: .self) { column in Text((column)) } } .pickerStyle(SegmentedPickerStyle()) } Section(header: Text(Question 2)) { Picker(Select a row:, selection: $selectedRow2) { ForEach(1..
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’23
Reply to UIPickerView row descriptions
I don't understand what are each component. Component is a column, it seems you are trying to use a component as a title for column ? If I understand correctly, you should have only 3 components. And titleForRow 0 should hold the title. To forbid selection of title, do it in func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { with the following code: var selectedRow = row if selectedRow == 0 { // title not to be selected selectedRow = 1 pickerView.selectRow(selectedRow, inComponent: component, animated: false) }
Topic: Programming Languages SubTopic: Swift Tags:
May ’22
Reply to Nesting engineering type tracks under custom instrument
Hey there!Great question.In general, you can specify multiple levels in the engineering-type-track elements by specifying multiple hierarchy levels.Your tracks can be nested under instrument if you specify <self/> as the first hierarchy level, like so:<hierarchy> <level> <self/> </level> <level> <column>value-column</column> </level> </hierarchy>Then, in the matching augmentation, you'll need to provide Instrument type ID as the first restriction level:<slice-type-hierarchy> <level> <slice-type>instrument-type</slice-type> <equals> <instrument-type>com.example.your-instrument-id</instrument-type> </equals> </level> <level> <slice-type>value-column-type</slice-type> </level> </slice-type-hierarchy>Please keep in mind that you can create hierarchies even if you don't nest something under instrument track — just specify more levels in
Feb ’20
Reply to Matrix - Buffer, row - column representation problem
Matrix components are constructed and consumed in column-major order.https://developer.apple.com/library/ios/documentation/Metal/Reference/MetalShadingLanguageGuide/data-types/data-types.htmlThe reason that the results are not consistent with your expectations is that you are not constructing your matrix in column major order. Here's the matrix you're making:0 | 4 | 8 | 121 | 5 | 9 | 132 | 6 | 10 | 143 | 7 | 11 | 15
Topic: Graphics & Games SubTopic: General Tags:
Nov ’15
How to hide stacked navigation bars when using SwiftUI inspector in UISplitViewController secondary column
During WWDC Q&As I asked how I could add an inspector to my UIKit app that’s using UISplitViewController with a double column style featuring a sidebar and detail view controller. I initially tried a full-height inspector (by putting my split view controller into a SwiftUI view and applying the inspector on that, embedding that into a UIHostingController to be the rootViewController) but this caused a bunch of UI bugs (seemingly related to optimizations made for a size class that doesn’t match the actual appearance) and it doesn’t extend into the NSToolbar on Mac Catalyst anyways. I now want to try implementing the under-the-toolbar solution. An engineer said: For an under toolbar appearance, you should be able to use .inspector on the detail view controller (after wrapping it in a SwiftUI view), but you may have to do manual toolbar management here (hiding and showing) to make sure you don't end up with stacked toolbars/UINavigationBars I have indeed run into the problem with two navigation bars
0
0
1.2k
Jun ’23
Reply to Plist max size
Its tables with numbers in format 00.00 or 0.00000 200-300 rowsabout 100 columns It’s a reference table, to get correct value by column and row nameAs an example, here is multiply table 1 2 31 1 2 32 2 4 33 3 6 9So, basically, to calculate some values, I need to get reference value from one or two tables.For examplex = (a+b+c)/(get value from table A for 2*3)
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’17
Reply to SwiftUI Table Limit of Columns?
One way to this is to use multiple TableColumnBuilder objects. Using Group removes the ability to sort via the column headers, and fancy column customization was failing for me too. TableColumnBuilders also create more easily organized code. https://developer.apple.com/documentation/swiftui/tablecolumnbuilder/ @TableColumnBuilder> var tableColumns1: some TableColumnContent> { TableColumn( ... Table(of: ObjectType.self, selection: $selection, sortOrder: $sortOrder, columnCustomization: $columnCustomization) { tableColumns1 tableColumns2 tableColumns3 } rows: { ForEach(filteredCompositions) { obj in TableRow(obj) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
Reply to iOS 16.1 Crashes when scroll (LazyVStack and LazyVGrid)
Can reproduce this with Xcode Version 15.1 beta 3 (15C5059c) deploying to iPhone 14 Pro running iOS 17.1.1. Make a test project with Apple's LazyVGrid sample code. Launch app in portrait, scroll to bottom, rotate to landscape, rotate to portrait, scroll to top, crash! let columns = [GridItem(.flexible()), GridItem(.flexible())] var body: some View { ScrollView { LazyVGrid(columns: columns) { ForEach(0x1f600...0x1f679, id: .self) { value in Text(String(format: %x, value)) Text(emoji(value)) .font(.largeTitle) } } } } private func emoji(_ value: Int) -> String { guard let scalar = UnicodeScalar(value) else { return ? } return String(Character(scalar)) } id: .self tut tut Apple sample code developer! (this is not the cause of this crash though).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23