Search results for

column

2,061 results found

Post

Replies

Boosts

Views

Activity

View is not updating while app is running
Hi :-) I´m looking for some help and advice for my little project. Basically I have a Tabview with 3 Tabs. One of them is a View for Favorites. I managed the selection and the saving of the favorites. However, the View for the Favorites is not updating while the app is running. Just when the app is closed and restarted the View of Favorites gets updated. The Array of Favorites is marked with @Published, the variable in the Favorites-View is marked as @ObservedObject. I searched a lot and can't find my mistake. „Expression“ is a Struct with about 10 properties. Class for the Favorites: class Favorites: ObservableObject { @Published var favoriteExpressions: [Expression] = [] { didSet { print(Favorites changed) } } private let saveKey = FavoriteExpressions let defaults = UserDefaults.standard init() { if let data = defaults.data(forKey: saveKey) { let decoder = JSONDecoder() if let decoderSet = try? decoder.decode([Expression].self, from: data) { favoriteExpressions = decoderSet } } } func contains() -> Bool
2
0
1.1k
May ’23
Problem with NSTableView constraints
Hi, the problem is not dangerous to life, I don't want see the yellow button on top of the editor. 'Autoresizing Mask' is set to about 50 items, that works, except tableView, 10 warnings. The tableView has 10 columns of 20 pixels width, min 10 and max 100000. The ' Add new constraints' options are all grayed, so what ? In an other project a warning was set for arrayController, I don't like Auto Layout, the blue help lines are enough. My question is : How do i can suppress this warnings ? Kindly, Uwe
0
0
1.1k
Apr ’23
Swift - access attribute in array of core data entities in a table column via a variable
The below code works. I pass in an array of core data entities and display attributes in a table. In the second table column I use a switch case statement to handle the 3 possible attributes I want to display. I could eliminate the switch case if I could figure out how to access a given core data attribute via a variable that contains the specific attribute name but have been unable to determine how to do so. Two attempts are commented out in the code. struct DataTable: View { private var closingValues: Array var heading: String var attribute: String init(closingValues: [TradingDayPrices], heading: String, attribute: String) { self.closingValues = closingValues self.heading = heading self.attribute = attribute } var body: some View { Text(heading) .foregroundColor(.black) .font(Font.custom(Arial, size: 18)) .bold() .padding(.top, 10) Table(self.closingValues) { TableColumn(Date) { value in HStack { Spacer() Text(dateToStringFormatter.string(from: value.timeStamp!)) Spacer() } } .width(100) TableColum
1
0
883
Apr ’23
Selection state is lost when navigating to/from home screen
Hi! When using the Sample NavigationCookbook in the two column layout, the selection in the first column is not remembered, when navigating to the Home Screen and back. This behaviour can be reproduced by starting the app on the iPad or simulator, selecting for example Pancake and then navigating to the home screen and back into the navigation. Sometimes this (the navigation to/back from the home screen) has to be done twice, to lose the selection. In the console log you can see the message Update NavigationAuthority bound path tried to update multiple times per frame. appearing. Not sure if this has something todo with the selection being lost. This is on iOS 16.4.1 not sure if the behaviour before was different. Anybody experiences the same behaviour? Bug in SwiftUI or in the sample app? Cheers, Michael
2
0
948
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
0
0
711
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