I am currently trying to build a NavigationManager with programmatic navigation. For that I'm using the NavigationPath combined with NavigationDestination. Sadly facing the following issue: navigationDestionation is not being recognised when located in sheet. Im receiving the following message when trying to update the path of the NavigationStack within the sheet. A NavigationLink is presenting a value of type “PathType” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated. Note: Links search for destinations in any surrounding NavigationStack, then within the same column of a NavigationSplitView. Here is some simplified code snipped of the implementation. struct RootView: View { @State private var isPresented: Bool = true var body: some View { Button(Open Modal, action: { self.isPresented.toggle() }) .sheet(isPresented: self.$isPresented, content: { ModalContent() }) } } private struct ModalContent: View { @State private var p
Search results for
column
2,061 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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:
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:
Hello everyone, I have encountered a very strange issue with my SwiftUI code, and I'm hoping you can help me resolve it. Let me explain in more detail how my code works. In my main view (ContentView), I have a navigation bar (AppBarView) that can collapse and expand based on the scroll position of the page. I also use a TabView to display different views depending on the user's selection. The problem arises when the navigation bar is expanded, and I scroll back up the page. My ScrollView behaves erratically, causing a shaking effect with an overlapping of the navigation bar and the ScrollView. To better understand the issue, please watch this video: https://www.youtube.com/shorts/LF0ZfwtiiNI After conducting several searches, I have identified that the following line is causing the issue: .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never)) Without this line, everything works fine, but I lose the desired visual effect provided by PageTabViewStyle. This is where I'm stuck because I don't understand why th
That’s not possible. If you’re working with a Personal Team, you should bookmark this page. The rightmost column [1] shows capabilities available to a Personal Team. As you can see, NFC isn’t listed there, which means it isn’t available to you. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] Somewhat confusingly labelled Apple Developer.
Topic:
Code Signing
SubTopic:
Entitlements
Tags:
LazyVGrid(columns: items, spacing: 2, content: { ForEach(searchingText.isEmpty ? [] : viewModel.filteredPosts(searchingText)) { post in NavigationLink( destination: Postview(viewModel2: PostViewModel(post: post)) .onAppear{ currentListener = Firestore.firestore().collection(posts).document(post.postId).addSnapshotListener { snapshot, err in guard let index = self.viewModel.filteredPosts(searchingText).firstIndex(where: { $0.id == post.id }) else { return } if let doc = try? snapshot?.data(as: Post.self) { self.viewModel.filteredPosts(searchingText)[index].liked = doc.liked } } } ,label: { Text(See likes) }) } }) func filteredPosts(_ query: String) -> [Post] { let lowercasedQuery2 = query.lowercased() return posts.filter({ $0.caption.lowercased().contains(lowercasedQuery2) }) } I am getting : Cannot assign to property: function call returns immutable value error in this part: self.vm2.filteredPosts(searchingText2)[index].liked = doc.liked. Any idea how I can solve it? My goal is to add a snapshot l
Another issue: If --count is set to 1 as result of round: --count: calc(round(down, calc(sqrt(var(--images))), 1) + 1); grid-template-columns: repeat(var(--count), 1fr); grid-template-columns: 1fr; isn’t the same (in Safari)! The first line results in 2 columns, not in one! Looks like the same reason. Because grid-template-columns: repeat(calc(var(--count) -0.01), 1fr); gives one column.
Topic:
Safari & Web
SubTopic:
General
Tags:
I'm working on a calculator app but I'm having trouble displaying the results of a function. When I press a button in ButtonView, a function runs to calculate the result but that result does not display in CalculationCircleView. Main View: struct ScoreCalculatorView: View { @StateObject private var viewModel = ViewModel() var body: some View { VStack { Spacer() HStack { CalculationCircleView(calculation: viewModel.grossScore, label: Score) Spacer() CalculationCircleView(calculation: viewModel.plusMinus, label: +/-) } .padding(.horizontal, 30) Spacer() LazyVGrid(columns: viewModel.columns, spacing: 20) { ForEach(0..<4, id: .self) { index in ZStack { DataCellsView(labels: viewModel.scoreLabels[index]) TextField((viewModel.scoreLabels[index]), text: $viewModel.scoreData[index]) .font(.largeTitle) .fontWeight(.light) .frame(maxWidth: 80) .multilineTextAlignment(.center) .keyboardType(.numberPad) } } } .frame(width: 250) Spacer() ButtonView(data: viewModel.scoreData) .padding(.bottom, 20) } } } Calcula
since 14.3 update I'm missing the type and value column in the Project->Target->%target%->Info view. I only can see the key column. I've already reinstalled Xcode multiple times and restarted my MacBook Pro. Here the screenshot from the new created project: I can add new properties, but I can't change the value. Has anyone some idea, what I can do to fix this problem? Btw: my workmate with similar MacBook Pro setup can change all the values.
I have a csv file with values ranges between 0-1. When converted this csv values to MLMultiArray and then to UIImage it shows grey image. But the image is actually coloured. So is there any step missing or do I have to perform any more action to get this image to be coloured. Sample csv values - [0.556862745 0.62745098 0.811764706] Code func parseCSV(data: String) -> [Float] { var finalArray = [Float]() var rows = data.components(separatedBy: n) for row in rows { let columns = row.components(separatedBy: ,) if columns.count == 3 { let r = columns[0] let g = columns[1] var b = columns[2] if b.contains(r){ b = b.replacingOccurrences(of: r, with: ) } finalArray.append(Float(r)!) finalArray.append(Float(g)!) finalArray.append(Float(b)!) } } return finalArray } let m = try MLMultiArray(shape: [1, 768, 512, 3], dataType: .double) for (index, element) in data.enumerated() { m[index] = NSNumber(value: element) } let model: ModelInput = { do { let config = MLModelConfiguration()
It seems that zstack still has some issues when recalculating multiple layers with lots of views inside it. I consider that overly a floating view on zstack, this view was not calculated by zstack, I copied the code of floating view from here, and the following is the code modified from your version: import SwiftUI struct TMainWnd: View { @State var strings: [String] = [A, B, C, D, E] @State var ints: [Int] = Array(1...300) @State var selectedInt: Int? @State var isShow = false var body: some View { ZStack { ScrollView { VStack { ForEach(strings, id: .self) { string in VStack { HStack { Text(string) Spacer() } LazyVGrid(columns: [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())]) { ForEach(ints, id: .self) { int in VStack { Text(String(int)) Spacer() } .frame( maxWidth: .infinity ) .frame(height: 200) .background( RoundedRectangle(cornerRadius: 5) .fill(int % 2 == 0 ? .orange : .green) ) .onTapGesture { self.selectedInt = int } } } } } } .padding() } }.floatingView(above: TFloating
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
ah. thanks for the video, I wasn't scrolling far enough but I couldn't tell where I was. I modified your code so it is easier to see what cell you're at. I couldn't reproduce it with an array of only 30, or even 100 Ints. But with 150 (as below), I can press on C14 and the scroll position will jump so that I'm looking at E14. Your code doesn't modify the scroll position, so this looks like a bug to me. struct ContentView: View { let strings: [String] = [A, B, C, D, E] let ints: [Int] = Array(1...150) @State var selectedCell: String? var body: some View { ZStack { ScrollView { VStack { ForEach(strings, id: .self) { string in VStack { HStack { Text(string) Spacer() } LazyVGrid(columns: [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())]) { ForEach(ints, id: .self) { int in VStack { Text(string + String(int)) Spacer() } .frame(minWidth: 0, maxWidth: .infinity) .frame(height: 200) .background( RoundedRectangle(cornerRadius: 5) .fill(int % 2 == 0 ? .orange : .green) ) .onTapGesture { sel
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Can you share a code example that replicates the issue here? We're tracking similar bugs, but your callout of an explicit stack in the detail column is a configuration we haven't yet seen this issue with.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Hi everyone, I'm having a hard time figuring out why the code below results in weird behaviour with the ScrollView. Code : struct MainView: View { @State var strings: [String] = [A, B, C, D, E] @State var ints: [Int] = Array(1...300) @State var selectedInt: Int? var body: some View { ZStack { ScrollView { VStack { ForEach(strings, id: .self) { string in VStack { HStack { Text(string) Spacer() } LazyVGrid(columns: [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())]) { ForEach(ints, id: .self) { int in VStack { Text(String(int)) Spacer() } .frame(minWidth: 0, maxWidth: .infinity) .frame(height: 200) .background( RoundedRectangle(cornerRadius: 5) .fill(int % 2 == 0 ? .orange : .green) ) .onTapGesture { self.selectedInt = int } } } } } } .padding() } if let selectedInt { VStack { Spacer() Text(String(selectedInt)) Spacer() Button { self.selectedInt = nil } label: { Image(systemName: x.circle) .resizable() .scaledToFit() .frame(width: 30) } } .frame(minWidth: 0, maxWidth: .infinity, minH
I'm using a two column NavigationSplitView, where the view passed for the detail column is the root of a NavigationStack. The navigation works as expected, but the navigationTitle and toolbar elements of the detail view are very slightly delayed when the view appears on iOS, such that they 'pop' in rather than smoothly animating like normal. Returning to the root of the view from views higher in this stack animates as expected. Has anyone seen anything like this before? Thanks!