Post

Replies

Boosts

Views

Activity

Reply to Guideline 5.1.2 : The primary purpose of the app is still to encourage users to perform digital tasks in exchange for compensation, watch ads and/or perform other marketing-oriented tasks, which is not appropriate.
there are other apps out there that have a similar business model That's not argument reviewers will ever consider. May be they have missed it for those other apps (as hinted in the answer), but that does not entitle others to do the same. According to your post, your app does violate guideline 5.1.2 and, now that it has been noticed, it's very likely it will be rejected until you change your app.   Could they have objected because I included conversion of proprietary currency to $ ? What do you mean by "proprietary" ?
May ’24
Reply to HELP ME!!
Problem:I can't implement this program which this below text say. How do I write the code?? What do you mean ? You cannot enter code or you don't know how to code ? Which part ? onSubmit ? Here is how to do it for onSubmit .onSubmit { if !nameToAdd.isEmpty { if names.contains(nameToAdd) { // You could add an alert, or sound a beep if already exists } else { names.append(nameToAdd) } nameToAdd = "" } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to Bug: If you have ever made a TestFlight build with a higher version number, you won't get any crash nor feedback reports from users for lower versions!
I understand the mistake was a long time ago (build 55). IMHO, it is not a bug but an intended policy of AppStore to make sure users are not confused by release versions that go up and down. So little chance a bug report would lead to any change. Which means we effectively have to double check all the meta information before pushing on the Appstore. Can't you make your new version 2.0.1 with build 211 ? I understand it is not the best, but that's the only option I know. Last hope: contact developers' support to see if they can do anything for you ?
May ’24
Reply to "Unexpectedly found nil while unwrapping an Optional value" in URL
If I understand, the error is here: func fetchLink() async { do { url = URL(string: GlobalString().link) let (data, _) = try await URLSession.shared.data(from: url!) If you look at URL documentation, you see that URL(string: _) returns an optional which may be nil (that's what happens in your case) init?(string: String) Creates a URL instance from the provided string. Why is it nil, that's what you have now to investigate. To make your code robust, test for nil: func fetchLink() async { do { url = URL(string: GlobalString().link) if url == nil { print(GlobalString()) // <<-- To understand what happens return // do not continue } let (data, _) = try await URLSession.shared.data(from: url!) // <<-- cannot be nil anymore Do the same by testing post_url if the error is here: let postUrl: URL? = linkResponse.post_url != nil ? URL(string: linkResponse.post_url!) : nil Note: In Swift we avoid using underscore and use camelCase instead. That means post_url should better be postUrl or postURL for instance.
Topic: Programming Languages SubTopic: Swift Tags:
May ’24
Reply to Swiftui - Pressing button in a list also actions another button
You have to set buttonStyle (does not work with default value), such as: .buttonStyle(.borderless) // Or some other style So your code: List(am.students) { item in HStack { Text(item.name).font(fancyFont) Spacer() Button(item.casual ? "All Paid" : "Reverse All Paid") { // Issue: pressing this button also results in Remove button action being invoked. item.casual = !item.casual } .buttonStyle(.borderless) // <<-- ADD THIS Or some other style .foregroundColor(Color(white: 0.15)) .padding(3) .overlay( RoundedRectangle(cornerRadius: 5) .stroke(Color(white: 0.5), lineWidth: 3) ) Spacer().frame(width: 40) Button("Remove") { Task { await am.delete(student: item) } } .buttonStyle(.borderless) // <<-- ADD THIS Or some other style .foregroundColor(Color(white: 0.15)) .frame(width: 80) .padding(3) .overlay( RoundedRectangle(cornerRadius: 5) .stroke(Color(white: 0.5), lineWidth: 3) ) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to How might I get didSet behaviour on an AppStorage var?
Surprising. I tested the code proposed here and it works: https://stackoverflow.com/questions/63171806/willset-not-being-called-on-swiftuis-new-appstorage-property struct DemoAppStorageDidSet: View { @AppStorage("codeResult") var codeResult: String = "Default" { // << default value willSet { print("willSet: \(newValue)") } didSet { print("didSet: \(oldValue)") } } var body: some View { VStack { Text("Code Result: \(codeResult)") Divider() Button("AppStore Update") { self.codeResult = "AppStore" // << activates willSet/didSet !! } Divider() Button("UserDefaults Update") { UserDefaults.standard.set("UserDefaults", forKey: "codeResult") } } } }   Tapping "AppStore Update" logs as expected: willSet: AppStore didSet: Default Tapping a second time: willSet: AppStore didSet: AppStore So please show your complete code that does not work (maybe stupid question: are you sure the console is visible for log ?)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to FORM PROBLEMS
That's a limit of SwiftUI: a view cannot have more than 10 subviews (here sections). There is a workaround: group up to 10 sections in a Group Form { Group { Section { } Section { } // up to 10 sections } Group { Section { } Section { } // up to 10 sections } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to SF Symbol
Where did you see this symbol ? In an Apple's app or another app ? I searched also for circle and for dotted. Could not find it either. moon.circle is relatively close to this. But not the same.
Topic: Design SubTopic: General Tags:
May ’24
Reply to Swift: Can I change views without clicking on a link.
I would try it differently: struct ContentView: View { //#if os(iOS) // var myOS = "iOS" //#elseif os(OSX) // var myOS = "OSX" //#else // var myOS = "Something Else" //#endif struct ScreenIOS: View { var body: some View { VStack { Text("Welcome iOS !") } } } struct ScreenMacOS: View { var body: some View { VStack { Text("Welcome MacOS !") } } } var body: some View { NavigationStack { VStack { Text("PLEASE WAIT …") // Wait do you wait for ? .font(.system(size: 24)) .fontWeight(.bold) } .padding() if ProcessInfo.processInfo.isiOSAppOnMac { // if (myOS == "OSX") { ScreenMacOS() // Goto Screen for iMac } else { ScreenIOS() // go to screen for iOS } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to Guideline 5.1.2 : The primary purpose of the app is still to encourage users to perform digital tasks in exchange for compensation, watch ads and/or perform other marketing-oriented tasks, which is not appropriate.
there are other apps out there that have a similar business model That's not argument reviewers will ever consider. May be they have missed it for those other apps (as hinted in the answer), but that does not entitle others to do the same. According to your post, your app does violate guideline 5.1.2 and, now that it has been noticed, it's very likely it will be rejected until you change your app.   Could they have objected because I included conversion of proprietary currency to $ ? What do you mean by "proprietary" ?
Replies
Boosts
Views
Activity
May ’24
Reply to HELP ME!!
Problem:I can't implement this program which this below text say. How do I write the code?? What do you mean ? You cannot enter code or you don't know how to code ? Which part ? onSubmit ? Here is how to do it for onSubmit .onSubmit { if !nameToAdd.isEmpty { if names.contains(nameToAdd) { // You could add an alert, or sound a beep if already exists } else { names.append(nameToAdd) } nameToAdd = "" } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Bug: If you have ever made a TestFlight build with a higher version number, you won't get any crash nor feedback reports from users for lower versions!
I understand the mistake was a long time ago (build 55). IMHO, it is not a bug but an intended policy of AppStore to make sure users are not confused by release versions that go up and down. So little chance a bug report would lead to any change. Which means we effectively have to double check all the meta information before pushing on the Appstore. Can't you make your new version 2.0.1 with build 211 ? I understand it is not the best, but that's the only option I know. Last hope: contact developers' support to see if they can do anything for you ?
Replies
Boosts
Views
Activity
May ’24
Reply to "Unexpectedly found nil while unwrapping an Optional value" in URL
If I understand, the error is here: func fetchLink() async { do { url = URL(string: GlobalString().link) let (data, _) = try await URLSession.shared.data(from: url!) If you look at URL documentation, you see that URL(string: _) returns an optional which may be nil (that's what happens in your case) init?(string: String) Creates a URL instance from the provided string. Why is it nil, that's what you have now to investigate. To make your code robust, test for nil: func fetchLink() async { do { url = URL(string: GlobalString().link) if url == nil { print(GlobalString()) // <<-- To understand what happens return // do not continue } let (data, _) = try await URLSession.shared.data(from: url!) // <<-- cannot be nil anymore Do the same by testing post_url if the error is here: let postUrl: URL? = linkResponse.post_url != nil ? URL(string: linkResponse.post_url!) : nil Note: In Swift we avoid using underscore and use camelCase instead. That means post_url should better be postUrl or postURL for instance.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Swiftui - Pressing button in a list also actions another button
You have to set buttonStyle (does not work with default value), such as: .buttonStyle(.borderless) // Or some other style So your code: List(am.students) { item in HStack { Text(item.name).font(fancyFont) Spacer() Button(item.casual ? "All Paid" : "Reverse All Paid") { // Issue: pressing this button also results in Remove button action being invoked. item.casual = !item.casual } .buttonStyle(.borderless) // <<-- ADD THIS Or some other style .foregroundColor(Color(white: 0.15)) .padding(3) .overlay( RoundedRectangle(cornerRadius: 5) .stroke(Color(white: 0.5), lineWidth: 3) ) Spacer().frame(width: 40) Button("Remove") { Task { await am.delete(student: item) } } .buttonStyle(.borderless) // <<-- ADD THIS Or some other style .foregroundColor(Color(white: 0.15)) .frame(width: 80) .padding(3) .overlay( RoundedRectangle(cornerRadius: 5) .stroke(Color(white: 0.5), lineWidth: 3) ) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to How might I get didSet behaviour on an AppStorage var?
Surprising. I tested the code proposed here and it works: https://stackoverflow.com/questions/63171806/willset-not-being-called-on-swiftuis-new-appstorage-property struct DemoAppStorageDidSet: View { @AppStorage("codeResult") var codeResult: String = "Default" { // << default value willSet { print("willSet: \(newValue)") } didSet { print("didSet: \(oldValue)") } } var body: some View { VStack { Text("Code Result: \(codeResult)") Divider() Button("AppStore Update") { self.codeResult = "AppStore" // << activates willSet/didSet !! } Divider() Button("UserDefaults Update") { UserDefaults.standard.set("UserDefaults", forKey: "codeResult") } } } }   Tapping "AppStore Update" logs as expected: willSet: AppStore didSet: Default Tapping a second time: willSet: AppStore didSet: AppStore So please show your complete code that does not work (maybe stupid question: are you sure the console is visible for log ?)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to FORM PROBLEMS
That's a limit of SwiftUI: a view cannot have more than 10 subviews (here sections). There is a workaround: group up to 10 sections in a Group Form { Group { Section { } Section { } // up to 10 sections } Group { Section { } Section { } // up to 10 sections } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to SF Symbol
Where did you see this symbol ? In an Apple's app or another app ? I searched also for circle and for dotted. Could not find it either. moon.circle is relatively close to this. But not the same.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Swift: Can I change views without clicking on a link.
I would try it differently: struct ContentView: View { //#if os(iOS) // var myOS = "iOS" //#elseif os(OSX) // var myOS = "OSX" //#else // var myOS = "Something Else" //#endif struct ScreenIOS: View { var body: some View { VStack { Text("Welcome iOS !") } } } struct ScreenMacOS: View { var body: some View { VStack { Text("Welcome MacOS !") } } } var body: some View { NavigationStack { VStack { Text("PLEASE WAIT …") // Wait do you wait for ? .font(.system(size: 24)) .fontWeight(.bold) } .padding() if ProcessInfo.processInfo.isiOSAppOnMac { // if (myOS == "OSX") { ScreenMacOS() // Goto Screen for iMac } else { ScreenIOS() // go to screen for iOS } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24