Search results for

column

2,052 results found

Post

Replies

Boosts

Views

Activity

Reply to Best way to make a grid with both top and left headers
You can definitely use Grid for this! You can do something like this: Grid{ GridRow { ForEach(0..<3) { _ in Text(header) .padding() } } ForEach(0..<3){ num in GridRow { Text((num)) .padding() ForEach(0..<2) { _ in Text(X) .padding() } } } } The first GridRow would iterate through your data for your headers. Here, I have 3 headers as I will only be using 3 columns for my data. Then, I have a ForEach that gives me 3 more GridRows. Each of these contain the label for the vertical axis label and then another ForEach that contains the data for that row. This gives you both vertical and horizontal axis labels and the data is laid out by row.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’23
NavigationSplitView and .navigationDestination
I've run into two issues using NavigationSplitView with .navigationDestination modifiers. First, programmatic navigation using .navigationDestination(isPresented: destination) does not seem to work when used in the content column of a NavigationSplitView It does, however, work from the sidebar / first column. Second, it appears that we need to add redundant .navigationDestination modifiers on iPhone and iPad to handle how NavigationSplitView is adapted when used on iPhone. Specially, when it is collapsed into a NavigationStack. Also, when an iPad UI is collapsed to a NavigationStack via Stage Manager, then expanded again, .navigationDestination modifiers in the content column seem to get lost, preventing the content list from working going forward. This somewhat explains why dynamically adding .navigationDestinations via the first column push isn't sufficient. However it results in a broken UI. Is there one location we can place .navigationDestination modifiers to work both
1
0
699
Apr ’23
Why wont my decoder parse .json files
launchdata.json: [ { name: Smartcard, imageName: Smartcard, description: A all new way to buy and sell stuff featuring RFID and NFC for touchless transactions and with local server you can pay with your phone., department: Ticki Finance, productid: 1737484, id: 1, creator: The Ticki Team }, { name: Ink pad, imageName: Inkpad, description: A quick and easy way to take fingerprints and stamp stamps:), And with a quick water activation taking only 15 seconds you can setup in no time. Also, refilling the ink chamber is super easy, all you have to do is put ink in the middle hole., department: Ticki Design, productid: 7338388, id: 2, creator: The Ticki Team }, { name: Wallet, imageName: Wallet, description: Ever had issues with your credit cards falling out of your pocket/wallet? Well this fixes any issues. Introducing Ticki Wallet. , department: Ticki Finance, productid: 2444495, id: 3, creator: The Ticki Team }, { name: Pencil Case, imageName: PencilCase, description: I always lose my my pencils. How about you?
4
0
674
Apr ’23
Reply to NavigationLink and .navigationDestination Hang and Infinite Loop
You're pushing multiple stacks that share the same path. So one stack is trying to push another stack which is trying to push the other stack.... It's a happy coincidence that ObservableObject doesn't infinite loop, I'm surprised it does not. 2 general rules will help when using the navigation system: move navigationDestination modifiers as high up in the view hierarchy. This is more efficient for the Navigation system to read up front than with potentially every view update. Don't push stacks onto stacks, and try to avoid entire NavigationStacks coming and going from the columns of a NavigationSplitView. NSV will adopt the stack and integrate its state with the state of the whole split view. I ran this example on macOS and it looked as expected import SwiftUI import OSLog final class NavigationModel: ObservableObject { @Published var path = NavigationPath() { didSet { print(navigationModel.path.count: (path.count)) } } } struct Report: Hashable { var title: String = Report Title } private let logger
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’23
Reply to Overlaid items hide behind neighbouring views
Finally I went with something similar to what you suggested : var body: some View { GeometryReader {geometry in let size = min(geometry.size.width, geometry.size.height) let tileSize = size / 8 VStack( spacing: 0.0) { ForEach((0..<8).reversed(), id: .self) { rowIndex in HStack(spacing: 0) { ForEach((0..<8), id: .self) { columnIndex in TileView(x: rowIndex, y: columnIndex) } } } }.overlay(alignment: .bottomLeading){ ForEach(Array(model.initialState.keys), id:.self) { let (row, column) = $0.tuple() let piece = model.initialState[$0]! let offset = model.offset(piece: piece, val: tileSize) PieceView(type: piece.figure, side: piece.side) .frame(width: tileSize, height: tileSize) .offset(x: CGFloat(row) * tileSize, y: -CGFloat(column) * tileSize) .offset(offset) } } } } I thought Z Indexes are global ... then what they refer to ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’23
Reply to Creating Floor Plan with RoomPlan
actually what you need to do is remove the y component and not the z component, if you want to convert from 3D->2D, from CapturedRoom you get dimensions.x (wall length) and (transform) .columns.3.x, transform .columns.3.z) is the coordinate of the center of the wall and the direction(transform.columns.0.z, transform.columns.0.z), is the direction of the wall, now you there is a starting and ending point of a wall, similar to other things
Topic: Spatial Computing SubTopic: ARKit Tags:
Mar ’23
Reply to Weird behavior with NavigationSplitView and @State
Same issue is happening when you have Three Column layout. But it seems to be more visible what is happening. When I select other category in the main sidebar, the selected item in secondary sidebar won't get unselected, plus new item from selected category gets selected. So now after two clicks I have somehow two selected items in my secondary sidebar and when i'll continue playing with it I'll get thread ERROR. The problem is the automatic selection of item in second list. you can't touch on that and reset it when the category from primary sidebar is changed. What is really surprising for me is that I haven't found any threads about this so far, even though this behavior is happening in the most basic example of three column layout where you have same items in different categories.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’23
A glitch of CGContextSetFillPattern glitch on Ventura
I find a glitch of CGContextSetFillPattern glitch only on Ventura. If the size of the pattern is a multiple of 4, there will be a hole in the upper right corner of the pattern in the first column. I make a demo Xcode project here. I have tried all three CGPatternTiling enum values, all have the same result.
Topic: UI Frameworks SubTopic: AppKit Tags:
2
0
595
Mar ’23
Reply to CoreData stack init is freeze
I noticed a CoreData error when keeps app working with the copied sqlite files. The console shows: CoreData: error: (13) database or disk is full CoreData: annotation: Disconnecting from sqlite database due to an error. CoreData: error: SQLCore dispatchRequest: exception handling request: , error during SQL execution : database or disk is full with userInfo of { NSFilePath = /var/mobile/Containers/Data/Application/77B8EAB6-120F-4E4D-AE96-EDC81258A250/Documents/myDB2.sqlite; NSSQLiteErrorDomain = 13; } It happens randomly and multiple times after different CoreData activities: SELECT TBL_NAME FROM SQLITE_MASTER WHERE TBL_NAME = 'ACHANGE' SELECT all columns from the regular table. SQLite bind[2] = SQLite: EXPLAIN QUERY PLAN SELECT sql: COMMIT Fetching 13543 rows Is it mean that the iPad doesn't have enough disk or RAM space? The iPad storage shows 26 GB of 128 GB used and application alocated only 48 MB RAM. I don't see the same errors on a different iPad with the same copied files.
Mar ’23
In UISplitViewController, can I use same viewController as a primary and compact column?
I am trying to utilize UISplitViewController to develop my app for iPad users. Since my app has a UITabBarController as its root view controller, I want to set this root view controller as a primary view controller in new UISplitViewController hierarchy, and its detail view controller to the secondary column. Also, when the app's width size class is compact (iPad SplitView mode), I want it to be same as current app. So the root view controller (UITabBarController) should be on the compact column of the new UISplitViewController system like below. class MySplitViewController: UISplitViewController { override init(style: UISplitViewController.Style) { super.init(style: style) let primaryVC = PrimaryViewController() let secondaryVC = SecondaryViewController() setViewController(primaryVC, for: .primary) setViewController(secondaryVC, for: .secondary) setViewController(primaryVC, for: .compact) } } With this code, in regular width mode, the primary and secondary column looks great as I e
2
0
598
Mar ’23
Reply to Video with different audio and video durations for HLS playback
I don't understand what is the discontinuity information duration table saying. What is the domains column? What does it mean if the start time table is all empty dashes? Also, I tried running the validator tool against the same file without differing video and audio stream duration and there was no error about Different content duration detected between discontinuities but there was still a shorter discontinuity information table. So is there something else that could be causing that warning instead of the total duration of the two streams being different in seconds? And yes I meant to extend the audio stream to match the video stream duration by padding the request and manifest with silence or padding video with empty P frames.
Topic: Media Technologies SubTopic: Streaming Tags:
Mar ’23
Tables, Pickers and Bindings, woe my...
I have a Core Data entity with a few properties, the ones of interest here are a UUID column named id and an Int16 column containing values between 0 and 3. I have a Table in SwiftUI which is correctly arranging the items stored by Core Data into its rows. The selection: binds a Set of the id values. I have another view to which I have sent the Set of id values (Set) (Bin is the name of my entity) using @Binding var ... - so far so good. Within that view, I can determine that I am correctly getting the set of interest, and most of what I am trying to accomplish I can get to work. What is driving me up the wall, however, is that I am trying to get a Picker in the child view to let me change the value of the Int16 property (called playMode) of the first selected object from the table. I have tried numerous things to create that binding but I can't seem to find the magic combination that works in any sensible way. Here is what I am currently doing, which seems to come closest. I set up a @State
1
0
726
Feb ’23