I have a SwiftUI Table on iPadOS that supports multiple selection and contains rows representing documents that can be opened. I want to be able to select multiple rows from edit mode or with keyboard modifiers for batch operations, but a regular tap on a single item should open it and push it onto the navigation stack. Rows are highlighted when I tap on them, but the table's selection isn't modified and I can't figure out how to respond to that action. There's nowhere for me to put a NavigationLink because I'm only providing views for each column and not for the row itself. I could also push onto the navigation stack manually if I could respond to the action, but I don't see any API for doing so. I've tried using .onChange(of: selection) and checking that the selection only contains a single element, but single taps on rows don't modify the selection, and even if they did, this logic would trigger incorrectly when adding the first item to the selection in edit mode for example. Is there something I'
Post not yet marked as solved
@jason Thank you for answer. The code I worked on is an internal service, so I cannot disclose it, but Similarly, I worked on codesandbox. This issue appears in webviews. https://codesandbox.io/s/still-rain-gx5b4h It is plain html and css coding, and the problematic part is the red area. main { position: relative; display: flex; flex-direction: column; align-items: center; } It is the state that flex is given to the main tag, and the child has the position property. I don't know if the css specific attribute is unstable in safari or the main tag attribute itself is the problem. In particular, only in safari (including the latest version) intermittently the area with the red border takes up space, and the elements (including children) are not rendered on the screen. like css visibility: hidden; It had the same effect as the reference. And when I scrolled, the above phenomenon suddenly disappeared. the suspicious part Safari flex, position properties ruin the layout The image of the .button1 class is n
Post not yet marked as solved
And here is the working solution for tvOS 15: struct ContentView: View { @FocusState var focusedItem: String? @State var items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] let columns: [GridItem] = Array(repeating: .init(.flexible()), count: 4) var body: some View { ScrollView() { LazyVGrid(columns: columns) { ForEach(items, id: .self) { item in Button { } label: { ItemView(title: item) } .focused($focusedItem, equals: item) .onMoveCommand { moveCommandDirection in guard let index = items.firstIndex(where: {$0 == item}) else { return } if moveCommandDirection == .down, index >= items.count - columns.count { focusedItem = items.last } } .padding(.bottom, 8) } } } } } If you have any workaround for tvOS 14 I'll be appreciated it.
Post not yet marked as solved
Yes, seems like since you wrap up HStack to ScrollView prefersDefaultFocus won't work correctly after that. I have a similar issue and can't get it to work for tvOS 14. Nevertheless, it works well with iOS 15 using @FocusState. So if you don't need tvOS 14 support you can use that approach. Here are my observations of the issue. What I try to achieve is set focus on the last item(10) if you press down on items 7 or 8. If I'm not wrapping up LazyVGrid into ScrollView everything works as expected. But as soon as I wrap up LazyVGrid into ScrollView when I press the down button on those items it always gets focused on the first item. Here is my code example and screenshot. struct ContentView: View { @Namespace var focusNamespace @Environment(.resetFocus) var resetFocus @State private var defaultFocusIndex: Int = 0 @State var items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] let columns: [GridItem] = Array(repeating: .init(.flexible()), count: 4) var body: some View { ScrollView() { LazyVGrid(columns: columns
Post not yet marked as solved
Dear Support, I'm unable to push a build to TestFlight. This is using Xamarin.Forms as the build creator. I'm getting the error I have pasted below. Please advise how to resolve. Thank you, Joshua Lowenthal Dear Developer, We identified one or more issues with a recent delivery for your app, WoundMatrix Patient 1.57 (13). Please correct the following issues, then upload again. ITMS-90338: Non-public API usage - The app references non-public selectors in WoundMatrixHC.iOS: accumulatorPrecisionOption, alignCorners, assetForIdentifier:, attackTime, batchStart, bytesPerImage, calibrationMode, checkFocusGroupTreeForEnvironment:, classesLossDescriptor, clipRect, colorTransform, columns, commissioningComplete:, computeStatistics, confidenceLossDescriptor, curveType, deactivate, determineAppInstallationAttributionWithCompletionHandler:, encodeToCommandBuffer:sourceTexture:destinationTexture:, envelope, first, forward, frontFacingWinding, gradientForWeights, initWithBuffer:offset:, initWithCoder:device:, init
Post not yet marked as solved
For context: I'm working on a score pad app, with the ability to have a column of PKCanvases, so you can just hand write things without them being scribbled into text. As part of my stress testing, I basically filled the grid with ~50 canvases, and it seems that after a certain amount of CanvasViews are added to the score pad, my M1 iPad Pro GPU is unable to keep up. Occasionally, a cell will just entirely render as magenta, and I will have dozens and dozens of Execution of the command buffer was aborted due to an error during execution. Insufficient Memory (IOAF code 8) logs thrown to the console. I honestly don't know where to go from here. I recognize that what I'm doing is almost definitely not what PencilKit was designed for, but I also know the API is relatively young. I can't tell if this is a bug that should be fixed by Apple, or entirely my fault and a sign that I need to redo the entire thing. I've attached a screenshot with the magenta cell, there's also another two cells where the pencil
Post not yet marked as solved
CapturedRoom.Surface has a transform simd_float4x4 and a dimensions simd_float3. The wall length is the dimensions.x and the position can be extracted from the transform with extension matrix_float4x4 { var position:SCNVector3 { return SCNVector3(columns.3.x, columns.3.y, columns.3.z) } } The Euler angles for the wall can be extracted using extension float4x4 { var eulerAngles: simd_float3 { simd_float3( x: asin(-self[2][1]), y: atan2(self[2][0], self[2][2]), z: atan2(self[0][1], self[1][1]) ) } }
Post not yet marked as solved
Conditional views in columns of NavigationSplitView fail to update on some state changes. (91311311) Workaround: Wrap the contents of the column in a ZStack. See iOS & iPadOS 16 Beta 3 Release Notes
Post not yet marked as solved
Context I have a problem with the new SwiftUI SideBar / NavigationLink concept. I have created a simple 2 Column NavigationSplitView with a SideBar and a DetailView. Once the App is launched, the preselected Timeline RootView appears as the DetailView. However, when I select a different SideBar Item, the DetailView does not change accordingly. Code struct SideBar: View { @State private var navigationItem: NavigationItem? = .timeline var body: some View { NavigationSplitView { List(NavigationItem.allCases, id: .self, selection: $navigationItem) { navigationItem in NavigationLink(value: navigationItem) { Label(navigationItem.name, systemImage: navigationItem.symbol) } } } detail: { if let safeNavigationItem = navigationItem { safeNavigationItem.rootView } else { Text(String(localized: select.an.option, defaultValue: Select an Option)) } } } } Question Do you have any idea how I can solve this issue? Thanks a lot for your support in advance. Note: Just ran it on macOS, it is working there. However, stil
I have a SwiftUI view which contains an NSTableView wrapped with an NSViewControllerRepresentable struct. This has a Coordinator, which I set up as the NSTableView's delegate. There is an implementation of tableViewSelectionDidChange to pass the selected row index up to the enclosing view. The problem is that I can click and select a row, but the selection disappears, usually on the first click, and always when clicking a column header to sort. I have looked at the various delegate methods for notifying about selection changing, and they don't seem to be called. How can I find where the selection is being changed?
I'm working on several apps that were developed on Xcode 12.5. Using Xcode 13.1, I set a breakpoint, which correctly appears as the blue marker in the left-hand column of the editor. When I run the apps (in a simulator), the breakpoint turns to an outline of a breakpoint marker, with a dotted blue outline and a white interior. The apps do not stop at the breakpoint. Breakpoints work as expected on an app started in Xcode 13.1. I've dug through the docs but find nothing that describes what the outline breakpoint means or how to make it work. I've done all the standard stuff: cleaned the build folder, deleted derived data. What does the outline breakpoint marker mean, and how do I get breakpoints working in Xcode 13.1 when debugging code developed originally on Xcode 12.5? Thanks in advance for any help. John
Post not yet marked as solved
To anyone who finds this I realized my problem is that you have to go underneath the applications 'build settings' and then you have to go to 'packaging' Go underneath the column that has your application name and double click which reveals a white box. Finally you copy the info.plist path and put it inside the white box and you are done. *Note https://developer.apple.com/forums/thread/125768 is where I learned the whole process from so if there are any further questions, refer to this link.
Post not yet marked as solved
`import Cocoa import TabularData let greeting = Decimal Type Evaluation let JSON = [{ product: Apple, type: Fruit, weight: 7.5, unit_price: 0.34 }, { product: Pear, type: Fruit, weight: 0.5, unit_price: 0.25 }] struct Product: Decodable { let product: String let type: String let weight: Double let unit_price: Double } let jsonData = JSON.data(using: .utf8)! let products: [Product] = try! JSONDecoder().decode([Product].self, from: jsonData) var dataframe = try! DataFrame(jsonData: jsonData) print (dataframe)` This results in the output below showing the columns are now ordered alphabetically and not in the order they appear in the array struct definition. ┏━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓ ┃ ┃ product ┃ type ┃ unit_price ┃ weight ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┡━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩ │ 0 │ Apple │ Fruit │ 0.34 │ 7.5 │ │ 1 │ Pear │ Fruit │ 0.25 │ 0.5 │ └───┴──────────┴──────────┴────────────┴──────────┘ 2 rows, 4 columns
Post not yet marked as solved
I'm trying to create a custom Quick Look preview on macOS. I've found the Quick Look Preview Extension target, which is brilliant, and does most of the 'heavy' lifting, but I've run into a few problems. I'm implementing a preview for MIDI files (which has been missing since 2009...) using AVMIDIPlayer. The player keeps playing when the file is no longer selected! What's the mechanism for fixing that? Some sort of check that the view exists..? I notice that the OS preview for audio files has a different interface for the Finder's preview column and for the QuickLook 'pop-up' window. Again, I can't see how you define different views for those two environments. Is there any documentation that's specifically Mac? I can only find iOS stuff. (Same for third-party tutorials.)
Post not yet marked as solved
I can also reproduce this issue, but only when using Xcode under Rosetta. In this case, building and running an iOS app from Xcode builds an Intel (x86) binary of the app and runs it using Rosetta on the simulator. You can verify this in the “Activity Monitor” app, which will show Intel in the Kind column for the simulated iOS app process. With this configuration, swipe gestures are not working in my app running on the Simulator. When disabling Rosetta for Xcode using the Finder’s info window, restarting Xcode, and building and running the iOS app again, Activity Monitor will show Apple (i.e. arm64 architecture) for the simulated iOS app process, and swipe gestures work as expected. (Note that swipe gestures also work fine in the Messages app on the simulator, where you can swipe left on a conversation for revealing the mute and delete swipe actions.) Mac mini M1 2020, macOS 12.4 (21F79), Xcode 13.4.1 (13F100), Simulator 13.4.1 (977.2), SimulatorKit 618, CoreSimulator 802.6.1