Post

Replies

Boosts

Views

Activity

Reply to IAP product with variable content
I do not see anything in 3.1.1 In-App Purchase that would forbid it. Just take care of 3.1.2: Apps that attempt to scam users will be removed from the App Store. This includes apps that attempt to trick users into purchasing a subscription under false pretenses or engage in bait-and-switch and scam practices; these will be removed from the App Store and you may be removed from the Apple Developer Program. Also take care to inform user of how much time he/she would buy before completing transaction.
Topic: App & System Services SubTopic: StoreKit Tags:
Nov ’21
Reply to Picker without NavigationView
I don't understand your point (may be because you did not show code). Here is a working example of Picker: struct ContentView: View { var colors = ["Red", "Green", "Blue", "Tartan"] @State private var selectedColor = "Red" var body: some View { // VStack { // I remove VStack voluntarily HStack { Text("Please choose a color") Picker("", selection: $selectedColor) { ForEach(colors, id: \.self) { Text($0) } } // } Text("You selected: \(selectedColor)") } } } If I use a VStack, it works as well: struct ContentView: View { var colors = ["Red", "Green", "Blue", "Tartan"] @State private var selectedColor = "Red" var body: some View { VStack { HStack { Text("Please choose a color") Picker("", selection: $selectedColor) { ForEach(colors, id: \.self) { Text($0) } } } Text("You selected: \(selectedColor)") } } } Note : text does not show in Picker read: h t t p s : / / w w w.hackingwithswift.com/forums/swiftui/swiftui-xcode-12-2-picker-no-longer-shows-label/4809
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’21
Reply to Call 2o API after finishing 1st one
I tested the following: struct ContentView: View { func callApi1() -> String { print("callApi1") return "Returned from api1" } func callApi2(_ id: String) { print("callApi2 "+id) } var body: some View { Button(action: { var id = self.callApi1() self.callApi2(id) }) { Text("Start") } } } . And get the following, proving that id was passed. callApi1 callApi2 Returned from api1 What is it you want to do differently ? You could use completion handlers: struct ContentView: View { typealias API4 = (String) -> Void func callApi3(completion: API4) { print("callApi3") let value = "Some value" completion(value) return } func callApi4(_ value:String) { print("callApi4 with ", value) } var body: some View { Button(action: { self.callApi3(completion: callApi4 ) }) { Text("Start with completion") } } } To get: callApi3 callApi4 with Some value
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’21
Reply to I could really, really use some help with a concept that continues to hurt my head: Initializing.
Your question is very long (too long for free mentors on the forum may be 😉). To get help on this forum, you should ask shorter question, even if you have to split your question and ask step by step. For instance, you say: It’s the thing about injecting un-initialized objects into views.  So, limit your post to this question, explain with shorter code what you tried and did not succeed for this specific point.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’21
Reply to Call 2o API after finishing 1st one
I dont want to do differently. But when I do this way, self.callApi2(id) doesnt wait for self.callApi1 to finish. self.callApi2(id) is triggered at the same time and because doesnt have an ID yet, it fails. var id = self.callApi1() self.callApi2(id) You should have said that callApi1 was an async func. Then, your code will not work. So what do you mean you don't want to do differently something that doesn't work ? did you look at the solution with completion handler ? Does it work ? otherwise, please show the callApi1 real definition. Have you access to its source code ? maybe async / await could be used here (it is done for this) but you must first show code.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Picker without NavigationView
If a picker is inside a Form, it's going to be frozen and not selectable Do you need a Form or not ? You didn't say in your OP. If you search you will find it is a known bug in SwiftUI. https://stackoverflow.com/questions/66275021/picker-appears-disabled-inside-a-form-bug/66275172 So, all you can do: add a NavigationView or file a bug report and wait
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to IAP product with variable content
I do not see anything in 3.1.1 In-App Purchase that would forbid it. Just take care of 3.1.2: Apps that attempt to scam users will be removed from the App Store. This includes apps that attempt to trick users into purchasing a subscription under false pretenses or engage in bait-and-switch and scam practices; these will be removed from the App Store and you may be removed from the Apple Developer Program. Also take care to inform user of how much time he/she would buy before completing transaction.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Picker without NavigationView
I don't understand your point (may be because you did not show code). Here is a working example of Picker: struct ContentView: View { var colors = ["Red", "Green", "Blue", "Tartan"] @State private var selectedColor = "Red" var body: some View { // VStack { // I remove VStack voluntarily HStack { Text("Please choose a color") Picker("", selection: $selectedColor) { ForEach(colors, id: \.self) { Text($0) } } // } Text("You selected: \(selectedColor)") } } } If I use a VStack, it works as well: struct ContentView: View { var colors = ["Red", "Green", "Blue", "Tartan"] @State private var selectedColor = "Red" var body: some View { VStack { HStack { Text("Please choose a color") Picker("", selection: $selectedColor) { ForEach(colors, id: \.self) { Text($0) } } } Text("You selected: \(selectedColor)") } } } Note : text does not show in Picker read: h t t p s : / / w w w.hackingwithswift.com/forums/swiftui/swiftui-xcode-12-2-picker-no-longer-shows-label/4809
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Call 2o API after finishing 1st one
I tested the following: struct ContentView: View { func callApi1() -> String { print("callApi1") return "Returned from api1" } func callApi2(_ id: String) { print("callApi2 "+id) } var body: some View { Button(action: { var id = self.callApi1() self.callApi2(id) }) { Text("Start") } } } . And get the following, proving that id was passed. callApi1 callApi2 Returned from api1 What is it you want to do differently ? You could use completion handlers: struct ContentView: View { typealias API4 = (String) -> Void func callApi3(completion: API4) { print("callApi3") let value = "Some value" completion(value) return } func callApi4(_ value:String) { print("callApi4 with ", value) } var body: some View { Button(action: { self.callApi3(completion: callApi4 ) }) { Text("Start with completion") } } } To get: callApi3 callApi4 with Some value
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to How do restrict pan gesture recognizers to when a pinch gesture is occurring?
Not sure I understand. Do you want to use pinch gesture for pan ? In other words, I'd like to avoid delivering one finger pan gestures. Then, why not create a panGesture and set var minimumNumberOfTouches: Int to 2 ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to I could really, really use some help with a concept that continues to hurt my head: Initializing.
Your question is very long (too long for free mentors on the forum may be 😉). To get help on this forum, you should ask shorter question, even if you have to split your question and ask step by step. For instance, you say: It’s the thing about injecting un-initialized objects into views.  So, limit your post to this question, explain with shorter code what you tried and did not succeed for this specific point.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to enroll
First explain exactly where it failed, what messages you got…
Replies
Boosts
Views
Activity
Dec ’21
Reply to Call 2o API after finishing 1st one
I dont want to do differently. But when I do this way, self.callApi2(id) doesnt wait for self.callApi1 to finish. self.callApi2(id) is triggered at the same time and because doesnt have an ID yet, it fails. var id = self.callApi1() self.callApi2(id) You should have said that callApi1 was an async func. Then, your code will not work. So what do you mean you don't want to do differently something that doesn't work ? did you look at the solution with completion handler ? Does it work ? otherwise, please show the callApi1 real definition. Have you access to its source code ? maybe async / await could be used here (it is done for this) but you must first show code.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Picker without NavigationView
If a picker is inside a Form, it's going to be frozen and not selectable Do you need a Form or not ? You didn't say in your OP. If you search you will find it is a known bug in SwiftUI. https://stackoverflow.com/questions/66275021/picker-appears-disabled-inside-a-form-bug/66275172 So, all you can do: add a NavigationView or file a bug report and wait
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Double value conversion issue
This may help you: https://developer.apple.com/forums/thread/695376
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Is Apple's speech to text framework 'Speech' is HIPAA complaint?
I would be surprised that Speech to Text could be concerned with HIPAA as long you don't store those data in your app. But for such a legal question, you should ask directly to Apple's support.
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to What is the significance of web AR apps?
Is it a technical analysis or a promotional statement. That the same issue as the comparison between web app / native app. I understand web AR app cannot be published on the AppStore.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Get paid $40 to participate in our research study, and get help with your iOS app’s privacy details!
Such a request is inappropriate on the forum. Thanks to remove.
Replies
Boosts
Views
Activity
Dec ’21
Reply to What is a good way to reset a UIPanGestureRecognizer's view to its original frame once the pan gesture is done?
I see your new post. have you concluded on the 2 finger pan ? If so, don't forget to close this other thread, to avoid leaving them dangling in the forum. If not, could you explain the raining problem ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to What is a good way to reset a UIPanGestureRecognizer's view to its original frame once the pan gesture is done?
Why don't you save the view frame at beginning of pan and use it if state == .ended ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Related Videos WWDC21 Discover account-driven User Enrollment Improve MDM assignment of Apps and Books Manage devices with Apple Configurator Manage software updates in your organization Meet declarative device management
What is the question of your post ?
Replies
Boosts
Views
Activity
Dec ’21