Post

Replies

Boosts

Views

Activity

Reply to Can't typing on NSTextField
So the test shows that showSuggestionMenu removes focus. I didn't say that was the solution, just a way of testing. So now, as I suggested before, try to reset focus after updateSuggestionMenu() showSuggestionMenu()
Topic: UI Frameworks SubTopic: AppKit Tags:
Jun ’24
Reply to Moving focus between textfields using enter key
Use FocusState. Here is a simple code example: struct ContentView: View { let textCase1 = 1 let textCase2 = 2 @State var text1: String = "" @State var text2: String = "" @FocusState private var focusedField: Int? var body: some View { VStack { HStack { Text(" TextField 1") TextField("", text: $text1) .border(Color.blue, width: 1) .focused($focusedField, equals: textCase1) .onSubmit { focusedField = 2 } } HStack { Text(" TextField 2") TextField("", text: $text2) .border(Color.red, width: 1) .focused($focusedField, equals: textCase2) .onSubmit { focusedField = 1 } } Button { focusedField = nil print("No more focus") } label: { Text("Do something else") } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to Closure | Error when referring static variable
You can refer to a static variable. As shown in the small code below: struct Preview: View { private static let NAME = "Test" var array: [String] = ["someTest", "Hello", "HelloTest"] var filtered: [String] { array.filter { $0.contains(Preview.NAME) } } var body: some View { ForEach(filtered, id: \.self) { s in Text(s) } } } So the problem is the use in the Query. May be you could try to include in a computed var ?
Topic: Programming Languages SubTopic: Swift Tags:
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:
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 Previewing your app’s interface in Xcode
Which version of Xcode do you use ? #Preview is available only in Xcode 15 and over. If you use an older version, replace #Preview { // The view to preview. } by: struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Replies
Boosts
Views
Activity
Jun ’24
Reply to iPhone 13 no longer connecting to LTE or 5G
17.5.1 is now released. Did you try installing ? But your question would better be posted on Apple support community: https://discussions.apple.com/welcome
Replies
Boosts
Views
Activity
Jun ’24
Reply to Screen tome big on ios 18 beta
That's not a question for developers forum. You'd better post on Apple Support Community: https://discussions.apple.com/welcome
Replies
Boosts
Views
Activity
Jun ’24
Reply to Can't typing on NSTextField
So the test shows that showSuggestionMenu removes focus. I didn't say that was the solution, just a way of testing. So now, as I suggested before, try to reset focus after updateSuggestionMenu() showSuggestionMenu()
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Moving focus between textfields using enter key
Use FocusState. Here is a simple code example: struct ContentView: View { let textCase1 = 1 let textCase2 = 2 @State var text1: String = "" @State var text2: String = "" @FocusState private var focusedField: Int? var body: some View { VStack { HStack { Text(" TextField 1") TextField("", text: $text1) .border(Color.blue, width: 1) .focused($focusedField, equals: textCase1) .onSubmit { focusedField = 2 } } HStack { Text(" TextField 2") TextField("", text: $text2) .border(Color.red, width: 1) .focused($focusedField, equals: textCase2) .onSubmit { focusedField = 1 } } Button { focusedField = nil print("No more focus") } label: { Text("Do something else") } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to AI
Depends what you mean. But a lot of advanced functions that require intensive on board processing will only be available on 15 Pro and above…
Replies
Boosts
Views
Activity
Jun ’24
Reply to Closure | Error when referring static variable
You can refer to a static variable. As shown in the small code below: struct Preview: View { private static let NAME = "Test" var array: [String] = ["someTest", "Hello", "HelloTest"] var filtered: [String] { array.filter { $0.contains(Preview.NAME) } } var body: some View { ForEach(filtered, id: \.self) { s in Text(s) } } } So the problem is the use in the Query. May be you could try to include in a computed var ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to problem with charger other than Apple
Is the charger MFI certified ? Anyway, this is not a question for this forum. You'd better ask on Apple Support Community https://discussions.apple.com/welcome
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
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