We've seen an issue when using a LazyVGrid inside a List. The app crashes with: Thread 1: Fatal error: is stuck in a recursive layout loop When debugging the issue, we were able to narrow down the issue to a minimum reproducible example below: struct ContentView: View { let columns = [ GridItem(.adaptive(minimum: 43)) ] var body: some View { List { LazyVGrid(columns: columns) { ForEach(0..<15) { value in if value == 0 { Text(a) } else { Color.clear } } } } } } The issue can be reproduced on iPhone 15 Pro Max and iOS 18.x specifically. In a production app we have a similar layout, but instead of GridItem(.adaptive) we use GridItem(.flexible).
Search results for
column
2,071 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello. There seems to be a bug specifically in the iOS 18.2 (both Beta 1 and 2) and not seen in the previous versions. The bug is: when LazyVGrid is nested inside NavigationStack and some elements of the LazyVGrid have animations, navigating into any nested view and then going back to the initial view with the LazyVGrid causes all animations to stop working. Here is the example code inline: struct ContentView: View { @State private var count: Int = 0 var body: some View { NavigationStack { LazyVGrid( columns: Array( repeating: GridItem(spacing: 0), count: 1 ), alignment: .center, spacing: 0 ) { VStack { Text(String(count)) .font(.system(size: 100, weight: .black)) .contentTransition(.numericText()) .animation(.bouncy(duration: 1), value: count) Button(Increment) { count += 1 } NavigationLink(destination: { Text(Test) }, label: { Text(Navigate) }) } } } .padding() } } Once you run the application on iOS 18.2 Beta (I've tried on a real device only), the steps to reproduce are: Tap on the Increment butt
I'm trying to implement a 3 column NavigationSplitView in SwiftUI on macOS - very similar to Apple's own NavigationCookbook sample app - with the slight addition of multiple sections in the sidebar similar to how the Apple Music App has multiple sections in the sidebar. Note: This was easily possible using the deprecated NavigationLink(tag, selection, destination) API The most obvious approach is to simply do something like: NavigationSplitView(sidebar: { List { Section(Section1) { List(section1, selection: $selectedItem1) { item in NavigationLink(item.label, value: item) } } Section(Section2) { List(section2, selection: $selectedItem2) { item in NavigationLink(item.label, value: item) } } } }, content: { Text(Content View) }, detail: { Text(Detail View) }) But unfortunately, this doesn't work - it doesn't seem to properly iterate over all of the items in each List(data, selection: $selected) or the view is strangely cropped - it only shows 1 item. However if the 1 item is selected, then the appropri
the following documentation tells me that the CameraFrame.Sample.Parameters.extrinsics is of type simd_float4x4, great! https://developer.apple.com/documentation/arkit/cameraframe/sample/parameters/4443449-extrinsics I have read in the answer of another post that this extrinsics represents the pose of the physical camera relative to the device anchor. Did I understand correctly that the device anchor is where the scene is rendered from onto the user's display? What is the coordinate system in which this offset is defined, which axis is left, which one is up, which one is forward? The last column of the extrinsics seems to define a translation of approximately 2 cm along the x axis, -2cm along the y axis and -5 cm along the z axis. I tried to measure the physical distance between the main left and right cameras in order to find out if it's rather 2cm or 5 cm from the middle, it looks more like 5, so I assume that the z axis is looking towards the right (from the user's perspective). Is that so? For x
Normally uploading, processing and sending a TestFlight would take up to 30 minutes. But recently it slowed down to ~2 hours before the test app is actually send out to testers. Status updates from 'Processing' to 'Ready to Submit' still happens within 30 minutes, as usual. However nothing is send out to testers until 1-2 hours later. The 'Groups' column remains empty until the TestFlight is actually send. When trying to manually select a group the default 'Internal Group' is disabled. I guess because it knows it has to send to them and is busy trying to. Has anything changed in this process? And has anyone experienced the same or not? Useful either way.
So the complete code part1: struct ContentView: View { @State var text1: String = // <<-- Declare HERE ; could be an array of String @State private var tipa: [Double] = [] @State private var costa: [Double] = [] @State private var cost = @State private var costt: Double? = 0.0 @State private var paidt: Double? = 0.0 @State private var paid = @State private var tipp = @State private var tipc = @State private var tipaa = @State private var totalCost = @State private var totalTips = @State private var totalCash = @State private var tipcc = @State private var numbc = @State private var deletep = 0 @State private var number = 0 @State private var errorMsg = var body: some View { GeometryReader { g in NavigationStack { VStack { HStack { // No need to manually pad the date out with spaces, which will never be correct. // Just use an HStack and put a Spacer() in, so it goes: |<.....Spacer().....>Date| Spacer() Text(Date().formatted(date: .numeric, time: .omitted)) .foregroundStyle(Color.black)
Topic:
Developer Tools & Services
SubTopic:
Xcode
Okay, well, you went ahead anyway. Here's my update: // ContentView.swift import SwiftUI struct ContentView: View { @State private var tipa: [Double] = [] @State private var costa: [Double] = [] @State private var cost = @State private var costt: Double? = 0.0 @State private var paidt: Double? = 0.0 @State private var paid = @State private var tipp = @State private var tipc = @State private var tipaa = @State private var totalCost = @State private var totalTips = @State private var totalCash = @State private var tipcc = @State private var numbc = @State private var deletep = 0 @State private var number = 0 @State private var errorMsg = var body: some View { GeometryReader { g in NavigationStack { VStack { HStack { // No need to manually pad the date out with spaces, which will never be correct. // Just use an HStack and put a Spacer() in, so it goes: |<.....Spacer().....>Date| Spacer() Text(Date().formatted(date: .numeric, time: .omitted)) .foregroundStyle(Color.black) .fontWeight(.bold) .pad
Topic:
Developer Tools & Services
SubTopic:
Xcode
When I created the first scheme on CK, there was no problem, but once I try to modify the scheme, adding more tables and adding more columns to existing tables, I got the same error. In my case there were some tables created automatically, like Users and CDMR. I just had to add SORTABLE and QUERYABLE to CDMR And it solved the problem. I ended up adding to every single table just in case 😅 Indexes: createdTimestamp: QUERYABLE and SORTABLE 2.modifiedTimestamp: QUERYABLE and SORTABLE recordName: QUERYABLE and SORTABLE I have added the above to all tables
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags:
Hi, can someone help me, I can not find any button to accept this license agreement. I am Account Holder, and after clicking to account link, it redirects to my developer account. I accepted it in my developer account, but when I come back to Apple Store Connect, this agreement is still there, and no accept button for me in Action column.
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:
Hi @christiandevin It sounds like you want to convert a 2D point, on an image (of the left camera frame), to its corresponding location in 3D space. Before we discuss this, I want to bring your attention to a bug: The camera intrinsic matrix is row major instead of column major. I suspect this bug is the cause of the unexpected behavior @tsia observed. To account for this, look for the principal point and focal length at different positions in the intrinsic matrix (see snippet). Now let's turn to your goal. I'll refer to the 2D point on the image as the observation point. Using the camera intrinsic and extrinsic data with queryDeviceAnchor, you can convert the observation point to a 3D point (in world space) that represents the observation's location relative to the left camera's projection plane. That's not the same as its position in 3D space. Imagine seeing the world through a piece of glass (which represents the projection plane), the former is a point on that glass and the latter is the actual p
Topic:
Spatial Computing
SubTopic:
ARKit
Tags:
Look at your image and imagine there's a blue column immediately to the right of every red column. Now, the x-axis labels look like they're in the centre of the two columns. So, is your chart supposed to have two columns for each value? If not, in this line: AxisMarks(position: .automatic, values: shownXValues) { val in can position: .automatic be changed to something else? Also, is .useAppFont() a SwiftUI thing, or something you've written yourself? I've never seen it before.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
hi I am having a issue with sound on a network video stream, the stream is loaded by a m3u,. during playback there is no audio from the device, however when using headphones / airplay audio works correctly. the other peculiar thing is the device simulator works fine. this maybe related to airplay working, but I don't know. this is the view handling the playback. Im not sure where the issue is. I can also play the videos fine when embedding the avplayer in its own view. but that looks messy when you have to dismiss a second window when closing the video. #if os(iOS) import SwiftUI import AVKit import MediaPlayer struct iOSVideoLibraryView: View { @ObservedObject var videoLibrary: VideoLibrary @State private var isPlayerDismissed = false let LiveStreams = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())] let VODStreams = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())] var body: some View { NavigationView { ScrollView { LazyVGrid(columns:
My project loads a CSV into a DataFrame and displays it in a Table (a MacOS app). So far so good ... but when trying to update a value in a column, I dont see anyway to update this value. The table gets the value for the column like this: func getColumnValue(row :DataFrame.Rows.Element, columnName :String) -> String { if row.base.containsColumn(columnName) { var value = if row[columnName] != nil { value = (row[columnName]!) } return value } ... But the documentation and googles dont show any way to update the same column. Any help is appreciated with cookies. Attempt to update: func setColumnValue(row :DataFrame.Rows.Element, columnName :String, value :String) { var column: [String?] = data[columnName] column[row.id] = value ... }
Hi, I'm currently wrestling with the .chartXScale(domain:) modifier in order to get my Chart to display correctly. The basics of the Chart look like this. Chart(measurements, id: .timestamp) { measurement in if let total = measurement.production?.total { BarMark( x: .value( Timestamp, measurement.timestamp, unit: .weekOfYear, calendar: .current ), y: .value( Solar production, total ) ) } } As anyone familiar with Charts can see, I sort data into columns based on what week of the year the measurements belong to. Some of them can be null, and when they are, I still want space in the Chart where a BarMark would've been to be taken up, like week number 4 in this example chart (in which I've defaulted all measurements that are null in week 4 to 0, for demonstration purposes): To achieve that, as I understand, I'm meant to use the .chartXScale(domain:) modifier, but when I apply the following modifier... .chartXScale(domain: firstDayOfMonth...firstDayOfNextMonth) ... (where the domain is from the first day