swift - Get [String] from NSUserDefaults.standardUserDefaults().dictionaryRepresentation().keys -


nsuserdefaults.standarduserdefaults().dictionaryrepresentation().keys returns [nsobject] need (and expect) [string]. coffee i'm missing?

that returns lazybidirectionalcollection<mapcollectionview<dictionary<key, value>, key>>. can add .array array instance back, use map cast values string:

let keys = nsuserdefaults.standarduserdefaults().dictionaryrepresentation().keys.array.map { $0 string } println(keys) // [nslanguages, nsinterfacestyle, applelanguages] 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -