Post

Replies

Boosts

Views

Activity

Reply to Can't typing on NSTextField
Could you try to remove updateSuggestionMenu() showSuggestionMenu() override func textDidChange(_ notification: Notification) { super.textDidChange(notification) print("Still typing") // updateSuggestionMenu() // showSuggestionMenu() } If the problem disappear, you should reset focus after updateSuggestionMenu() showSuggestionMenu()
Topic: UI Frameworks SubTopic: AppKit Tags:
Jun ’24
Reply to loaded array from plist. call using AppDelegate() returns empty array.
Could you show your complete AppDelegate code ? There is probably a problem here: let typesArray = AppDelegate().typesArray you create a new instance of AppDelegate (as AppDelegate() is a call to init to create a new instance), which itself has an empty typesArray as long as loadTypesArray has not been called. Hence let typesArray = returns empty array. If typesArray is declared as static in AppDelegate, then you can call in loadTypesArray: AppDelegate.typesArray = plist // Need to refer to class because of static Elsewhere: let typesArray = AppDelegate.typesArray // No ()
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’24
Reply to Creating a navigation link within a chart?
I have not tried it, so I can't say if it works in your case. You could try to use chartOverlay as described in doc, and use it to get in a State var where you tapped and then move to the view according to this known tap point.: Chart(data) { LineMark( x: .value("date", $0.date), y: .value("price", $0.price) ) } .chartOverlay { proxy in GeometryReader { geometry in Rectangle().fill(.clear).contentShape(Rectangle()) .gesture( DragGesture() .onChanged { value in // Convert the gesture location to the coordinate space of the plot area. let origin = geometry[proxy.plotAreaFrame].origin let location = CGPoint( x: value.location.x - origin.x, y: value.location.y - origin.y ) // Get the x (date) and y (price) value from the location. let (date, price) = proxy.value(at: location, as: (Date, Double).self) print("Location: \(date), \(price)") } ) } } Another tutorial here: https://swiftwithmajid.com/2023/02/06/mastering-charts-in-swiftui-interactions/ Hope that can help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to How to take back the control of our application ?
You need to receive the complete folder that contains Xcode project, not only the source files (otherwise, you'll have a significant work to rebuild the project). The process should be: unzip the zip file (just double click on the icon) check that you get a folder containing a file such as MyProject.xcodeproj and a folder named MyProject (of course, you'll a name different than MyProject in both) have xCode installed on your Mac then double clicking on MyProject.xcodeproj will open the project in Xcode. From there you can start modifying code and generate new spa file.
Jun ’24
Reply to SwiftUI does not manage two NavigationLinks in a single list row
I may have found a simple solution. Problem comes from List which manages interactions with rows on its own, creating the mess. I just replaced List by a ScrollView, to get very similar display (except the ">" after button, but works OK for each link. No need either for buttonStyle. struct ContentView: View { var body: some View { NavigationView { // List { ScrollView { ForEach(0..<10) { index in HStack { Spacer() NavigationLink(destination: DestinationView1(item: index)) { Text("Navigate to View 1") .padding() .background(Color.blue) .foregroundColor(.white) .cornerRadius(8) } // .buttonStyle(PlainButtonStyle()) // Not needed Spacer() NavigationLink(destination: DestinationView2(item: index)) { Text("Navigate to View 2") .padding() .background(Color.green) .foregroundColor(.white) .cornerRadius(8) } // .buttonStyle(PlainButtonStyle()) // Not needed Spacer() } .padding(.vertical, 5) } } .navigationBarTitle("Navigation Links") } } } struct DestinationView1: View { var item: Int var body: some View { Text("Destination View 1 for item \(item)") .navigationBarTitle("View 1", displayMode: .inline) } } struct DestinationView2: View { var item: Int var body: some View { Text("Destination View 2 for item \(item)") .navigationBarTitle("View 2", displayMode: .inline) } }
Jun ’24
Reply to SwiftUI Picker Label
Picker label does not show except in some conditions. You have to find a work around to display the label independently. Get details here: https://stackoverflow.com/questions/69381385/swiftui-custom-picker-label-not-rendering
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to How to restore windows to correct space and minimized state on launch?
What I usually do is save the position and size in UserDefaults, then read it at opening and set the frame accordingly. I gave details in this old thread. https://forums.developer.apple.com/forums/thread/679764
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Unwind segue to "unwindFirstSegueFor:towards"
I cannot find unwindFirstSegueFor anywhere in documentation.Where is this API defined ?
Topic: Design SubTopic: General
Replies
Boosts
Views
Activity
Jun ’24
Reply to iOS Developer Account for Sole Traders
I don't know what is exactly sole trader status. Have you a registered company (likely if you have VAT number) ? If so, you can get a DUNS number. Otherwise, you can publish on the appstore as an individual.
Replies
Boosts
Views
Activity
Jun ’24
Reply to Can't typing on NSTextField
Could you try to remove updateSuggestionMenu() showSuggestionMenu() override func textDidChange(_ notification: Notification) { super.textDidChange(notification) print("Still typing") // updateSuggestionMenu() // showSuggestionMenu() } If the problem disappear, you should reset focus after updateSuggestionMenu() showSuggestionMenu()
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to DevForums Improvements 2024-06-07
The reply editor now expands to full width when you uncheck the Live Preview checkbox (r. 128882713). Copying text no longer frames it as a quote (r. 128883038). Great! That were 2 annoying bugs. Thanks
Replies
Boosts
Views
Activity
Jun ’24
Reply to Is there a simple way to adding files to iPhone simulator, for use with Xcode?
I just tested on iPhone 15 Plus simulator with iOS 17.4 and Xcode 15.3. show Files folder in simulator drag a file from Finder: Save with the button on top right That's it.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to loaded array from plist. call using AppDelegate() returns empty array.
Could you show your complete AppDelegate code ? There is probably a problem here: let typesArray = AppDelegate().typesArray you create a new instance of AppDelegate (as AppDelegate() is a call to init to create a new instance), which itself has an empty typesArray as long as loadTypesArray has not been called. Hence let typesArray = returns empty array. If typesArray is declared as static in AppDelegate, then you can call in loadTypesArray: AppDelegate.typesArray = plist // Need to refer to class because of static Elsewhere: let typesArray = AppDelegate.typesArray // No ()
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Creating a navigation link within a chart?
I have not tried it, so I can't say if it works in your case. You could try to use chartOverlay as described in doc, and use it to get in a State var where you tapped and then move to the view according to this known tap point.: Chart(data) { LineMark( x: .value("date", $0.date), y: .value("price", $0.price) ) } .chartOverlay { proxy in GeometryReader { geometry in Rectangle().fill(.clear).contentShape(Rectangle()) .gesture( DragGesture() .onChanged { value in // Convert the gesture location to the coordinate space of the plot area. let origin = geometry[proxy.plotAreaFrame].origin let location = CGPoint( x: value.location.x - origin.x, y: value.location.y - origin.y ) // Get the x (date) and y (price) value from the location. let (date, price) = proxy.value(at: location, as: (Date, Double).self) print("Location: \(date), \(price)") } ) } } Another tutorial here: https://swiftwithmajid.com/2023/02/06/mastering-charts-in-swiftui-interactions/ Hope that can help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to How to take back the control of our application ?
You need to receive the complete folder that contains Xcode project, not only the source files (otherwise, you'll have a significant work to rebuild the project). The process should be: unzip the zip file (just double click on the icon) check that you get a folder containing a file such as MyProject.xcodeproj and a folder named MyProject (of course, you'll a name different than MyProject in both) have xCode installed on your Mac then double clicking on MyProject.xcodeproj will open the project in Xcode. From there you can start modifying code and generate new spa file.
Replies
Boosts
Views
Activity
Jun ’24
Reply to xcode bug
I understand it is not an issue with simulators but with device ? If that's the case, you should try to unpair the iPar and re-pair in Xcode.
Replies
Boosts
Views
Activity
Jun ’24
Reply to SwiftUI Custom Card hoverEffect() Rounded Corners
I tried to replicate, but I do get the rounded corners. Unless I did not understand the problem you describe.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to SwiftUI does not manage two NavigationLinks in a single list row
Thanks for the feedback. What did change in appearance (just for my understanding). And, no, I'm not in SwiftUI team, I wish I were, I would be much more knowledgable… Have a good day and good continuation.
Replies
Boosts
Views
Activity
Jun ’24
Reply to SwiftUI does not manage two NavigationLinks in a single list row
I may have found a simple solution. Problem comes from List which manages interactions with rows on its own, creating the mess. I just replaced List by a ScrollView, to get very similar display (except the ">" after button, but works OK for each link. No need either for buttonStyle. struct ContentView: View { var body: some View { NavigationView { // List { ScrollView { ForEach(0..<10) { index in HStack { Spacer() NavigationLink(destination: DestinationView1(item: index)) { Text("Navigate to View 1") .padding() .background(Color.blue) .foregroundColor(.white) .cornerRadius(8) } // .buttonStyle(PlainButtonStyle()) // Not needed Spacer() NavigationLink(destination: DestinationView2(item: index)) { Text("Navigate to View 2") .padding() .background(Color.green) .foregroundColor(.white) .cornerRadius(8) } // .buttonStyle(PlainButtonStyle()) // Not needed Spacer() } .padding(.vertical, 5) } } .navigationBarTitle("Navigation Links") } } } struct DestinationView1: View { var item: Int var body: some View { Text("Destination View 1 for item \(item)") .navigationBarTitle("View 1", displayMode: .inline) } } struct DestinationView2: View { var item: Int var body: some View { Text("Destination View 2 for item \(item)") .navigationBarTitle("View 2", displayMode: .inline) } }
Replies
Boosts
Views
Activity
Jun ’24
Reply to SwiftUI Picker Label
Picker label does not show except in some conditions. You have to find a work around to display the label independently. Get details here: https://stackoverflow.com/questions/69381385/swiftui-custom-picker-label-not-rendering
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to SwiftUI does not manage two NavigationLinks in a single list row
It is really difficult and risky to try this way (and Chat GPT is not clever enough to find it 😉). So, I would try to replace your navigation links by buttons and use ontapGesture to detect taps. Some more help here: https://stackoverflow.com/questions/72917698/multiple-navigation-destinations-from-a-list-row-in-swiftui
Replies
Boosts
Views
Activity
May ’24