Post

Replies

Boosts

Views

Activity

Reply to app store review rejected
Is it a question to other developers ? If so, what is the question ? If it is for Apple, the forum is not the right channel, you'd better either: add information in reply to reviewer in Appstore post a bug report contact support. In both cases, you should provide much more detailed information (which standard are you speaking of ? Which png image ?)
Apr ’24
Reply to how to calculate this logarithmic operation
Welcome to the forum. Some simple math here. Your expression is: 10 log (2 * 10**(x/10)) That is 10 log(2) + 10 log (10**(x/10) = 10 log(2) + 10 * x / 10 * log(10) So result is simply: 10 log(2) + x log(10) = 6.931472 + 2.3025851 x Works for log or log10 as you want. That's much simpler (and gives a slightly more accurate result because there are less rounding effects) than the brute force computation): var x : Float = 15 // Set the value of x func compute(_ x: Float) -> Float { let x1 = x / 10 let lnx = x1 * log(10) let p = exp(lnx) // 10 ** (x/10) // log is Neper log, not log10 let r = 10 * log(p + p) return r } print(compute(x)) let r = 10*log(2) + x*log(10) print(r) And check you get exactly the same result… If that answers your question, don't forget to close the thread by marking the correct answer. Otherwise explain what you don't understand.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to OrderedDictionary encode issue
I don't understand your post. You say: does anyone know why the output of OrderedDictionary is not like this: {"bbb": 12, "ccc": 13, "ddd": 14, "bbc": 15} But just before you wrote: The output JSON of OrderDictionary is like this: [ "bbb", 12, "ccc", 13, "ddd", 14, "bbc", 15 ] What is the point ? To have an array and not a dictionary ? See discussion here: https://forums.swift.org/t/ordereddictionary-decoding/66829
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’24
Reply to Wrong information found in SwiftUI documentation!
Welcome to the forum. There are many other similar examples of code samples in documentation that are not uptodate. Don't loose too much time on this. You should file a bug report against documentation. And anyway it is detected by compiler with suggestion on how to correct or with auto completion advice.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to App design and set up
I hope I understand exactly what you want to achieve. You don't show all code, but you should have a first View (often named ContentView). It looks like the following: struct ContentView: View { // var declarations, Sate var… @State var showPicker = true // at start only @State var selectedStagione = "" // You could also set the initial value 2023/2024 here without need for onAppear var body: some View { VStack(alignment: .leading) { // the view content, with the picker for idStagione selection if showPicker { // display the Picker Picker("Please select", selection: $selectedStagione) { // build Picker items } .onChange(of: selectedStagione) { _, _ in // The new format for onChange showPicker = false print("Selection done") } } } .onAppear { // set idStagione initial value here selectedStagione = "2023/2024" // adapt as needed } } } Please tell if you need more explanation ; if so, show your ContentView. If OK, don't forget to close the thread by marking the correct answer.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to Timeline Apple legal name dispute
I don't understand. You say you have a trademark on the name but also speak of The business owning the name currently … How could you get a valid trademark is the name is owned by someone else (even if out of business) ? Who owns the name at the end ? IMHO, delay does not depend on Appstore but on your legal battle resolution.
Apr ’24
Reply to List or a ForEach from a binding: keyboard issue
I tested and reproduced the problem, in simulator and on device.. Problem seems to be the association of List and TextEditor ; when typing, List cells or ForEach cells are resized, forcing keyboard to hide. Problem is not TextEditor itself, as this works properly if alone: struct ContentView: View { @State private var msg = "Hello" var body: some View { TextEditor(text: $msg) } } Note: same problem with TextField: List($messages, id: \.self) { $msg in TextField("A", text: $msg) } You may file a bug report.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to no data from userdefaults
Debug is possible. For instance, check if try succeeds: if let decoded = try? JSONDecoder().decode([RouteObject].self, from: data) { print("decode success") routes = decoded return } Try: if let data = UserDefaults.standard.data(forKey: saveKey) as? Data { // <<-- add as? data Could you also show how RouteObject is defined ?
Topic: App & System Services SubTopic: General Tags:
Apr ’24
Reply to SwiftUI needs MacOS 10.15?
Yes, you need MacOS 10.15: Why V10_14 which is very old now (we are V14.4…) If you sync with iOS 15, that's MacOS 12. Aren't you confusing V10_14 with V14 ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to What are the numbers that seen next to the ios sdk release notes ?
My guess: that's probably an internal reference (sequential number or some type of internal coding convention ?). I guess that for each modification of code they attribute a reference number to allow proper tracking. You have also in some cases the FB that is corrected.
Replies
Boosts
Views
Activity
Apr ’24
Reply to app store review rejected
Is it a question to other developers ? If so, what is the question ? If it is for Apple, the forum is not the right channel, you'd better either: add information in reply to reviewer in Appstore post a bug report contact support. In both cases, you should provide much more detailed information (which standard are you speaking of ? Which png image ?)
Replies
Boosts
Views
Activity
Apr ’24
Reply to how to calculate this logarithmic operation
Welcome to the forum. Some simple math here. Your expression is: 10 log (2 * 10**(x/10)) That is 10 log(2) + 10 log (10**(x/10) = 10 log(2) + 10 * x / 10 * log(10) So result is simply: 10 log(2) + x log(10) = 6.931472 + 2.3025851 x Works for log or log10 as you want. That's much simpler (and gives a slightly more accurate result because there are less rounding effects) than the brute force computation): var x : Float = 15 // Set the value of x func compute(_ x: Float) -> Float { let x1 = x / 10 let lnx = x1 * log(10) let p = exp(lnx) // 10 ** (x/10) // log is Neper log, not log10 let r = 10 * log(p + p) return r } print(compute(x)) let r = 10*log(2) + x*log(10) print(r) And check you get exactly the same result… If that answers your question, don't forget to close the thread by marking the correct answer. Otherwise explain what you don't understand.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to OrderedDictionary encode issue
I don't understand your post. You say: does anyone know why the output of OrderedDictionary is not like this: {"bbb": 12, "ccc": 13, "ddd": 14, "bbc": 15} But just before you wrote: The output JSON of OrderDictionary is like this: [ "bbb", 12, "ccc", 13, "ddd", 14, "bbc", 15 ] What is the point ? To have an array and not a dictionary ? See discussion here: https://forums.swift.org/t/ordereddictionary-decoding/66829
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to Wrong information found in SwiftUI documentation!
Welcome to the forum. There are many other similar examples of code samples in documentation that are not uptodate. Don't loose too much time on this. You should file a bug report against documentation. And anyway it is detected by compiler with suggestion on how to correct or with auto completion advice.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to App design and set up
I hope I understand exactly what you want to achieve. You don't show all code, but you should have a first View (often named ContentView). It looks like the following: struct ContentView: View { // var declarations, Sate var… @State var showPicker = true // at start only @State var selectedStagione = "" // You could also set the initial value 2023/2024 here without need for onAppear var body: some View { VStack(alignment: .leading) { // the view content, with the picker for idStagione selection if showPicker { // display the Picker Picker("Please select", selection: $selectedStagione) { // build Picker items } .onChange(of: selectedStagione) { _, _ in // The new format for onChange showPicker = false print("Selection done") } } } .onAppear { // set idStagione initial value here selectedStagione = "2023/2024" // adapt as needed } } } Please tell if you need more explanation ; if so, show your ContentView. If OK, don't forget to close the thread by marking the correct answer.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to 3 Warning after analyzing myiphone SE 2022
You should first ask to Amnesty International who developed apparently the app.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to Timeline Apple legal name dispute
I don't understand. You say you have a trademark on the name but also speak of The business owning the name currently … How could you get a valid trademark is the name is owned by someone else (even if out of business) ? Who owns the name at the end ? IMHO, delay does not depend on Appstore but on your legal battle resolution.
Replies
Boosts
Views
Activity
Apr ’24
Reply to Disable a `contextMenu` button conditionally depending on the list item
Did you try this simpler code: .disabled(!parent.children.isEmpty) suppressing .onAppear ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to List or a ForEach from a binding: keyboard issue
I tested and reproduced the problem, in simulator and on device.. Problem seems to be the association of List and TextEditor ; when typing, List cells or ForEach cells are resized, forcing keyboard to hide. Problem is not TextEditor itself, as this works properly if alone: struct ContentView: View { @State private var msg = "Hello" var body: some View { TextEditor(text: $msg) } } Note: same problem with TextField: List($messages, id: \.self) { $msg in TextField("A", text: $msg) } You may file a bug report.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to Slightly weird SwiftData issue relating to background context inserts on a unrelated line of code
Could you explain a few points: what is the purpose of copy parameter which recreates an instance of vehicle already passed as parameter ? VehicleEditView(vehicle: vehicle, copy: Vehicle(from: vehicle)) show the complete declaration of Vehicle structure (mileageHistory is an array ? Is it a computed var ?).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to Fatal error: NSArray element failed to match the Swift Array Element type
You don't provide enough information. how is ASDisplayNode defined ? how are subsides defined ? Check if your problem is similar to the case described here: https://stackoverflow.com/questions/25484554/fatal-error-nsarray-element-failed-to-match-the-swift-array-element-type
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to What language learn to develope iOS application?
Welcome to the forum. But what is your question ? Posting such a general comment (or personal opinion) has no added value and just adds noise to the forum. You should avoid it. Have a good day.
Replies
Boosts
Views
Activity
Apr ’24
Reply to no data from userdefaults
Debug is possible. For instance, check if try succeeds: if let decoded = try? JSONDecoder().decode([RouteObject].self, from: data) { print("decode success") routes = decoded return } Try: if let data = UserDefaults.standard.data(forKey: saveKey) as? Data { // <<-- add as? data Could you also show how RouteObject is defined ?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’24