Post

Replies

Boosts

Views

Activity

Reply to Swift 6 conversion for IBOutlet
MainActor.assumeIsolated seems the simplest way to go. I have noticed an important point when converting to Swift 6 which may help others. At some point, I had nearly 200 errors… Don't panic they say… Problem was that errors kept coming and disappearing. Just as if the compiler was a bit lost (and me with him) with all the changes occurring on classes or func (such as declaring MainActor or non isolated). This made error correction pretty erratic. I did a Clean build folder, and the number of errors dropped to less than 10.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’25
Reply to Range For Keys and Values Of Dictionary
You may build something custom. Just for illustration: typealias FruitDict = [String: (String, Int)] let myFruitBasket : FruitDict = ["apple":("red", 1), "banana": ("yellow", 2), "budbeeri": ("dark violet", 3), "chikoo": ("brown", 4)] func subBasket(_ basket: FruitDict, range: ClosedRange<Int>) -> [String: String] { let filtered = basket.filter { $0.value.1 >= range.lowerBound && $0.value.1 <= range.upperBound } let sub = filtered.mapValues{ value in value.0 } return sub } let sub: [String: String] = subBasket(myFruitBasket, range: 1...3) print(sub) print("keys: ", sub.keys) print("values", sub.values) You get: ["banana": "yellow", "apple": "red", "budbeeri": "dark violet"] keys: ["banana", "apple", "budbeeri"] values ["yellow", "red", "dark violet"] Of course, that's not ordered (order does not mean anything with dictionaries), as Quinn explained. But if you plan to use the result as a dictionary, that doesn't matter. To get ordered, you have to convert to array. Or you can compute: let sortedKeys = sub.keys.sorted() print("sorted keys: ", sortedKeys) for key in sortedKeys { print("sorted values", sub[key] ?? "") } And get sorted keys: ["apple", "banana", "budbeeri"] values red values yellow values dark violet
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’25
Reply to Using Dynamic Member Lookup in a Superclass
Interesting question (would like to see the solution), so my 1 cent contribution. Sorry if it is worthless. In The Swift Programming Language (Swift 5.7) : struct Point { var x, y: Int } @dynamicMemberLookup struct PassthroughWrapper<Value> { var value: Value subscript<T>(dynamicMember member: KeyPath<Value, T>) -> T { get { return value[keyPath: member] } } } let point = Point(x: 381, y: 431) let wrapper = PassthroughWrapper(value: point) print(wrapper.x) Have you tried to mimic this, by adding a value property in ElectronicComponent and calling PassthroughWrapper(value: resistorA) ?
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’25
Reply to How to publish medical app being a sole proprietorship?
has not responded to my request to switch to an organization account Who did you ask ? Did you contact support for help ? If that may help: https://help.uscreen.tv/en/articles/8284333-convert-apple-developer-account-from-individual-to-business https://ptwired.zendesk.com/hc/en-us/articles/360046161214-Change-your-Apple-Developer-Account-from-Individual-to-Organization
Aug ’25
Reply to Guideline 4.3(a) - Design - Spam
Guideline 4.3 is pretty explicit: Don’t create multiple Bundle IDs of the same app. If your app has different versions for specific locations, sports teams, universities, etc., consider submitting a single app and provide the variations using in-app purchase. That seem to be precisely your case. Another thought: I don't know if it is the cause, but there is a Babbel app to train for foreign languages. The name of your app appears pretty close to it.
Jul ’25
Reply to Swift 6 conversion for IBOutlet
MainActor.assumeIsolated seems the simplest way to go. I have noticed an important point when converting to Swift 6 which may help others. At some point, I had nearly 200 errors… Don't panic they say… Problem was that errors kept coming and disappearing. Just as if the compiler was a bit lost (and me with him) with all the changes occurring on classes or func (such as declaring MainActor or non isolated). This made error correction pretty erratic. I did a Clean build folder, and the number of errors dropped to less than 10.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Range For Keys and Values Of Dictionary
You may build something custom. Just for illustration: typealias FruitDict = [String: (String, Int)] let myFruitBasket : FruitDict = ["apple":("red", 1), "banana": ("yellow", 2), "budbeeri": ("dark violet", 3), "chikoo": ("brown", 4)] func subBasket(_ basket: FruitDict, range: ClosedRange<Int>) -> [String: String] { let filtered = basket.filter { $0.value.1 >= range.lowerBound && $0.value.1 <= range.upperBound } let sub = filtered.mapValues{ value in value.0 } return sub } let sub: [String: String] = subBasket(myFruitBasket, range: 1...3) print(sub) print("keys: ", sub.keys) print("values", sub.values) You get: ["banana": "yellow", "apple": "red", "budbeeri": "dark violet"] keys: ["banana", "apple", "budbeeri"] values ["yellow", "red", "dark violet"] Of course, that's not ordered (order does not mean anything with dictionaries), as Quinn explained. But if you plan to use the result as a dictionary, that doesn't matter. To get ordered, you have to convert to array. Or you can compute: let sortedKeys = sub.keys.sorted() print("sorted keys: ", sortedKeys) for key in sortedKeys { print("sorted values", sub[key] ?? "") } And get sorted keys: ["apple", "banana", "budbeeri"] values red values yellow values dark violet
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Using Dynamic Member Lookup in a Superclass
Interesting question (would like to see the solution), so my 1 cent contribution. Sorry if it is worthless. In The Swift Programming Language (Swift 5.7) : struct Point { var x, y: Int } @dynamicMemberLookup struct PassthroughWrapper<Value> { var value: Value subscript<T>(dynamicMember member: KeyPath<Value, T>) -> T { get { return value[keyPath: member] } } } let point = Point(x: 381, y: 431) let wrapper = PassthroughWrapper(value: point) print(wrapper.x) Have you tried to mimic this, by adding a value property in ElectronicComponent and calling PassthroughWrapper(value: resistorA) ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to New App Submission - Current Wait Time Approaching a Month
Welcome to the forum. So your wait time is about 1 week 1/2, not a month… I suspect reviewer is specially cautious about this type of app and how it is moderated. IMHO that's a legitimate concern. As it too 2 weeks the first time, wait for a few more days. After that, if no news, you could contact support. PS: avoid to duplicate posts.
Replies
Boosts
Views
Activity
Aug ’25
Reply to How to publish medical app being a sole proprietorship?
has not responded to my request to switch to an organization account Who did you ask ? Did you contact support for help ? If that may help: https://help.uscreen.tv/en/articles/8284333-convert-apple-developer-account-from-individual-to-business https://ptwired.zendesk.com/hc/en-us/articles/360046161214-Change-your-Apple-Developer-Account-from-Individual-to-Organization
Replies
Boosts
Views
Activity
Aug ’25
Reply to Detecting iOS screen sharing
Could you detect the green dot that's close to the notch or in Dynamic Island ? But maybe the simplest is to check if camera is active: https://stackoverflow.com/questions/16460705/check-which-camera-is-currently-in-use-in-ios-application
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Guideline 4.3(a) - Design - Spam
Guideline 4.3 is pretty explicit: Don’t create multiple Bundle IDs of the same app. If your app has different versions for specific locations, sports teams, universities, etc., consider submitting a single app and provide the variations using in-app purchase. That seem to be precisely your case. Another thought: I don't know if it is the cause, but there is a Babbel app to train for foreign languages. The name of your app appears pretty close to it.
Replies
Boosts
Views
Activity
Jul ’25