You can have many values ββfor the case, all you have to do is separate them with a comma.
I would also recommend returning nil than an empty string, and making the return function String ?, but that depends on how the function is used.
func update(key:UserInfosKey, value:String, context:UserDefaultsMainKeys) -> String? { switch key { case .CameraICloudActivated, .CameraICloudShare, .CameraMyPhotoStream, .CameraPhotosCount, .NetworkConnection, .PhoneLanguage, .UserIdentifier: return value default: return nil } }
Cenny
source share