Search results for

column

2,061 results found

Post

Replies

Boosts

Views

Activity

No place to update license agreement
When I login to my Dev account, I get a banner that says The updated Apple Developer Program License Agreement needs to be reviewed. In order to update your existing apps and submit new apps to the App Store, the Account Holder must review and accept the updated agreement. However, when I go to Agreements, Tax, and Banking, I see both Free Apps and Paid Apps agreement, but when I click on View, there's nothing for me to accept. It's a pop-up window with a list of countries and a button at the end that says Close. And that's it. No other action is possible. No other option either under the Action column.
1
0
619
Jul ’24
Photos Picker Selection
Hi! I am having a bit of trouble with the Photos Picker. In my app, users are able to select photos to appear in a grid, right in the app. I am using the new Photos Picker with SwiftUI. I want to be able to have my users select the images after they have been added to the View. So I want there to be a select button in the top toolbar on the leading side, and then once the user hits the select button, they can select the photos they want to remove on the grid, just like in the photos app, and then where the button to add photos originally is, there will be a trash icon to remove the selected photos from the grid. How would I do this? I have attached my code below for my view, as well as my PhotoPicker: import PhotosUI struct LifestyleImagePicker: View { @StateObject var imagePicker = ImagePicker() @State private var showingDetail = false @State private var selectedIndex = 0 @State private var isSelecting = false @State private var isAddingPhoto = false let columns = [GridItem(.adaptive(minimum: 100))]
1
0
1k
Jul ’24
iPadOS 18 TabView / NavigationSplitView title
I have a TabView with individual tabs containing NavigationSplitViews. On iPadOS 18, when moving the new UI into a sidebar, the title of the first column in the current split view randomly spins its way in and out of view. Is this just a beta bug, or am I doing something wrong? Hard to convey without a recording, but hopefully the screenshots will show what I mean. Thanks.
1
0
690
Jul ’24
Reply to -34018 A required entitlement isn't present. from command line swift program and more
[quote='795793022, alfred_eisenberg, /thread/759481?answerId=795793022#795793022, /profile/alfred_eisenberg'] I am trying to create/manage identities. [/quote] Thanks for confirming that. [quote='795793022, alfred_eisenberg, /thread/759481?answerId=795793022#795793022, /profile/alfred_eisenberg'] it seems that certs in this keychain aren't visible with the keychain access app or apparently security find-certificate [/quote] Yep. Both of those are a common source of confusion, which I call out in the User interface section of TN3137. I usually work around this by adding a small test UI to my app that lets me do keychain-related stuff, like dump all the items in my keychain access group, delete those items, and so on. In terms of how you handle multiple certificates for the same key, the trick here is to work in ‘identity space’. If there are multiple certificates for the same key, you’ll get an identity for each one. It’s trivial to get the certificate and key from each identity (SecIdentityCopyCertificate and
Topic: Privacy & Security SubTopic: General Tags:
Jul ’24
Really High Energy Use
I'm developing an app where users can select items to add to a screen, similar to creating a Canva presentation or choosing blocks in Minecraft. However, I'm encountering an issue with energy usage. When users click the arrows to browse different items, the energy use spikes significantly. Although it returns to normal after a while, continuous clicking causes the energy use to skyrocket. The images I'm using are 500x500 pixels. Ideally, I would like to avoid caching all the images, as the app might have up to 500 items and caching them all would consume too much memory. I have tried numerous way to avoid this but I just can’t seem to make it work. Would anyone know how to avoid such problem? I have included a picture of the energy use when just opened, and one after like 10 seconds of continuously clicking on an arrow to see more items. Also a picture of how the app looks. struct ContentView: View { struct babyBackground { var littleImage = } @State var firstSet: [babyBackground] = [ babyBackground(littleIm
1
0
786
Jul ’24
SwiftUI: View is not rendered properly
Problem: When clicking on an item, it will be (un-)completed. When it's completed then ChildView should show GroupsView. However, that's not the case. The logs are like this: init, group Fruits - items not completed false - showItems false body, group Fruits - items not completed false - showItems true init, group Fruits - items not completed false - showItems false init, group Fruits - items not completed false - showItems false import SwiftUI import SwiftData @main struct MainApp: App { var body: some Scene { WindowGroup { SomeView() } .modelContainer(appContainer) } } struct SomeView: View { @Query private var items: [AItem] var body: some View { ParentView(items: items) } } struct ParentView: View { private var groupedItems: [GroupedAItems] = [] init(items: [AItem]) { Dictionary(grouping: items) { $0.categoryName } .forEach { let groupedItems = GroupedAItems(categoryName: $0.key, items: $0.value) self.groupedItems.append(groupedItems) } } var body: some View { ScrollView { VStack(spacing: 15) { ForEach(gr
1
0
482
Jul ’24
Reply to SwiftUI view is not updated properly
Working code snippet: import SwiftUI import SwiftData @main struct MainApp: App { var body: some Scene { WindowGroup { SomeView() } .modelContainer(appContainer) } } struct SomeView: View { @Query private var items: [AItem] var body: some View { ParentView(items: items) } } struct ParentView: View { private var groupedItems: [GroupedAItems] = [] init(items: [AItem]) { Dictionary(grouping: items) { $0.categoryName } .forEach { let groupedItems = GroupedAItems(categoryName: $0.key, items: $0.value) self.groupedItems.append(groupedItems) } } var body: some View { ScrollView { VStack(spacing: 15) { ForEach(groupedItems, id: .self.categoryName) { groupedItems in ChildView(groupedItems) } } } } } struct ChildView: View { public var groupedItems: GroupedAItems @State private var showItems: Bool init(_ groupedItems: GroupedAItems) { self.groupedItems = groupedItems self._showItems = State(initialValue: !groupedItems.completed) print(init, group (groupedItems.categoryName) - items not completed (!groupedItems.complete
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Peculiar EXC_BAD_ACCESS, involving sparse matrices
Helo all, Currently, I'm working on an iOS app that performs measurement and shows the results to the user in a graph. I use a Savitzky-Golay filter to filter out noise, so that the graph is nice and smooth. However, the code that calculates the Savitzky-Golay coefficients using sparse matrices crashes sometimes, throwing an EXC_BAD_ACCESS. I tried to find out what the problem is by turning on Address Sanitizer and Thread Sanitizer, but, for some reason, the bad access exception isn't thrown when either of these is on. What else could I try to trace back the problem? Thanks in advance, CaS To reproduce the error, run the following: import SwiftUI import Accelerate struct ContentView: View { var body: some View { VStack { Button(Try, action: test) } .padding() } func test() { for windowLength in 3...100 { let coeffs = SavitzkyGolay.coefficients(windowLength: windowLength, polynomialOrder: 2) print(coeffs) } } } class SavitzkyGolay { static func coefficients(windowLength: Int, polynomialOrder: Int, derivativeOr
11
0
1.4k
Jul ’24
Reply to SwiftUI List OutlineGroup
@JMDelh Have you considered using a two-column navigation split view instead? The selection works but the detail view is updated only when I click the text but not when I click the rest of the row. This results in the detail view not being sync with the list selection. Apply the contentShape(_:eoFill:) and set the maxWidth of to infinity Text((item.description)) .frame(maxWidth: .infinity) .contentShape(Rectangle())
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
How to animate NavigationSplitView's detailView column.
Having a traditional 'NavigationSplitView' setup, I am looking for a way to animate it the same as the sidebarView, where there is a button to toggle and it animates by sliding out from the right side of the view, however the closest I have gotten was manipulating the 'navigationSplitViewColumnWidth' but that always results in the view instantly appearing / disappearing. I am using SwiftUI for a MacOS specific app. Here is just a general idea of what I am currently doing, it is by no means a reflection of my real code but serves the purpose of this example. struct ContentView: View { @State private var columnWidth: CGFloat = 300 var body: some View { NavigationSplitView { List { NavigationLink(destination: DetailView(item: Item 1)) { Text(Item 1) } NavigationLink(destination: DetailView(item: Item 2)) { Text(Item 2) } NavigationLink(destination: DetailView(item: Item 3)) { Text(Item 3) } } .navigationTitle(Items) } detail: { VStack { DetailView(item: Select an item) Button(action: toggleColumnWidth) { Text(co
1
0
913
Jul ’24
tabView in Vstack in Scrollview
I'm creating a view which is scrollable and has Vstack which include tabView what I'm facing that when I added the TabView in Vstack , it's vanished unless I specify the height for the TabView and when I specify the height of the tabview any lazy view inside it , it loose it's laziness because I already specify the height which means it render all it's content in advance . BTW I have to use tabview because I need the paging effect : here's the full code ScrollView{ LazyVStack{ Text(hello) TabView(selection: $selectedIndex){ LazyVGrid(columns: columns2) { ForEach(myItems.indices, id: .self) { item in Color.green .frame(height: 150) .overlay { Text((item.description)) .foregroundStyle(Color.black) .font(.largeTitle) } } .tag(0) } }.frame(minHeight: 100) // if I removed this line the tabview will disappear // and if I specify a big number the lazyVgrid is no longer lazy } }
1
0
1.1k
Dec ’23
Reply to Peculiar EXC_BAD_ACCESS, involving sparse matrices
the sparseMatrix function with comments: extension Array where Element == [Double] { // A sparse matrix is a mattrix where all zero's are ommitted. // Normal matrix: Sparse matrix: // 0 1 0 1 // 1 3 0 1 3 // 4 0 2 4 2 // Find the sparse matrix of this matrix. Returns an array of doubles containing the values of the sparse matrix (omitting all zero's) and a SparseMatrixStructure containing information about where the columns start and where the rows start. The values array of the sparse matrix above would be [1, 4, 1, 3, 2]. func sparseMatrix() -> (structure: SparseMatrixStructure, values: [Double]) { let columns = self.transpose() // Get the row indices of the matrix. The row indices of the sparse matrix above would be // [1, 2 column 0 // 0, 1, column 1 // 2] column 2 var rowIndices: [Int32] = columns.map { column in column.indices.compactMap { indexInColumn in if column[indexInColumn] != 0 { return Int32(indexInColumn) } return nil } }.reduce
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’24
Reply to Peculiar EXC_BAD_ACCESS, involving sparse matrices
The SavitzkyGolay class with comments: class SavitzkyGolay { static func coefficients(windowLength: Int, polynomialOrder: Int, derivativeOrder: Int = 0, delta: Int = 1) -> [Double] { // windowLength is the number of coefficients returned by this function. guard windowLength > 0 else { fatalError(windowLength must be positive) } // polynomialOrder is the order of the polynomial used to smooth the noisy data (the coefficients are calculated independently from the noisy data) guard polynomialOrder < windowLength else { fatalError(polynomialOrder must be less than windowLength) } // The derivativeOrder is the order of the derivative to compute. If it is set to zero, the noisy data is smoothed without differentiating. guard derivativeOrder <= polynomialOrder else { return [Double](repeating: 0, count: windowLength) } let (halfWindow, remainder) = windowLength.quotientAndRemainder(dividingBy: 2) var pos = Double(halfWindow) // pos should not be a round number (because otherwise this function won't work
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’24
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
Jun ’24