Post

Replies

Boosts

Views

Activity

Reply to Decoding dynamic json
The dictionary "attributes" is always an dictionary but the content inside could be everything. Be more explicit. Is it [String: Any] ? Please show how you have defined the struct that will hold the decoded JSON. How is attributes defined there ? You may find interesting info here: https://stackoverflow.com/questions/44603248/how-to-decode-a-property-with-type-of-json-dictionary-in-swift-45-decodable-pr
Topic: App & System Services SubTopic: General Tags:
May ’24
Reply to A syntax error I'm not understanding...
Problem is that map does not work on Set: https://stackoverflow.com/questions/29107928/swift-map-extension-for-set Even this does not compile: extension IntSet { func aFunction() -> Set<String> { let array: [String] = self.map { "\($0)" } print(array) // This prints correctly let aSet = Set(array) // ERROR: No exact matches in call to initializer return [] //Set(array) // No error here } } If you work on array, no issue typealias IntSet = [Int] //Set<Int> extension IntSet { func aFunction() -> Set<String> { let array: [String] = self.map { "\($0)" } return Set(array) } } I tried what is proposed in the referenced link, to no avail. extension Set { /// Map, but for a `Set`. /// - Parameter transform: The transform to apply to each element. func map<T>(_ transform: (Element) throws -> T) rethrows -> Set<T> { var tempSet = Set<T>() try forEach { tempSet.insert(try transform($0)) } return tempSet } } I got it working by building the set manually extension IntSet { func aFunction() -> Set<String> { var set3: Set<String> = [] for s in self { set3.insert(String(s)) } return set3 } } But building from an array did not work… extension IntSet { func aFunction() -> Set<String> { var array2: [String] = [] for s in self { array2.append(String(s)) } return Set(array2) // Cannot convert return expression of type 'Set<Int>' to return type 'Set<String>' } }
Topic: Programming Languages SubTopic: Swift Tags:
May ’24
Reply to How can I create a custom SignInWithAppleButton that uses only the Apple logo and implements the onRequest and onCompletion logic?
There is an instance method in SignInWithAppleButton: dialogIcon(_:). func dialogIcon(_ icon: Image?) -> some View Unfortunately, not documented (but some limited info here: https://stackoverflow.com/questions/76860051/how-to-change-the-icon-for-confirmation-dialogs-and-alerts-in-swiftui). Did you try it ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24
Reply to Unable to add for review
You have changed nothing on your account, that's the problem. You have now to declare whether or not your are a trader (selling apps). Get details here: https://developer.apple.com/help/app-store-connect/manage-compliance-information/manage-european-union-digital-services-act-trader-requirements/ Não alterou nada na sua conta, é esse o problema. Tem agora de declarar se é ou não um comerciante (que vende aplicações). Para mais pormenores, consulte: https://developer.apple.com/help/app-store-connect/manage-compliance-information/manage-european-union-digital-services-act-trader-requirements/
May ’24
Reply to Alterar o idioma para PT(Português)
I hope I understand correctly your question. When you published on the AppStore, have you defined several languages (Portuguese and English for instance) ? Have you defined Portuguese as the main language ? If not do it with a new release of your app: https://stackoverflow.com/questions/10967722/change-default-language-for-app-listing-in-itunes-connect Quando publicaram na AppStore, definiram várias línguas (português e inglês, por exemplo)? Definiu o português como língua principal? Se não o fez, faça-o com uma nova versão da sua aplicação: https://stackoverflow.com/questions/10967722/change-default-language-for-app-listing-in-itunes-connect
May ’24
Reply to App Store Connect problem
Maintenance was announced a few days ago to occur on Saturday at 6 am PST. It is working normally (at least for me) now.
Replies
Boosts
Views
Activity
May ’24
Reply to iPad 13'' Display couldn't get
I noticed that there's an option for a 13'' display You have to provide only if it marked as required. If it is marked as optional, it is up to you.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Decoding dynamic json
The dictionary "attributes" is always an dictionary but the content inside could be everything. Be more explicit. Is it [String: Any] ? Please show how you have defined the struct that will hold the decoded JSON. How is attributes defined there ? You may find interesting info here: https://stackoverflow.com/questions/44603248/how-to-decode-a-property-with-type-of-json-dictionary-in-swift-45-decodable-pr
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to A syntax error I'm not understanding...
Problem is that map does not work on Set: https://stackoverflow.com/questions/29107928/swift-map-extension-for-set Even this does not compile: extension IntSet { func aFunction() -> Set<String> { let array: [String] = self.map { "\($0)" } print(array) // This prints correctly let aSet = Set(array) // ERROR: No exact matches in call to initializer return [] //Set(array) // No error here } } If you work on array, no issue typealias IntSet = [Int] //Set<Int> extension IntSet { func aFunction() -> Set<String> { let array: [String] = self.map { "\($0)" } return Set(array) } } I tried what is proposed in the referenced link, to no avail. extension Set { /// Map, but for a `Set`. /// - Parameter transform: The transform to apply to each element. func map<T>(_ transform: (Element) throws -> T) rethrows -> Set<T> { var tempSet = Set<T>() try forEach { tempSet.insert(try transform($0)) } return tempSet } } I got it working by building the set manually extension IntSet { func aFunction() -> Set<String> { var set3: Set<String> = [] for s in self { set3.insert(String(s)) } return set3 } } But building from an array did not work… extension IntSet { func aFunction() -> Set<String> { var array2: [String] = [] for s in self { array2.append(String(s)) } return Set(array2) // Cannot convert return expression of type 'Set<Int>' to return type 'Set<String>' } }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to How can I create a custom SignInWithAppleButton that uses only the Apple logo and implements the onRequest and onCompletion logic?
There is an instance method in SignInWithAppleButton: dialogIcon(_:). func dialogIcon(_ icon: Image?) -> some View Unfortunately, not documented (but some limited info here: https://stackoverflow.com/questions/76860051/how-to-change-the-icon-for-confirmation-dialogs-and-alerts-in-swiftui). Did you try it ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Can a button call a new view without using NavigationStack/Link/View?
You just don't control the "when" directly. Yes, but we can have some control with a dispatch: Button { // CreateUser() //another SwiftUI view, not a function DispatchQueue.main.asyncAfter(deadline: .now() + 3) { showCreate.toggle() } } label: { Text(buttonLabel) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to TipKit: "The filter function is not supported in this rule."
Please show more code. How did you declare viewedDetails ?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to UIButton action not called in UIHostingController
Just a guess without more code. Add addChild addChild(vc) // <<-- ADD THIS self.view.addSubview(button)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to UIButton action not called in UIHostingController
Please show complete, executable code so that one can test. We don't even know how SwiftUIView is defined.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Unable to add for review
You have changed nothing on your account, that's the problem. You have now to declare whether or not your are a trader (selling apps). Get details here: https://developer.apple.com/help/app-store-connect/manage-compliance-information/manage-european-union-digital-services-act-trader-requirements/ Não alterou nada na sua conta, é esse o problema. Tem agora de declarar se é ou não um comerciante (que vende aplicações). Para mais pormenores, consulte: https://developer.apple.com/help/app-store-connect/manage-compliance-information/manage-european-union-digital-services-act-trader-requirements/
Replies
Boosts
Views
Activity
May ’24
Reply to Alterar o idioma para PT(Português)
I hope I understand correctly your question. When you published on the AppStore, have you defined several languages (Portuguese and English for instance) ? Have you defined Portuguese as the main language ? If not do it with a new release of your app: https://stackoverflow.com/questions/10967722/change-default-language-for-app-listing-in-itunes-connect Quando publicaram na AppStore, definiram várias línguas (português e inglês, por exemplo)? Definiu o português como língua principal? Se não o fez, faça-o com uma nova versão da sua aplicação: https://stackoverflow.com/questions/10967722/change-default-language-for-app-listing-in-itunes-connect
Replies
Boosts
Views
Activity
May ’24
Reply to It can't be added for review
I amp confused by your iOS version numbers. It seems you have an existing 1.7.36 And now you try to create a 1.3.37, which is lower. The new version should be at least 1.7.37.
Replies
Boosts
Views
Activity
May ’24
Reply to Looking to use @AppStorage, but avoid depending on UserDefaults.standard
AFAIK, no way if userDefaults is a property of the model. Did you try to declare userDefaults as environment var instead ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to We need more RAM
Have you evaluated how much RAM you need for this project ? Or do you just want the max possible (to be future proof). Clearly intel based was flexible to upgrade RAM which M series are not at all.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Error: No exact matches in reference to static method 'buildExpression'
Please show complete code. Where and how is customToken defined ? Is it an optional ? If optional String, call should probably be: Auth.auth().signIn(withCustomToken: customToken ?? "") { user, error in // some code }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24