Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

SwiftUI - Drag gesture blocks scroll gesture only on iPhone 11
I'm pretty new to Swift and SwiftUI. I'm making my first app for sorting a gallery with some extra features. I was using my own iPhone for testing and just started testing my app on other Apple products. Everything works fine on iPad Air M1, iPhone 15 Pro, iPhone 15 Pro Max, iPhone 13, iPhone XS (Simulator), and iPhone 11 Pro (Simulator). However, when I tried to show my app to a family member with an iPhone 11, I came across an issue. Issue Description: My app takes all photos from iPhone's native gallery, then you can sort it by some spesific filters and delete pictures. It just looks like the native gallery. (I can add photos later if needed) You can just scroll the gallery by swiping up and down. You can press the select button and start selecting pictures to delete. I recently added a drag-to-select-multiple-pictures feature. This makes it feel more like the native iOS experience, eliminating the need to tap each picture individually. However, on the iPhone 11, the moment you open the app, you can't scro
2
0
358
Jan ’25
NavigationSplitView detail view not updating
I have a NavigationSplitView with all three columns, and NavigationLinks in the sidebar to present different Lists for the content column. When a list item is selected in the content view, I want to present a view in the detail view. Since different detail views should be presented for different content views, I represent state like this (some details omitted for space): // Which detail view to show in the third column enum DetailViewKind: Equatable { case blank case localEnv(RegistryEntry) case package(SearchResult) } // Which link in the sidebar was tapped enum SidebarMenuItem: Int, Hashable, CaseIterable { case home case localEnvs case remoteEnvs case packageSearch } // Binds to a DetailViewKind, defines the activate SidebarMenuItem struct SidebarView: View { @State private var selectedMenuItem: SidebarMenuItem? @Binding var selectedDetailView: DetailViewKind var body: some View { VStack(alignment: .leading, spacing: 32) { SidebarHeaderView() Divider() // Creates the navigationLi
Topic: UI Frameworks SubTopic: SwiftUI
1
0
462
Jan ’25
Multi Section Sidebar using List with selections for macOS
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
3
0
603
Jan ’25
ARView.Environment.SceneUnderstanding.Options.occlusion not working on models that aren't opaque
Is this behaviour expected? For example, if I'm using let materials = [SimpleMaterial(color: .red, isMetallic: false)] occlusion works normally, but with let materials = [SimpleMaterial(color: .red.withAlphaComponent(0.5), isMetallic: false)] i can see my cube through real-world objects, like tables, columns, etc. I'm getting the same behaviour if using CustomMaterial from shader and applying customMaterial.blending = .opaque and customMaterial.blending = .transparent(opacity: ) respectively
0
0
522
Dec ’24
Reply to cannot find in scope
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)
Dec ’24
Reply to cannot find in scope
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
Dec ’24
Reply to Field recordName is not marked queryable
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
Dec ’24
ScrollView triggers (almost) endless View redrawing.
I am developing a MacOS app with a vertically oriented ScrollView. Inside that View I use a LazyVStack. In the LazyVStack I have a column of images. I want the images to occupy as much of the LazyVStack width as possible so I created a frame for the VStack with a maxWidth: .infinity. When the user grabs the edge of the window and drags it to reduce the window width, the Views of the window adjust themselves to fit the reduced space. This includes reducing the width of the images. I maintain a fixed aspect ratio for the images, so the height of the images is reduced too. My problem arises when the width of the images (and height) reduces to the point where the scroll bar is no longer needed because all of the images fit within the height of the ScrollView, and the ScrollView removes the scroll bar. That triggers a redraw of the images, with a slightly bigger size because the width used by the scroll bar is now available. When the the images get bigger they don't all fit within the height of the Scroll
1
0
290
Dec ’24
Create ML Trouble Loading CSV to Train Word Tagger With Commas in Training Data
I'm using Numbers to build a spreadsheet that I'm exporting as a CSV. I then import this file into Create ML to train a word tagger model. Everything has been working fine for all the models I've trained so far, but now I'm coming across a use case that has been breaking the import process: commas within the training data. This is a case that none of Apple's examples show. My project takes Navajo text that has been tokenized by syllables and labels the parts-of-speech. Case that works... Raw text: Naaltsoos yídéeshtah. Tokens column: Naal,tsoos, ,yí,déesh,tah,. Labels column: NObj,NObj,Space,Verb,Verb,VStem,Punct Case that breaks... Raw text: óola, béésh łigaii, tłʼoh naadą́ą́ʼ, wáin, akʼah, dóó á,shįįh Tokens column with tokenized text (commas quoted): óo,la,,, ,béésh, ,łi,gaii,,, ,tłʼoh, ,naa,dą́ą́ʼ,,, ,wáin,,, ,a,kʼah,,, ,dóó, ,á,shįįh (Create ML reports mismatched columns) Tokens column with tokenized text (commas escaped): óo,la,,, ,béésh, ,łi,gaii,,, ,tłʼoh,
6
0
824
Dec ’24
The iPhone set display and brightness to automatic, the App is placed in the dock column at the bottom of the desktop, and the icon showing the dark mode appears in the light mode. Is this a system problem?
The iPhone set display and brightness to automatic, the App is placed in the dock column at the bottom of the desktop, and the icon showing the dark mode appears in the light mode. Is this a system problem? device: iPhone 16 pro max system version: 18.2
0
0
292
Dec ’24
Reply to GeometryReader problem
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:
Dec ’24
LazyVGrid inside a List Crashes on iPhone 15 Pro Max (iOS 18.x) Simulator
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).
3
0
581
Dec ’24
Reply to Create Anchor on Objects from 2D Data
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:
Dec ’24
Reply to SwiftUI charts, how do I align these X axis labels correctly?
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:
Dec ’24