Post

Replies

Boosts

Views

Activity

Reply to Share settings from SwiftUI in-app settings view to other views
There are several options: use environment var, in a class that groups all the settings AppStorage may be a good option. However, if you have a lot of var, that becomes tedious. How many var have you, of which type ? An idea here is to multiplex the var. imagine you have 8 Int var, which value is in fact between 0 and 255. Then you can create a function to multiplex them: var1 + 256*var2 * 256*256*var3 etc and a demux function, using a succession of % and DIV to get each var back The best would be you show some code so that we can be more specific.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to "Sensitive language" errors
Have a look here: https://forums.developer.apple.com/forums/thread/747146 and here: https://developer.apple.com/forums/thread/746365 Sensitive may be information like your Apple ID or other confidential information. Or some parts are identified as referring for instance to some country code where the robot is suspicious…
Jun ’24
Reply to [iPadOS 18] Make Tabbar back to previous version
Hate is usually a bad adviser… 😇 So you'd better file a bug report, as done here: https://developer.apple.com/forums/thread/756652 But it is likely a definite design choice to save space on iPad (not possible on iPhone probably because of Dynamic Island) and progressively all apps will adopt, so it is probably better to get accustomed to it…
Topic: UI Frameworks SubTopic: UIKit
Jun ’24
Reply to Handling of dates with no value when creating a date bar chart in Charts
All data are shown… but you have to scroll. Add .chartXVisibleDomain to change the scale and see the full range Chart(sessions, id: \.date) { session in BarMark( x: .value("Date", session.date), y: .value("Max RM", session.maxRM) ) } .chartXAxis { AxisMarks(values: .stride(by: .day, count:7)) // 日付の表示間隔を調整 } .chartXVisibleDomain(length: 3600 * 24 * 30) // 30 days in this case .chartScrollableAxes(.horizontal) // 横スクロールを有効にする .padding([.leading, .trailing, .bottom]) Note: totalVolume is shown but as it is zero is a zero height bar.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
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:
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 Guideline 4.3(a) - Design - Spam
What type of application is it ? Spam does not necessarily mean that your code is not original code, but could also mean the app concept or design or too close to existing ones.
Topic: Design SubTopic: General
Replies
Boosts
Views
Activity
Jun ’24
Reply to Share settings from SwiftUI in-app settings view to other views
There are several options: use environment var, in a class that groups all the settings AppStorage may be a good option. However, if you have a lot of var, that becomes tedious. How many var have you, of which type ? An idea here is to multiplex the var. imagine you have 8 Int var, which value is in fact between 0 and 255. Then you can create a function to multiplex them: var1 + 256*var2 * 256*256*var3 etc and a demux function, using a succession of % and DIV to get each var back The best would be you show some code so that we can be more specific.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to "Sensitive language" errors
Have a look here: https://forums.developer.apple.com/forums/thread/747146 and here: https://developer.apple.com/forums/thread/746365 Sensitive may be information like your Apple ID or other confidential information. Or some parts are identified as referring for instance to some country code where the robot is suspicious…
Replies
Boosts
Views
Activity
Jun ’24
Reply to [iPadOS 18] Make Tabbar back to previous version
Hate is usually a bad adviser… 😇 So you'd better file a bug report, as done here: https://developer.apple.com/forums/thread/756652 But it is likely a definite design choice to save space on iPad (not possible on iPhone probably because of Dynamic Island) and progressively all apps will adopt, so it is probably better to get accustomed to it…
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Jun ’24
Reply to Guideline 4.1 - Design - Copycats change to Guideline 4.3(a) - Design - Spam
Who is this post for ? If for Apple, that's not the right forum. If it is for developers, what is your question ?
Topic: Design SubTopic: General
Replies
Boosts
Views
Activity
Jun ’24
Reply to Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage
You do not answer to reviewer's comment: collects cookies for tracking after the user asked you not to track them Is that the case or not ? Even if user has accepted cookie banner request, if he/she denies ATT, you cannot do any tracking.
Replies
Boosts
Views
Activity
Jun ’24
Reply to Handling of dates with no value when creating a date bar chart in Charts
All data are shown… but you have to scroll. Add .chartXVisibleDomain to change the scale and see the full range Chart(sessions, id: \.date) { session in BarMark( x: .value("Date", session.date), y: .value("Max RM", session.maxRM) ) } .chartXAxis { AxisMarks(values: .stride(by: .day, count:7)) // 日付の表示間隔を調整 } .chartXVisibleDomain(length: 3600 * 24 * 30) // 30 days in this case .chartScrollableAxes(.horizontal) // 横スクロールを有効にする .padding([.leading, .trailing, .bottom]) Note: totalVolume is shown but as it is zero is a zero height bar.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’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