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 VStack initialization without parentheses
More details here, in Swift Programming language (functions & closures): « A closure passed as the last argument to a function can appear immediately after the parentheses. When a closure is the only argument to a function, you can omit the parentheses entirely. » The Swift Programming Language (Swift 5.7)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’24