Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

tvOS Context Menu on LazyVGrid is selecting item below.
Context menu on tvOS LazyVGrid selecting wrong item. It works fine if selecting items on last row. Testing on code from https://developer.apple.com/videos/play/wwdc2024/10207/ I just added contextMenu LazyVGrid(columns: columns, spacing: 40) { ForEach(sortedMatchingAssets) { asset in Button {} label: { asset.landscapeImage .resizable() .aspectRatio(16 / 9, contentMode: .fit) .contextMenu { Button(Test) {} } Text(asset.title) } .buttonStyle(.borderless) } } Attached video with the bug - https://www.icloud.com/iclouddrive/020zq2PxZ_E_1Pr0vE86-8aww#Screen_Recording_2024-06-13_at_9.26.15%E2%80%AFPM
2
0
618
Jun ’24
How to implement multiple selection types in NavigationSplitView?
In the sidebar column of the NavigationSplitView I'd like to have several sections. All the items are fetched with Core Data. View all photos (Photos entity in Core Data) Folder (Folder entity in Core Data) Folder A Folder B Folder C Tags (Tag entity in Core Data) Cat Dog In the content view, I'd like show the items based on the selection in the sidebar. I tried the following with some success but I think there should be another way of doing this. NavigationSplitView() { List(selection: $navigationModel.selectedCategory, content: { NavigationLink(value: Category(type: .all, predicate: NSPredicate(value: true), title: View all items) ) { Text(View all items) } Section { ForEach(folders){ folder in NavigationLink(value: Category(type: .folder, predicate: NSPredicate(format: folder == %@, folder), title: folder.name) ) { FolderRow(folder: folder) // ... and so on. Another section for tags And in the content: ZStack{ List(selection: $navigationModel.selectedPhoto) { ContentView(photos: FetchRequest( sort
2
0
1.1k
Jun ’24
How to: Compositional layout with self-sizing rows of N columns where the height of each item is set to the tallest item in its row
Paging Steve Breen! 😄 I've seen this question asked a zillion times but I've never seen an answer. Is it possible to configure compositional layout to give you a grid of N columns (say 2 or 3) where each item in each row/group self-size their height, but the heights of those items are then set to be the height of the tallest item in their row. This is easy to do if you ignore the self-sizing requirement (just use a fixed or absolute item height), but on the surface this doesn't even appear to be possible if you require self-sizing. What I've Tried Configuring a layout where the items are set to a fractional height of 1.0 and their group is set to an estimated height (ex: 100). I was hoping compositional layout would interpret this as, Please self-size the height of the group and make each item 100% of that height. Unfortunately, compositional layout just uses the estimate you provide for the height as the actual height and no self-sizing occurs at all. Sad panda. 🐼 Use visibleItemsInvalidationHandl
Topic: UI Frameworks SubTopic: UIKit Tags:
4
0
5.5k
Jun ’24
Xcode - Sqlite versions
In Xcode (Mac OS Catalina), when trying to create an application to access a database, I receive syntax errors, resulting from the installed version of SQlite (below 3.30) does not allowing generation of virtual columns. After updating to 3.46 the version installed on system, this does not occur if I execute such queries directly in SQlite, via Terminal. How do I get Xcode to access and use the system updated version ? Thanks in advance
2
0
753
May ’24
Reply to App primary language doesn't appears in Appstore
Xcode creates one .lproj folder for each localization when compiling your String Catalog, so you can still check the existence of en.lproj by looking into your app bundle. Note that Xcode creates the .lproj folder only when the localization contains at least one localized string. As an example, if you select your String Catalog in Xcode, and see that the strings under the Enlgish (en) column are all gray, Xcode won't create en.lproj for you. So be sure that you add at least one localized string (which will then be shown in black) for your English localization. Best, —— Ziqiao Chen  Worldwide Developer Relation.
May ’24
Magnification gesture to scale ScrollView's content.
Hello! I am trying out new SwiftUI and I have to say that I love it, but I've got some problems implementing few features. First issue is that I am not sure how can I scale content of ScrollView, to make content of that View smaller, but there would be more subviews visible. Here's my code: @State private var scale: CGFloat = 1.0 var body: some View { ScrollView([.horizontal]) { HStack(alignment: .top) { ForEach(0..<5, id: .self) { _ in ScrollView(.vertical) { LazyVGrid(columns: [GridItem(.fixed(300), spacing: 10)], spacing: 10) { ForEach(0..<5, id: .self) { _ in Rectangle() .frame(width: 300, height: 300, alignment: .center) } } } .padding(.leading, 10) } } .scaleEffect(scale) } .gesture( MagnificationGesture() .onChanged { value in scale = value.magnitude }) } } If You paste that code to a project, You will see that app scales whole ScrollView, not its content. And when we're talking about gestures, I would really appreciate if someone would share here how can I prioritize the gestures. Thank
2
0
2.6k
Nov ’21
App sandbox extension revoked on Ventura
Hi everyone, first-time caller, long-ti... wait, no, I just got here. :) I am relatively new to all things Apple, so apologies in advance if it takes me a few goes to properly explain things. We have a framework, which includes an API, an XPC service, etc, and we have a device driver. We also have some sample apps that use the framework, and if they have the app sandbox capability, then we expect them to use the XPC Service instead of accessing our driver directly. This works fine on Monterey and presumably has worked fine on all previous versions of MacOS. Something seems to have changed on Ventura, and we don't understand what. When we build the same app on Ventura, it appears to be in the sandbox (according to the Sandbox column in Activity Monitor), but in the Console there is this line (twice): default Revoking sandbox extension; key = 0 Which we suspect is linked to the fact that the app then does not use the XPC Service, and instead accesses the driver directly, much to our surprise. Softwar
6
0
1k
May ’24
MACMAIL V10 is considered as an absolute nightmare - need to find a way to revert mail client to V3 in all future updates
Almost everyone I know absolutely HATES the macmail V10 update in big sur. So many conveniences and ease of operation that were available in 10.11.16 are gone. The icons are greyed out, the column layout is abysmal, the search engine does not function, way too many additional steps are now required to do the same job the V3 did with ease.. The standard question I hear is WHY would apple change what worked perfectly for so many and make a great mail system user unfriendly? There is an old adage that I keep hearing repeated If it ain't broke - don't fix it! The question I keep hearing is can anyone figure out a way to remove V10 from big sure and revert the mail system back to V3? There should be either an option or a way to revert the mail system back to what is loved by so many, without affecting the integrity of the security changes needed in big sur to make it safer.
1
0
717
May ’24
SwiftUI Toolbar inconsistent behavior on MacOS
Overview I'm facing an issue where the MacOS Toolbar shows overall inconsistent behavior when switching from 3 columns to 2 columns NavigationSplitViews. I'd like to know if this is somehow expected or possible fixes for this issue. Details I'm using the code available at this WWDC22 session to reproduce the issue: https://developer.apple.com/documentation/swiftui/bringing_robust_navigation_structure_to_your_swiftui_app This same inconsistent behavior is also appearing on another project. Steps to reproduce: Open the application and select the 3 columns option Select any item on the sidebar. Notice how the toolbar is displayed. There is no divider and the primary action placement on the far-right of the Toolbar. Click on it and select now 2 columns. Notice how the toolbar is displayed. Now the primary action is no longer on the far right of the toolbar, but on the right of what would be the content view. Besides that, a divider is now appearing. Click again on the wand and
1
0
372
Dec ’23
Swift Data value is duplicated between two variables in a class
I'm using two loops, one nested in another to create and assign a subclass to the parent class. I'm using x for one loop and y for the other loop. Print statement shows the loop variables being updated correctly, however the subclass has both variables as the same value. I'm not sure if the value is being stored as the same value or being displayed as the same value. I've checked both creation and display code. I can't find the error. var body: some View { NavigationSplitView { List { ForEach(routes) { item in NavigationLink { Text(Route: (item.route_name) nSeason: (item.route_season)nCoordinates: (item.route_coordinates)nProcessed: (String(item.route_processed))nNumber of baseboards: (item.route_baseboards.count)) } label: { Text(item.route_name) } //end route nav link } //end route for each .onDelete(perform: deleteItems) //end route nav ForEach(baseboards) { item in NavigationLink { //if let test = item.baseboard_heightPoints.count { Text(Grid Size: (String(item.baseboard_grid_size))nRow:(String(item.baseb
3
0
1.1k
May ’24
Lazyvgrid visual promblems after orientation change
I'm having issues with a Lazyvgrid displaying images after the screen orientation changes ( either from horizontal to portrait, or the reverse ) What happens is the images are not sized correctly. If 2 column , I see 1/3 of column 1 and the image in column 2 takes 2/3 of the screen width. Similar issues with 3 or 6 column layout. The Lazyvgrid is inside a ScrollView and thats inside a Tabview. I'v tried to trick an update by changing the column layout, the content mode (fit/fill) of the images, etc. but so far nothing has worked. Any suggestions ?, anyway to invalidate a lazyvgrid and have swiftui rebuild it ? Thanks.
1
0
581
May ’24
log stream command does not yield any events
We are having some trouble getting log stream to output events in real time from coreaudiod while we are in a zoom call or listening to audio. Repro steps: Open a Terminal window and execute log stream --predicate process=='coreaudiod' Create a zoom call, join it, stay for 10 seconds, leave the meeting Expected: audio events should show in log stream Terminal window Actual: no audio event shows Also, if after this test I execute log show --last 5m process=='coreaudiod' the events are showing; that is proof that coreaudiod actually emitted those events; Does anybody have any idea what could cause this? This happens on Sonoma 14.2.1, on an MBP M2 Max with 64GB memory. What we have looked at already: actually log stream does not show events from a lot of other procs on the machine; executing log stream --timeout 10s --style json | jq .[] | jq .processImagePath | sort | uniq -ic | sort --reverse yields only 3 sources (counts in the first column): 205 /kernel 10 /System/Library/CoreServices/ManagedClien
3
0
1.1k
Feb ’24
NavigationLinks to "Details" page do not work after data changes
I'm running into this error, when the underlying SwiftData object changes (gets an object added to it): * A NavigationLink is presenting a value of type “Project” 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. * For instance, when I first fire up the simulator, clicking on any existing project correctly takes me to its details page. However, as soon as I add a new project or delete a project, none of the navigation links work any more. If I reload the simulator, they all work again! Makes me suspect it's an error with not recomputing the links when the underlying data change, but I can't figure out what I need to change, as everything looks correct. Any help would be appreciated! ContentView: struct ContentView: View { @Environment(.modelContext) var modelContext @Query(sort: Project.endDate) var
1
0
406
May ’24
Shopping cart count disappears after changing tabs
On my shop and content views of my app, I have a shopping cart SF symbol that I've modified with a conditional to show the number of items in the cart if the number of items is above zero. However, whenever I change tabs and back again, that icon disappears even though there should be an item in the cart. I have a video of the error, but I have no idea how to post it. Here is some of the code, let me know if you need to see more of it: CartManager.swift import Foundation import SwiftUI @Observable class CartManager { /*private(set)*/ var products: [Product] = [] private(set) var total: Int = 0 private(set) var numberofproducts: Int = 0 func count() -> Int { numberofproducts = products.count return numberofproducts } func addToCart(product: Product) { products.append(product) total += product.price numberofproducts = products.count } func removeFromCart(product: Product) { products = products.filter { $0.id != product.id } total -= product.price numberofproducts = products.count } } ShopPage.swift import Sw
4
0
1.1k
May ’24