Timothy's answer is right, but it's better to adjust the code with the Swift update.
logInViewController.fields = PFLogInFields(rawValue: PFLogInFieldsUsernameAndPassword.rawValue | PFLogInFieldsLogInButton.rawValue)
The second way:
You can use operator overloading for shorter code:
func +=(inout slf: PFLogInFields,other: PFLogInFields)-> PFLogInFields{ slf = PFLogInFields(rawValue: slf.rawValue | other.rawValue)! } func +(a: PFLogInFields, b: PFLogInFields)-> PFLogInFields{ return PFLogInFields(rawValue: a.rawValue | b.rawValue)! }
And further:
logInViewController.fields = .UsernameAndPassword + .LogInButton
or
logInViewController.fields = .UsernameAndPassword logInViewController.fields += .LogInButton
fnc12
source share