Search results for

“column”

2,085 results found

Post

Replies

Boosts

Views

Activity

URGENT!
Hey guys, I'm having a huge problem and can't understand how to fix it. I was trying to recreate an Xcode app project with a Xcode Playground, now the point is that in Xcode Project on the side of the screen there are the options to add files. Like this: And in the Playground it is like this: But here, when I add the Swift Files under Shared Sources, and create the ContentView() in Main - Xcode Playground, it says me that it can't find the Helicopter, Pixel, Obstacle, so it can't find the Shared Recourses' files. Here's all the code. ContentView(Main): import SwiftUI import PlaygroundSupport struct ContentView: View { @State private var heliPosition = CGPoint(x:100, y: 100) @State private var obstPosition = CGPoint(x:1000, y: 300) @State private var isPaused = false @State private var score = 0 @State var timer = Timer.publish(every: 0.1, on: .main, in: .common).autoconnect() var body: some View { GeometryReader { geo in ZStack{ Helicopter() .position(self.heliPosition) .onReceive(self.timer) {_ in self.gravi
0
0
720
Apr ’23
Reply to NSTableView dragging source image
Hi Dragan, I was faced with the same issue, and came across your posting while searching for an approach. I want to drag whole-row images regardless of which column was targeted by the mouse. Building on techniques described at https://www.mail-archive.com/cocoa-dev%40lists.apple.com/msg108722.html (for some reason this web app won't let me format that as a link) and here, I came up with this: func tableView(_ tableView: NSTableView, draggingSession session: NSDraggingSession, willBeginAt screenPoint: NSPoint, forRowIndexes rowIndexes: IndexSet) { session.enumerateDraggingItems(options: .concurrent, for: nil, classes: [NSPasteboardItem.self], searchOptions: [:]) { (draggingItem, index, stop) in // Get the row index for this drag item. Could cheat and map `index` to `rowIndexes`, but this is cleaner. guard let pasteboardItem = draggingItem.item as? NSPasteboardItem, let rowIndex = pasteboardItem.propertyList(forType: com.example.RowIndexPasteboardType) as? Int else { stop.pointee = true return } // Co
Topic: UI Frameworks SubTopic: AppKit Tags:
Apr ’23
Reply to Conflicting arguments to generic parameter 'Content' on NavigationLink for @Binding var
import SwiftUI struct AfficherUneListe: View { @Binding var liste : Liste @Binding var showNavigationBar: Bool var body: some View { Spacer() Text(Les cartes) .font(.headline) ScrollView { LazyVGrid(columns: [GridItem(.adaptive(minimum: 100))], spacing: 5) { ForEach(liste.cartes) { c in NavigationLink(destination: ModifierUneCarte(carte: c)) { VStack { RoundedRectangle(cornerRadius: 10) .foregroundColor(.white) .shadow(radius: 3) .padding(5) // Ajouter un padding supplémentaire .overlay( VStack { Text(c.devant) .font(.system(size: 14)) Divider() Text(c.derriere) .font(.system(size: 14)) } ) } .frame(width: 100, height: 100) } } } } .navigationBarItems(trailing: HStack { Button(action: { // Code pour le premier bouton }) { Image(systemName: play) } Button(action: { // Code pour le deuxième bouton }) { Image(systemName: trash) } }) .navigationTitle(liste.nom) } } struct AfficherUneListe_Previews: PreviewProvider { static var previews: some View { let liste = Liste(nom: Liste 1, cartes: [ Carte(devant:
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’23
Conflicting arguments to generic parameter 'Content' on NavigationLink for @Binding var
Hi ! I am having a very strange problem. I display a list of elements, and I created a view that takes this element as a parameter in order to allow the user to modify it in another view. my var with a forEach : @Binding var liste : Liste my code : ScrollView { LazyVGrid(columns: [GridItem(.adaptive(minimum: 100))], spacing: 5) { ForEach(liste.cartes) { c in NavigationLink(destination: ModifierUneCarte(carte: c)) { VStack { Text(c.devant) .font(.system(size: 14)) Divider() Text(c.derriere) .font(.system(size: 14)) } } } } } and my ModifierUneCarte : struct ModifierUneCarte: View { [...] @Binding var carte: Carte [...] And I have this error on a lot of lines : Conflicting arguments to generic parameter 'Content' ('<>' vs. '<>' vs. '<>' vs. '<>') but it's because of : NavigationLink(destination: EditMap(map: c)) { because when I remove it everything works...
4
0
4.4k
Apr ’23
AppStoreConnect - Subscriber Report: refund issue
Hi everyone! Has anyone ever seen in their subscriber reports rows with the refund column at Yes and a positive value in the customer price column? Usually, what I have in this case is, a row at date D with refund column at Yes and a negative value in the customer price column and then in D+N a new row with refund column at Yes and a positive value in the customer price column, as if the refund was canceled. I don't understand what that means, so if anyone knows how to explain it I'm interested. -> Official documentation: https://developer.apple.com/help/app-store-connect/reference/subscriber-report Thanks, Marion
1
0
1k
Apr ’23
Reply to Tabular classification using Create ML Components
A tabular classifier will return both the classification probabilities and the most likely labels. If your target column name is target the predicted labels column is also going to be target while the probability distributions is going to be in targetProbabilities. You can always print the whole data frame with print(result) and see what the columns are. Hope this helps.
Apr ’23
Tabular classification using Create ML Components
I am working on a project that involves tabular classification using Create ML Components and I'm having trouble getting my model to work correctly. I've been following the official documentation here: https://developer.apple.com/documentation/createmlcomponents/ and also i have followed the wwdc talks. This one seems to be the most relevant one: https://developer.apple.com/wwdc22/10019 In that talk the construction of a tabular regressor is explained(20:23 Tabular regressor) . I tried using BoostedTreeClassifier similar to that. I am having trouble getting it to work though. While training with 5 featureColumns and one annotation columns appears to have worked. i am unsure how to get the label (the categorical value that the model is supposed to return) after calling .predict . This is the last bit of the example from apple (tabular regression) static func predict( type: String, region: String, volume: Double ) async throws -> Double { let model = try task.read(from: parametersURL) let dataFrame:
1
0
1.2k
Apr ’23
How to create price change programmatically?
I'm trying to change subscription prices programmatically and found two relevant API methods: Create price change List price points The first method requires ID of price point that can be retrieved by the second one. The second method returns price points in the following format: { type : appPricePoints, id : eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ, attributes : { customerPrice : 3.99, proceeds : 2.8 }, relationships : { equalizations : { links : { self : https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ/relationships/equalizations, related : https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ/equalizations } } }, links : { self : https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ } } where ID of price point is a base64-encoded JSON with three fields: s, t, and p. I got that Price Changes are pre-created by Apple and
0
0
448
Apr ’23
NavigationSplitView hide sidebar toggle button
I'm trying to implement the same UI used by the Settings app on iPad: a split view with two columns that are visible at all times. This code produces the layout i want, but I would like to hide the toggle sidebar visibility button that the system introduces. Is there a SwiftUI API I can use to hide this button? Maybe an alternate way to setup views that tells the system that the button is not necessary? struct SomeView: View { var body: some View { NavigationSplitView( columnVisibility: .constant(.all), sidebar: { Text(sidebar) }, detail: { Text(detail) } ) .navigationSplitViewStyle(.balanced) } }
7
0
8.4k
Apr ’23
Reply to SwiftUI LazyVGrid Positioning
Hi, I saw your question a few hours ago and I don't know if you are still looking for an answer at this time. Anyways, here is the solution with an explanation for anyone who might be interested in it. You have a LazyVGrid with two columns which is what you are seeing in the screenshot you've provided. UnitView(), TemperatureView() and CurrencyView() form the first column, whereas DistanceView() and TimeView() form the second column. Since you did not specify the alignment property, it assumed its default value, which is HorizontalAlignment.center in the case of LazyVGrid. If you specify alignment as HorizontalAlignment.leading, then the view would look somewhat like how you want it to look. But, it doesn't look good because the cards are not in the middle of the screen. To solve this, you would have to embed LazyVGrid into a LazyVStack, take the CurrencyView() out of the LazyVGrid, and place it outside LazyVGrid but within LazyVStack. struct ContentView: View { let columns
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’23
URGENT!
Hey guys, I'm having a huge problem and can't understand how to fix it. I was trying to recreate an Xcode app project with a Xcode Playground, now the point is that in Xcode Project on the side of the screen there are the options to add files. Like this: And in the Playground it is like this: But here, when I add the Swift Files under Shared Sources, and create the ContentView() in Main - Xcode Playground, it says me that it can't find the Helicopter, Pixel, Obstacle, so it can't find the Shared Recourses' files. Here's all the code. ContentView(Main): import SwiftUI import PlaygroundSupport struct ContentView: View { @State private var heliPosition = CGPoint(x:100, y: 100) @State private var obstPosition = CGPoint(x:1000, y: 300) @State private var isPaused = false @State private var score = 0 @State var timer = Timer.publish(every: 0.1, on: .main, in: .common).autoconnect() var body: some View { GeometryReader { geo in ZStack{ Helicopter() .position(self.heliPosition) .onReceive(self.timer) {_ in self.gravi
Replies
0
Boosts
0
Views
720
Activity
Apr ’23
Reply to NSTableView dragging source image
Hi Dragan, I was faced with the same issue, and came across your posting while searching for an approach. I want to drag whole-row images regardless of which column was targeted by the mouse. Building on techniques described at https://www.mail-archive.com/cocoa-dev%40lists.apple.com/msg108722.html (for some reason this web app won't let me format that as a link) and here, I came up with this: func tableView(_ tableView: NSTableView, draggingSession session: NSDraggingSession, willBeginAt screenPoint: NSPoint, forRowIndexes rowIndexes: IndexSet) { session.enumerateDraggingItems(options: .concurrent, for: nil, classes: [NSPasteboardItem.self], searchOptions: [:]) { (draggingItem, index, stop) in // Get the row index for this drag item. Could cheat and map `index` to `rowIndexes`, but this is cleaner. guard let pasteboardItem = draggingItem.item as? NSPasteboardItem, let rowIndex = pasteboardItem.propertyList(forType: com.example.RowIndexPasteboardType) as? Int else { stop.pointee = true return } // Co
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Conflicting arguments to generic parameter 'Content' on NavigationLink for @Binding var
J'ai modifié comme suit: ScrollView { LazyVGrid(columns: [GridItem(.adaptive(minimum: 100))], spacing: 5) { ForEach($liste.cartes) { $c in NavigationLink(destination: ModifierUneCarte(carte: $c)) { Dans le simulator: Note: le preview en revanche n'affiche pas la liste..
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Conflicting arguments to generic parameter 'Content' on NavigationLink for @Binding var
import SwiftUI struct AfficherUneListe: View { @Binding var liste : Liste @Binding var showNavigationBar: Bool var body: some View { Spacer() Text(Les cartes) .font(.headline) ScrollView { LazyVGrid(columns: [GridItem(.adaptive(minimum: 100))], spacing: 5) { ForEach(liste.cartes) { c in NavigationLink(destination: ModifierUneCarte(carte: c)) { VStack { RoundedRectangle(cornerRadius: 10) .foregroundColor(.white) .shadow(radius: 3) .padding(5) // Ajouter un padding supplémentaire .overlay( VStack { Text(c.devant) .font(.system(size: 14)) Divider() Text(c.derriere) .font(.system(size: 14)) } ) } .frame(width: 100, height: 100) } } } } .navigationBarItems(trailing: HStack { Button(action: { // Code pour le premier bouton }) { Image(systemName: play) } Button(action: { // Code pour le deuxième bouton }) { Image(systemName: trash) } }) .navigationTitle(liste.nom) } } struct AfficherUneListe_Previews: PreviewProvider { static var previews: some View { let liste = Liste(nom: Liste 1, cartes: [ Carte(devant:
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Conflicting arguments to generic parameter 'Content' on NavigationLink for @Binding var
Hi ! I am having a very strange problem. I display a list of elements, and I created a view that takes this element as a parameter in order to allow the user to modify it in another view. my var with a forEach : @Binding var liste : Liste my code : ScrollView { LazyVGrid(columns: [GridItem(.adaptive(minimum: 100))], spacing: 5) { ForEach(liste.cartes) { c in NavigationLink(destination: ModifierUneCarte(carte: c)) { VStack { Text(c.devant) .font(.system(size: 14)) Divider() Text(c.derriere) .font(.system(size: 14)) } } } } } and my ModifierUneCarte : struct ModifierUneCarte: View { [...] @Binding var carte: Carte [...] And I have this error on a lot of lines : Conflicting arguments to generic parameter 'Content' ('<>' vs. '<>' vs. '<>' vs. '<>') but it's because of : NavigationLink(destination: EditMap(map: c)) { because when I remove it everything works...
Replies
4
Boosts
0
Views
4.4k
Activity
Apr ’23
Reply to NO ANIMATIONS in NavigationStack or NavigationSplitView
If you are using NavigationSplitView without stacks, unfortunately, you'll need to use the same workaround above. Which effectively means shimming a NavigationStack as the root of the column in which you want the animations, and then structuring your NavigationLinks such that they aren't targeting the stack.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
AppStoreConnect - Subscriber Report: refund issue
Hi everyone! Has anyone ever seen in their subscriber reports rows with the refund column at Yes and a positive value in the customer price column? Usually, what I have in this case is, a row at date D with refund column at Yes and a negative value in the customer price column and then in D+N a new row with refund column at Yes and a positive value in the customer price column, as if the refund was canceled. I don't understand what that means, so if anyone knows how to explain it I'm interested. -> Official documentation: https://developer.apple.com/help/app-store-connect/reference/subscriber-report Thanks, Marion
Replies
1
Boosts
0
Views
1k
Activity
Apr ’23
Reply to Tabular classification using Create ML Components
A tabular classifier will return both the classification probabilities and the most likely labels. If your target column name is target the predicted labels column is also going to be target while the probability distributions is going to be in targetProbabilities. You can always print the whole data frame with print(result) and see what the columns are. Hope this helps.
Replies
Boosts
Views
Activity
Apr ’23
Tabular classification using Create ML Components
I am working on a project that involves tabular classification using Create ML Components and I'm having trouble getting my model to work correctly. I've been following the official documentation here: https://developer.apple.com/documentation/createmlcomponents/ and also i have followed the wwdc talks. This one seems to be the most relevant one: https://developer.apple.com/wwdc22/10019 In that talk the construction of a tabular regressor is explained(20:23 Tabular regressor) . I tried using BoostedTreeClassifier similar to that. I am having trouble getting it to work though. While training with 5 featureColumns and one annotation columns appears to have worked. i am unsure how to get the label (the categorical value that the model is supposed to return) after calling .predict . This is the last bit of the example from apple (tabular regression) static func predict( type: String, region: String, volume: Double ) async throws -> Double { let model = try task.read(from: parametersURL) let dataFrame:
Replies
1
Boosts
0
Views
1.2k
Activity
Apr ’23
How to create price change programmatically?
I'm trying to change subscription prices programmatically and found two relevant API methods: Create price change List price points The first method requires ID of price point that can be retrieved by the second one. The second method returns price points in the following format: { type : appPricePoints, id : eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ, attributes : { customerPrice : 3.99, proceeds : 2.8 }, relationships : { equalizations : { links : { self : https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ/relationships/equalizations, related : https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ/equalizations } } }, links : { self : https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ } } where ID of price point is a base64-encoded JSON with three fields: s, t, and p. I got that Price Changes are pre-created by Apple and
Replies
0
Boosts
0
Views
448
Activity
Apr ’23
NavigationSplitView hide sidebar toggle button
I'm trying to implement the same UI used by the Settings app on iPad: a split view with two columns that are visible at all times. This code produces the layout i want, but I would like to hide the toggle sidebar visibility button that the system introduces. Is there a SwiftUI API I can use to hide this button? Maybe an alternate way to setup views that tells the system that the button is not necessary? struct SomeView: View { var body: some View { NavigationSplitView( columnVisibility: .constant(.all), sidebar: { Text(sidebar) }, detail: { Text(detail) } ) .navigationSplitViewStyle(.balanced) } }
Replies
7
Boosts
0
Views
8.4k
Activity
Apr ’23
Reply to Best way to make a grid with both top and left headers
I’d like all columns to have the same size. (Without providing an explicit, fixed size.)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to SwiftUI LazyVGrid Positioning
Hi, I saw your question a few hours ago and I don't know if you are still looking for an answer at this time. Anyways, here is the solution with an explanation for anyone who might be interested in it. You have a LazyVGrid with two columns which is what you are seeing in the screenshot you've provided. UnitView(), TemperatureView() and CurrencyView() form the first column, whereas DistanceView() and TimeView() form the second column. Since you did not specify the alignment property, it assumed its default value, which is HorizontalAlignment.center in the case of LazyVGrid. If you specify alignment as HorizontalAlignment.leading, then the view would look somewhat like how you want it to look. But, it doesn't look good because the cards are not in the middle of the screen. To solve this, you would have to embed LazyVGrid into a LazyVStack, take the CurrencyView() out of the LazyVGrid, and place it outside LazyVGrid but within LazyVStack. struct ContentView: View { let columns
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Best way to make a grid with both top and left headers
Great, thank you @sha921 ! However, the first column will not have the same size as the others. Any way to do this?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Does SwiftUI have an equivalent of `UIAccessibilityContainerDataTableCell`?
I want to let voice over read row header, row column, I could implement it by UIAccessibilityContainerDataTableCell in UIKit, but I didn't find any equivalent in SwiftUI. Is there any other way I can work around this?
Replies
1
Boosts
0
Views
540
Activity
Apr ’23