Hello Everyone, This is my first post as i'm a beginner in swifUI and in coding. I hope I will be clear enough. I'm working on a app that can allow me to find easily information about a factory. I have a list of factories where columns are mostly geographic information about the factory and numbers. I have sorted my list by categories where my variable is state number - state name in String. in each category I have a list of factory located in this state. I have a view (UsineRow) with selected detail from the factory, a view (UsineListe) displaying the list of all the factory's selected detail and another view with all details of the factory (reachable by clicking on one factory from the UsineListe view. Now I need a view where I will be able to display my categories and after that the list of factories inside my categories. For the moment, I have a view with all my categories and between directly the list of my factory selected details. ForEach(modelData.categories.keys.sorted(), id: .self) { key in
Search results for
column
2,071 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi guys, please help me with sqlite database. When I save the data in the table, it always saves the wrong data in the columns. They don't match the submitted data at all. I don't know where I am making a mistake. Thank you! DatabaseManager ViewController
I've commented out much of the code and reduced the table to one column. With approx 1000 items in the table it takes about 900 msec to change the selected item. Measurment is between the time I click on the item and the UI is ready to process the next click. Instruments shows: every time I select an item the foreach loop runs for every row in the table. That accounts for about 200 msec. the remaining portion of the hang is in SwiftUI code. None of my instrumented code is called. I don't know what SwiftUI is doing, but it is doing it slowly.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Hi, I'm trying to create a response for a review through the Apple Store Connect API, but I receive the following error message when sending the body following this documentation: https://developer.apple.com/documentation/appstoreconnectapi/create_or_update_a_response_to_a_customer_review cURL Request --header 'Authorization: {{MY_BEARER_TOKEN}}' --header 'Content-Type: application/json' --data '{ attributes: { responseBody: {{MY_RESPONSE}} }, relationships: { review: { data: { id: {{REVIEW_ID}}, type: customerReviews } } }, type: customerReviewResponses }' *I changed the cURL to not display real data, but they are filled in my request. Error message: errors: [ { id: 5575b9ef-9005-4db2-9a89-123b1aaa9355, status: 422, code: ENTITY_UNPROCESSABLE, title: The request entity is not a valid request document object, detail: Unexpected or invalid value at 'attributes'., meta: { position: { row: 2, column: 20 } } } ] } Can you help me put together the body correctly if that's the case of the error?
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect API
Tags:
App Store Connect API
Hello. My project includes a widget target that provides interactive widget functionalities. The document Adding Interactivity to Widgets and Live Activities says the following: Additionally, note that the perform() function is marked as throws. Be sure to handle errors instead of rethrowing them, and update your app, widget, and Live Activity as needed. For example, update a widget’s interface to indicate that it displays outdated information if it cannot load new data. https://developer.apple.com/documentation/widgetkit/adding-interactivity-to-widgets-and-live-activities#Implement-the-perform-function, column 3 However, I couldn't find a way how to handle an error in an interactive widget. The Button(intent:) and Toggle(intent:) initializers don't have mechanisms for error handling. Does anyone know a solution for handling errors in interactive widgets?
This is something I've been struggling with for some time. The hierarchy of my app makes this harder to diagnose. But like you, it was working fine for years. In my case, this app supported three column-layouts prior to the release of column-based split views. In order to do so, we have a concept of a NestedSplitViewController -- which is a UIViewController that owns a UISplitView. We're running into the same issue with Xcode 15 – and can't seem to pin it down.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
I have two models that are have a weird interaction: @Model public final class Position: Equatable, Identifiable { var zone: ZoneModel? @Relationship(deleteRule: .cascade, inverse: Item.positions) var items = [Item]() var name: String = var weight: Int = 0 var weightAllowed: Int = 0 init(name: String, weightAllowed: Int) { self.name = name self.weightAllowed = weightAllowed } } @Model public final class Item: Equatable, Identifiable { var form: FormModel? var positions: [Position]() var count: Int = 0 var weight: Int = 0 init() {} } There are many other tables that are all connected, but these are the ones where the problems arise. The PositionModel is able to properly store and persist the items: [ItemModel] variable, but the ItemModel runs into a problem after the app closes. I am getting this error in my SQL Stack Trace no such column: t1.Z_6POSITIONS in SELECT 0, t0.Z_PK FROM Z_5POSITIONS t1 JOIN ZPOSITION t0 ON t0.Z_PK = t1.Z_6POSITIONS WHERE t1.Z_5ITEMS = ? When looking at my sqlite database
just posted a bug to Apple Developer Feedback...this is still an issue in iPadOS 17 App is using a UISplitViewController with the new column style init. Both primary and secondary child view controllers are subclasses of UITableViewController (yes, I need to move to CollectionViewController ASAP)... This bug occurs when I am in landscape and select iPadOS Split View by tapping on the 3 dots menu on top of the screen. As my app slides to the left, this Xcode console occurs. The backtrace from the symbolic break point indicates there are NO calls in my code in the back trace. This is an apple UIKit bug! Workaround for overriding layouSubviews likely to work... here's the backtrace... (lldb) bt thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1 frame #0: 0x00000001942cd8dc UIKitCore`UITableViewAlertForLayoutOutsideViewHierarchy frame #1: 0x0000000193579fd0 UIKitCore`-[UITableView _updateVisibleCellsNow:] + 208 frame #2: 0x0000000193579e34 UIKitCore`-[UITableView layoutSubviews] + 1
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
I have a main app window that presents an Immersive style in Mixed Reality. I am trying to determine the anchor/position of this glass window in the 3D space and place a Sphere entity right next to it. The goal is to ensure that if the user moves the window, the Sphere entity remains attached to it. Does anyone have insights on how to achieve this? The below code snippet provides the position of the device, and I have positioned it 0.5 meters away from the z-axis. However, my objective is to obtain the position of the glass window and anchor the sphere to it. Any guidance on achieving this would be appreciated. import RealityKit import RealityKitContent import ARKit struct ImmersiveView: View { let visionProPose = VisionProPose() var body: some View { RealityView { content in Task { await visionProPose.runArSession() } // Add the initial RealityKit content if let scene = try? await Entity(named: Immersive, in: realityKitContentBundle) { content.add(scene) } } update: { content in if let scene = content.entiti
Thanks @Starfia, this appears to be a bug. Thanks very much for confirming that – at least it quiets my indecision about how to proceed. That advice just gives me a Content View that conforms to the detail column's resizable area, though, so I don't think it gives me the fixed-sizedness I'm looking for. The closest I've been able to come has been to hard-code the frame of the Navigation Split View itself, but that involves knowing the combined height of all views I might add to the detail column at all times (alongside which the unwanted safe area propagation persists), so it's a whole undertaking. I think for this iteration, I just have to avoid using NavigationSplitView or the Inspector; I have to implement alternatives to those provided functionalities, but the layout issues disappear the moment I sidestep them.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
A fascinating update. I've tried adding the newly-introduced Inspector modifier, which I also intended to use in the app I'm making: import SwiftUI @main struct TestApp: App { @State var isShowingInspector: Bool = true var body: some Scene { WindowGroup { NavigationSplitView( sidebar: { }, detail: { ContentView() } ) .inspector(isPresented: self.$isShowingInspector) { } } .windowResizability(.contentSize) .windowToolbarStyle(.unified(showsTitle: false)) } } struct ContentView: View { let complaint = What's with the vertical space around me when I'm in a detail column? var body: some View { VStack(spacing: 0) { Text(complaint) .font(.title) .ignoresSafeArea() .frame(width: 300, height: 300) .background(.blue) } } } This time, SwiftUI apparently adds entire toolbar's height to the minimum height of the window again! Now the detail column's mysterious vertical space equals twice the height of the toolbar: It doesn't seem to matter whether the Inspector is applied to the Navigation Split Vie
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Hi, colleagues: I've spent days trying to understand this little SwiftUI layout problem, and I've made a minimal test app to explain it. It's based on a Content View of a fixed size. import SwiftUI @main struct TestApp: App { var body: some Scene { WindowGroup { ContentView() } .windowResizability(.contentSize) .windowToolbarStyle(.unified(showsTitle: false)) } } struct ContentView: View { let complaint = What's with the vertical space around me when I'm in a detail column? var body: some View { Text(complaint) .font(.title) .frame(width: 300, height: 300) .background(.blue) } } And here's the result. As expected, the Content View is hugged nicely by the window: My goal is to place a fixed-size view like this in the detail column of a Navigation Split View. So I update the scene's root view: import SwiftUI @main struct TestApp: App { var body: some Scene { WindowGroup { NavigationSplitView( sidebar: { }, detail: { ContentView() } ) } .windowResizability(.contentSize) .windowToolbarStyle(
So is there a way to add a Network Extensions capability to an iOS app without joining the Apple Developer Program? No. The go-to reference for this is Developer Account Help > Reference > Supported capabilities (iOS). The rightmost column in the table lists the thing you can do with a free account (aka a Personal Team). Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic:
App & System Services
SubTopic:
Core OS
Tags:
I was following the tutorial video to implement arrow key navigation on a LazyVGrid. (starting at 18:50: https://developer.apple.com/videos/play/wwdc2023/10162/?time=1130) In the code tab there is a full code sample but it omits the part where the MoveCommandDirection actually determines what the next grid items to select is. private func selectRecipe( _ direction: MoveCommandDirection, layoutDirection: LayoutDirection ) { // ... } Considering that the LazyVGrid actually uses an adaptive layout, what is the correct way to determine the GridItem above or below the current selected GridItem? this is the full example the tutorial provides: struct ContentView: View { @State private var recipes = Recipe.examples @State private var selection: Recipe.ID = Recipe.examples.first!.id @Environment(.layoutDirection) private var layoutDirection var body: some View { LazyVGrid(columns: columns) { ForEach(recipes) { recipe in RecipeTile(recipe: recipe, isSelected: recipe.id == selection) .id(recipe.id) #if
Hello everyone, I've been trying to improve the performance of a grid view that I've made for an app. Basically, it's like one of those sensory boards and there are circles that, when dragged over, change color and play a little haptic feedback. However, I want the grid to span the entire screen and so by increasing the dimensions of the grid to say, 30x30, I am noticing significant performance decreases. CPU usage increases to 99% and the haptic feedback and animation slow down. I've narrowed down the problem to the drag gesture (not the haptics). Just the drag gesture makes the CPU usage approach 40%. The part where I verify if the drag location is within the bounds of any of the circles increase the CPU though. This is like O(n) but with like 900 grid points doesn't sound like it should be that bad? Is there any way that I can improve the code performance? I've tried putting each row of the grid into a Group and also tried switching to UIKit and using CAReplicatorLayers to construct the grid but ran into a