Post

Replies

Boosts

Views

Activity

Reply to passing data from view one to seven
@sonam93 Yes, that requires that observer is added when notification is sent See details here: https://stackoverflow.com/questions/66489663/nsnotification-not-observing-or-posting-data Where and when do you load VC1 to VC6 ? If it is just a timing delay, you could post the notification in a dispatch with a 0.2s delay. That should work (increase the delay a little bit if needed). DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { NotificationCenter.default.post(name: .sendApple, object: nil, userInfo: [kNotificationValue : "apple"]) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to IOS publish app Issue
I understand all the text, except last line, is Reviewer mail. Exact ? You should edit your post to make it clearer. The request from reviewer seems very clear: Your app provides financial services but does not meet all the requirements for apps providing these services. Specifically: The app must be published under a seller and company name that is associated with the organization or company providing the services. In this case, your app must be published under a seller name and company name that reflects the Askmefund name. The account that submits the app must be enrolled in the Apple Developer Program as an organization, and not as an individual. So what is your question ? Are you able to "provide ownership documentation or modify the vendor seller name." Otherwise, you will not pass the review.
Topic: Privacy & Security SubTopic: General Tags:
Apr ’24
Reply to TextField gives error message
Is it the real code or did you type it here ? I noticed several errors: var id: UUID() soudé be var id = UUID() var body: Some View { should be var body: some View { What is this closure after TextField (it is only supported in MacOS: https://stackoverflow.com/questions/58776561/add-label-to-swiftui-textfield): TextField("xValue", value: $vars.xValue, format: .number) { Text("X") } So here is a code that works and that is properly formatted with code formatter. If that's OK, please close the thread by marking this answer as correct. Otherwise explain what's the problem. @Observable class Variables: Identifiable { var id = UUID() // <<-- Changed here var xValue: Int = 1 var yValue: Int = 1 } struct MainView: View { @State var vars = Variables() var body: some View { VStack { Subview() .environment(vars) .padding() Text("Value X = \(vars.xValue)") // No $vars here Text("Value Y = \(vars.yValue)") } } } struct Subview: View { @Environment(Variables.self) private var vars var body: some View { @Bindable var vars = vars // <<-- Added here // https://developer.apple.com/documentation/swiftui/bindable VStack { HStack { Text("X") TextField("xValue", value: $vars.xValue, format: .number) /*{ Text("X") }*/ // <<-- Changed here .textFieldStyle(.roundedBorder) } HStack { Text("Y") TextField("yValue", value: $vars.yValue, format: .number) /*{ Text("Y") }*/ .textFieldStyle(.roundedBorder) } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to Privacyinfo.xcprivacy doesn't work
Requirement for 3rd party framework is not really clear… See here: https://jochen-holzer.medium.com/embrace-the-evolution-preparing-your-ios-app-for-the-required-reason-api-38f2d12bbce5 3rd Party Libs Third-party SDKs need to provide their own privacy manifest files that record the types of data they collect. Your app’s privacy manifest file doesn’t need to cover data collected by third-party SDKs that your app links to. Did CBORCoding 1.3.2 and Half 1.3.1. provide such manifest ? Maybe you could ask to the author (same for both packages) : https://swiftpackageindex.com/SomeRandomiOSDev/CBORCoding. Author Joe Newton, somerandomiosdev @ gmail.com
Apr ’24
Reply to Privacyinfo.xcprivacy doesn't work
Do you use a library that could have more use cases of UserDefault ? Your file seems OK as long as UserDefaults are used exclusively by this app (not apps from same group). Maybe you could try to add some info to the String and see if it works: <string>CA92.1 access user defaults to read and write information that is only accessible to the app itself</string>. privacyInfo declaration is a really cryptic.
Apr ’24
Reply to Persisting User Input Data in SwiftUI
With this scheme, user can create its own articles and prices as well (just need to check that item is not a duplicate in that case). What do you want exactly to save in iCloud ? To save in iCloud: https://www.hackingwithswift.com/example-code/system/how-to-store-userdefaults-options-in-icloud
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to Persisting User Input Data in SwiftUI
So, if I understand correctly, you want to use (and save) 2 pricing tables: the default one that may be updated when app is updated the user's one if he/she has defined. And you want user to be able to keep it if desired. What is the size of these pricing tables ? If they are not too large (let's say, less than 1000 items), I would: create a dictionary with the price list include the default pricing in a JSON and include it in the project resources if user creates a price list, save it in User.defaults as another JSON (containing only the prices that were modified). When you load the app, you first decode the default pricing from the JSON Then you read user defaults to see if some price has to be superseded by a user price. You update the price dictionary for those keys (product name) Doing so will allow: add new prices in the JSON when you create a new release or modify some default prices work with whatever number of prices modified by user (even 0) preserve user prices. When uploading new release, you may ask user if he wants to keeps its prices or update with new defaults. If so, you should clear those user defaults. If several 1000 of items, SwiftData may be a better choice. This may help you create the JSON from the initial dictionary: https://www.tutorialspoint.com/convert-a-dictionary-to-json-in-swift Please tell if anything is not clear enough.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24