The problem TL;DR: A String I'm trying to bind to inside TextField is nested in an Optional type, therefore I cannot do that in a straightforward man ...
The problem TL;DR: A String I'm trying to bind to inside TextField is nested in an Optional type, therefore I cannot do that in a straightforward man ...
Following the documentation of OptionalBinder An API to bind optional values, optionally with a default value. OptionalBinder fulfills two roles: ...
I want to iterate over an array String?, String repeated pair but I cannot form the "for case let (a,b) in array" correctly. The best I have come up ...
I want to reference a variable to a specific function. However, there is an error called Value of type 'UIView' has no member 'lineTo' Clearly, the wh ...
I want to check if two optional variables are all null. For example, in C, Is there any way to do this in Swift? ...
My class contains optional member properties like this: When I initialize and want to use these variables, I end up having to do something like thi ...
After updating xCode to version 10 (and swift 4.2), I have a strange behaviour on optional bindings The code is below, and it ´s about reading json f ...
I'm working through an OAuth tutorial that uses the Locksmith framework to store tokens. The tutorial is written in an older version of Swift and also ...
I'm creating a function in swift to check the if non optional value return nil. My aim is just to handle that exception and avoid app crash for unexpe ...
I have this following code in my swift project When i run this code it gives me an error on if line that reads: I tried adding ? after .devices, ...
I want to avoid the double nested if. but I get the unresolved identifier compiler error if I do that. Is there any way to make this condition ...
I've seen in Swift 3.1 documentation that you can include several optional bindings in an if statement separated by commas, and that it behaves like a ...
I am just transitioning from Objective-C to Swift and have been constantly writing the following code for optional binding, My question is I have t ...
In swift you can use a cool feature of the switch statement in prepare(segue:) to create cases based on the type of the destination view controller: ...
While encoding JSON, I´m unwrapping stuff with an if let statement, but I'd like to make a variable globally available Is this even possible? If it ...
I'm having trouble with some Swift Optional Binding with a cast into a protocol. I have the following code in a playground that works fine. I'm usi ...
I have a piece of code that runs if a switch has been set in settings as follows: My problem is if the switch has never been activated the program ...
I have a child module called ChildPlugin and I inject classes from main module as follows: The problem is that I don't know whether the main module ...
The code above introduces the error below; Value of optional type 'String?' not unwrapped; did you mean to use '!' or '?'? As can be seen in ...
Okay, so I know the normal way to use optionals in Swift is via optional bindings to unwrap them, like so... But I've also seen the following way u ...