Skip to content

Instantly share code, notes, and snippets.

@NorrinRadd
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NorrinRadd/56d212e4996561df060f to your computer and use it in GitHub Desktop.
Save NorrinRadd/56d212e4996561df060f to your computer and use it in GitHub Desktop.
let p = UILabel()
var prompt: NSString?
p.text = (prompt != nil) ? prompt! : "This is a prompt question"
let enter = UIButton.buttonWithType(UIButtonType.System) as UIButton
let bt = (buttonText != nil) ? buttonText : "Enter"
enter.setTitle(bt, forState: UIControlState.Normal)
var buttonTextColor: UIColor?
(buttonTextColor != nil) ? enter.setTitleColor(buttonTextColor, forState: UIControlState.Normal) : {};
AGViewControllerSwift.swift:10:26: Could not find an overload for '!=' that accepts the supplied arguments
/* an error is expected, i supposed
* but the error given is wrong.
* the error should indicate the two branches of the ternary operator don't match in type
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment