Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

View Layout on MacOS with Swift UI
Hi all, I have just started to learn swiftUI for macOS, and am struggling with the view set-up. The view below is the one I am trying to achieve. I had no issues with using navigation view to get the column style with View 1 and View 2&3, being able to stretch/resize each column as well. I have not however been able to make a stretchable 'row' view for View 2 and View 3. How can I achieve this? I tried using a Navigation Stack to wrap View 2 and View 3, which gave me the layout I want, though the 'rows' (being View 2 and View 3) are fixed, and can't be resized/dragged, like the columns of View 1 and View 2&3 can. How can I allow resizing between View 2 and View 3 as well, while preserving the overall layout show in the image? Thank you for the help :)
1
0
1.1k
Feb ’23
Reply to setTunnelNetworkSettings never gets executed
So the droid you’re looking for here is Developer Account Help > Reference > Supported capabilities (macOS). The rightmost column, confusingly labelled “Apple Developer”, lists the capabilities available to folks using free provisioning (a Personal Team in Xcode parlance). You’ll note that Network Extension is not listed there so, yes, you’ll need a developer account. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Feb ’23
SwiftUI LazyVGrid Positioning
Hello, I want to create a dashboard with LazyVGrid. I made a lineup like 2-2-1. It's okay as the images in the first 2 rows are the same, but I can't fit last image exactly because the bottom image is bigger than the others. I am attaching a screenshot for your better understanding. How can I center currency converter image overflowing from the screen? struct ContentView: View { let columns = [ GridItem(.fixed(150), spacing: 30), GridItem(.fixed(150), spacing: 30),] var body: some View { NavigationView{ LazyVGrid(columns: columns) { // WEIGHT * MASS NavigationLink(destination: UnitView()) { Image(systemName: scalemass) .font(.system(size: 60)) .padding() .frame(width: 150, height: 150, alignment: .center) .background(Rectangle().fill(Color.purple.opacity(0.5)) .shadow(radius: 3)).cornerRadius(20) .foregroundColor(.black) .overlay(Text(Weight) .foregroundColor(.black) .padding() .font(.system(size: 22)), alignment: .bottom )} //DISTANCE * NavigationLink(destination: DistanceView()) {
2
0
4.3k
Feb ’23
Why does "Xcode GPU Frame Capture" shows that "PreZ Test Fails" percent is zero.
Xcode GPU Frame Capture shows that PreZ Test Fails percent is zero. I can't understand what is wrong.. I drawed the opaque primitives with depth test, no alpha test, no alpha blend. I thought that Hidden Surface Removal removes hidden surfaces, so There is no killed fragments by PreZ Test Kill. But I couldn't find the column about Hidden Surface Removal. It looks that xcode gpu frame capture doesn't show the data about hidden surface removal. I tested it on iphone 13 mini(ios 16.3), M1 Mac Ventura
2
0
1.4k
Feb ’23
NavigationSplitView 2-column loses state when minimized on iPad
Hello! I've noticed that when I am using NavigationSplitView and I minimize the app on iPadOS and then resume, if I am using a 2 column setup it loses state upon resume. This does not appear to happen on with a 3 column setup though. I'm wondering if others have run into this and if anyone has figured out a way around it. It seems like it's a bug and I should file a bug for it, but wanted to check with more people first. Here's some example code, run it, select your number of columns, then minimize the app, count to 3 (because why not!) and open the app and you'll notice that $selection is now nil. import SwiftUI struct Item: Identifiable, Hashable { var id: Int var name: String var description: String } struct ContentView: View { @State var selection: Item? var items: [Item] = [ .init(id: 1, name: One, description: Is the loneliest number), .init(id: 2, name: Two, description: Two can be as bad as one), .init(id: 3, name: Three, description: Three Dog Night) ] var body: some View {
1
0
752
Feb ’23
Reply to How SwiftUI Table sorting works ?
Hi himav, for the follow up questions you had, clicking on the Family name column header would change the sortOrder array property to include the Comparator for that column (or reverse that Comparator if the sortOrder array already had one for that column). You could see the sortOrder binding as a representation of how different columns want to take part in sorting - and then you could sort the data accordingly. For custom Comparator on individual columns, you could use one of TableColumn's initializers that come with comparator as a parameter, and that custom comparator you provided will be included into sortOrder if you click on the corresponding column header. Hope this helps!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Reply to How SwiftUI Table sorting works ?
Still not completely clear to me. Lets say I click on Family name column, what happens next? Does the value of sortOrder variable change if I click on Family name column? If yes, what will be the new value? Also, how can I use custom Comparator for different columns?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Reply to How SwiftUI Table sorting works ?
Question 1 : I want to be able to sort by all the columns. How many KeyPathComparators should be in the sortOrder array? Surprisingly, a single comparator works for all columns . Question 2: What is the value of newOrder? Is it same as the sortOrder? What does it contain? You get the same behaviour with this: .onChange(of: sortOrder) { _ in people.sort(using: sortOrder) } . Question 3: sortOrder contains the comparator for only givenName. How does the above code able to provide sort functionality for all the columns? Same as question 1 ? I found this tutorial interesting. https://www.kodeco.com/books/macos-by-tutorials/v1.0/chapters/4-using-tables-custom-views And changed your code to make it work better (immediately change rows when tapping another column header) struct Person: Identifiable { let givenName: String let familyName: String let emailAddress: String let id = UUID() } private var people = [ Person(givenName: f1, familyName: Bob, emailAddress: xbob@ example.com),
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
How SwiftUI Table sorting works ?
Hello everyone, I am new to the Swift and the SwiftUI. Trying to understand how sorting works on SwiftUI Table view. The following code does what I intend to do, but I am not able to understand how does it actually work. Need help with the answers for the questions posted below the code. import SwiftUI struct Person: Identifiable { let givenName: String let familyName: String let emailAddress: String let id = UUID() } private var people = [ Person(givenName: f1, familyName: l1, emailAddress: e1@example.com), Person(givenName: f2, familyName: l2, emailAddress: e2@example.com), Person(givenName: f3, familyName: l3, emailAddress: e3@example.com) ] struct ContentView: View { @State private var selected = Set() // Question 1 @State private var sortOrder = [KeyPathComparator(Person.givenName)] var body: some View { Table(people, selection: $selected, sortOrder: $sortOrder) { TableColumn(Given name, value: .givenName) TableColumn(Family name, value: .familyName) TableColumn(Email, value: .emailAddress) } // Question
3
0
2.6k
Jan ’23
SecItem: Fundamentals
I regularly help developers with keychain problems, both here on DevForums and for my Day Job™ in DTS. Many of these problems are caused by a fundamental misunderstanding of how the keychain works. This post is my attempt to explain that. I wrote it primarily so that Future Quinn™ can direct folks here rather than explain everything from scratch (-: If you have questions or comments about any of this, put them in a new thread and apply the Security tag so that I see it. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com SecItem: Fundamentals or How I Learned to Stop Worrying and Love the SecItem API The SecItem API seems very simple. After all, it only has four function calls, how hard can it be? In reality, things are not that easy. Various factors contribute to making this API much trickier than it might seem at first glance. This post explains the fundamental underpinnings of the keychain. For information about specific issues, see its compa
0
0
4.3k
Jan ’23
WeatherKit REST API new columns for CurrentWeather
My pipeline broke today as new fields were added for the current weather dataset: cloudCoverLowAltPct cloudCoverMidAltPct cloudCoverHighAltPct I presumed new fields would only be released in a new version of the API? Is there any way to use a specific version of the API that will not be subject to change? The current weather REST API docs are here, which don't include these fields: https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata
6
0
1.4k
Jan ’23
SwiftUI NavigationSplitView Bug?
Hi All! I am working on a Multiplatform SwiftUI app and I've encountered an issue with NavigationSplitView. My app's ContentView is a NavigationSplitView sidebar and detail. The sidebar is a list with several NavigationLinks. (I haven't adopted programmatic navigation because of the simplicity this sidebar.) One of the NavigationLinks brings the user to a Table with several rows and columns. Then, when I go to select an item on the table, a row shows selected for a split second, before deselecting itself again. Then, I can use the table as normal. This happens every time the view is opened. The reason I think that this is an issue with NavigationSplitView is because when I use the legacy NavigationView, everything is fine. Is this normal behavior for NavigationSplitView, and if it is, how to I make it so that my table receives focus when the NavigationLink is open?
1
0
1.2k
Jan ’23
Reporter.jar: Download subscription offer code redemption data for specific date
Hello! I am looking to access data on how many times (on a specific day, week, or month) an alphanumeric subscription offer code has been redeemed (to track affiliate marketing). Right now, I am using the Reporter.jar tool like this: java -jar Reporter.jar p=Reporter.properties a=1234567 m=Robot.XML Sales.getReport 123456789, Subscription, Summary, Daily, 20230120, 1_3 As a result, a long list of subscription events is downloaded, however it is not clear which date a particular event did occur on. It seems like actually they pile up with every additional day. These are the columns that I can see: App Name, App Apple ID, Subscription Name, Subscription Apple ID, Subscription Group ID, Standard Subscription Duration, Subscription Offer Name, Promotional Offer ID, Customer Price, Customer Currency, Developer Proceeds, Proceeds Currency, Preserved Pricing, Proceeds Reason, Client, Device, State, Country, Active Standard Price Subscriptions, Active Free Trial Introductory Offer Subscriptions, Active Pay U
0
0
1.1k
Jan ’23