Post

Replies

Boosts

Views

Activity

Reply to Double question mark
What is the context of your question ? In the developers forum ?? In Swift (nil coalescing operator) => explained in detail in Swift language « Nil-Coalescing Operator The nil-coalescing operator (a ?? b) unwraps an optional a if it contains a value, or returns a default value b if a is nil. The expression a is always of an optional type. The expression b must match the type that is stored inside a. The nil-coalescing operator is shorthand for the code below: a != nil ? a! : b The code above uses the ternary conditional operator and forced unwrapping (a!) to access the value wrapped inside a when a is not nil, and to return b otherwise. The nil-coalescing operator provides a more elegant way to encapsulate this conditional checking and unwrapping in a concise and readable form. NOTE If the value of a is non-nil, the value of b is not evaluated. This is known as short-circuit evaluation.» « The Swift Programming Language » Apple Books. other ?
Dec ’21
Reply to NumberFormatter on iOS 15
I tested with Xcode 13.2ß2 in Playground. Effectively get the same result as you. I changed for this: let formatter = NumberFormatter() formatter.usesSignificantDigits = true formatter.minimumSignificantDigits = 18 formatter.maximumSignificantDigits = 20 let number = NSDecimalNumber(string: "6.381569271192148411") let result = formatter.string(from: number) print("result", result!) I get: result 6.381569271192148411 So correct result, but don't know what changed in API in iOS 15. Could ask support.
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’21
Reply to Swift Version?
I am getting an error: Value of type URL has no member 'withQueries' Where did you read that URL had a withQueries func ? To know Swift version, open the Project > Build settings and search for Swift. But that should not be the cause of the error.
Topic: App & System Services SubTopic: General Tags:
Dec ’21
Reply to Access a raw value for pure enum without using associated type
I do not have the problem. So may be I miss something in your question. I tested the following (Xcode 13, Playground): enum Taxon { case common(name: String) case genus(name: String) case species(name: String) case subspecies(name: String) case group(name: String) case cultivar(name: String) case variety(name: String) case extended(name: String) var typeName: String { switch self { case .common: return "Common" case .genus: return "Genus" case .species: return "Species" case .subspecies: return "Subspecies" case .group: return "Group" case .cultivar: return "Cultivar" case .variety: return "Variety" case .extended: return "Taxonomny" } } var formatted: String { switch self { case .common(let name): return name.capitalized case .genus(let name): return name.capitalized case .species(let name): return name.lowercased() case .subspecies(let name): return String(format: "ssp. %@", name) case .group(let name): return String(format: "(%@ Group)", name) case .cultivar(let name): return String(format: "cv. %@", name) case .variety(let name): return String(format: "var. %@", name) case .extended(let name): return name.capitalized } } } let taxon : Taxon = .common(name: "hello") // not capitalized print("taxon", taxon.formatted) switch taxon { case .common(let name): print("switch name", name, "formatted", taxon.formatted) default: break } // or equivalent if case let .common(name) = taxon { print("case let", name) } I get the expected results: taxon Hello switch name hello Hello case let hello
Topic: App & System Services SubTopic: General Tags:
Dec ’21
Reply to xcode 13.1, can't find IOS 15.1
I'm working on an app, and it not working after updating ios to 15.1, What is not working ? Does it crash ? What error you get ? . no ios version 15.1 was found my app is stuck on this and can't be uploaded to the store I do not understand why not finding iOS 15.1 simulator forbids to upload ? Is it because you want to test on 15.1 ? In Xcode13.1 we have iOS 15.0, on xCode 13.2 we have iOS 15.2. Can't you use one of them for testing ?
Dec ’21
Reply to Double question mark
What is the context of your question ? In the developers forum ?? In Swift (nil coalescing operator) => explained in detail in Swift language « Nil-Coalescing Operator The nil-coalescing operator (a ?? b) unwraps an optional a if it contains a value, or returns a default value b if a is nil. The expression a is always of an optional type. The expression b must match the type that is stored inside a. The nil-coalescing operator is shorthand for the code below: a != nil ? a! : b The code above uses the ternary conditional operator and forced unwrapping (a!) to access the value wrapped inside a when a is not nil, and to return b otherwise. The nil-coalescing operator provides a more elegant way to encapsulate this conditional checking and unwrapping in a concise and readable form. NOTE If the value of a is non-nil, the value of b is not evaluated. This is known as short-circuit evaluation.» « The Swift Programming Language » Apple Books. other ?
Replies
Boosts
Views
Activity
Dec ’21
Reply to NumberFormatter on iOS 15
I tested with Xcode 13.2ß2 in Playground. Effectively get the same result as you. I changed for this: let formatter = NumberFormatter() formatter.usesSignificantDigits = true formatter.minimumSignificantDigits = 18 formatter.maximumSignificantDigits = 20 let number = NSDecimalNumber(string: "6.381569271192148411") let result = formatter.string(from: number) print("result", result!) I get: result 6.381569271192148411 So correct result, but don't know what changed in API in iOS 15. Could ask support.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to System data take too much storage
There have been a lot of similar report. Maybe this other thread can help: https://developer.apple.com/forums/thread/693918 h t t p s : / / w w w.fonehow.com/iphone-system-storage-too-high/
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Swift Version?
I am getting an error: Value of type URL has no member 'withQueries' Where did you read that URL had a withQueries func ? To know Swift version, open the Project > Build settings and search for Swift. But that should not be the cause of the error.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Access a raw value for pure enum without using associated type
Where exactly do you get the error message ?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Scroll two collection view at one time, bug IOS 15
Did you solve the issue ? If not, could you explain what is different from the set up I tested ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Access a raw value for pure enum without using associated type
I do not have the problem. So may be I miss something in your question. I tested the following (Xcode 13, Playground): enum Taxon { case common(name: String) case genus(name: String) case species(name: String) case subspecies(name: String) case group(name: String) case cultivar(name: String) case variety(name: String) case extended(name: String) var typeName: String { switch self { case .common: return "Common" case .genus: return "Genus" case .species: return "Species" case .subspecies: return "Subspecies" case .group: return "Group" case .cultivar: return "Cultivar" case .variety: return "Variety" case .extended: return "Taxonomny" } } var formatted: String { switch self { case .common(let name): return name.capitalized case .genus(let name): return name.capitalized case .species(let name): return name.lowercased() case .subspecies(let name): return String(format: "ssp. %@", name) case .group(let name): return String(format: "(%@ Group)", name) case .cultivar(let name): return String(format: "cv. %@", name) case .variety(let name): return String(format: "var. %@", name) case .extended(let name): return name.capitalized } } } let taxon : Taxon = .common(name: "hello") // not capitalized print("taxon", taxon.formatted) switch taxon { case .common(let name): print("switch name", name, "formatted", taxon.formatted) default: break } // or equivalent if case let .common(name) = taxon { print("case let", name) } I get the expected results: taxon Hello switch name hello Hello case let hello
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to How can i save Angle and [Color] to UserDefaults ?
Where and how did you declare Angle and Colors ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to How to pass model object from view controller to app delegate? iOS Swift
Did you try to use notification with user payload ? And have AppDelegate subscribe to this notification in didFinishLaunching? NotificationCenter.default.addObserver(self, selector: #selector(someFunc(_:)), name: Notification.Name("someNotification"), object: nil) @objc func someFunc(_ sender: Notification) { }
Replies
Boosts
Views
Activity
Dec ’21
Reply to Hiding Application Name over Toolbar?
Did you check in the Attributes Inspector if you have a title or not for the window ? If so, remove it (and hit Return)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Cannot convert value of type 'ChooseModel.Angle' to expected argument type 'Angle'
That's a similar post to your previous one. Could you answer to this previous post first ? That will help and is more correct than just ignoring replies you got. Thanks.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to xcode 13.1, can't find IOS 15.1
I'm working on an app, and it not working after updating ios to 15.1, What is not working ? Does it crash ? What error you get ? . no ios version 15.1 was found my app is stuck on this and can't be uploaded to the store I do not understand why not finding iOS 15.1 simulator forbids to upload ? Is it because you want to test on 15.1 ? In Xcode13.1 we have iOS 15.0, on xCode 13.2 we have iOS 15.2. Can't you use one of them for testing ?
Replies
Boosts
Views
Activity
Dec ’21
Reply to Refunds, Fraud Problems
Yes, it would be interesting to have precise information on the return process and rules.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Captcha spins forever on safari
Check your Privacy settings. May have to change some (IP masking for tracking). Read here, for related (not exactly the same) problems: https://discussions.apple.com/thread/253419426
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Cannot convert value of type 'ChooseModel.Angle' to expected argument type 'Angle'
Did you try to make Angle Codable: extension Angle: Codable { public init(from decoder: Decoder) throws { self.init() } public func encode(to encoder: Encoder) throws { } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21