Created
July 23, 2014 08:01
-
-
Save m1entus/2b87b2ac70f25bbdf0b6 to your computer and use it in GitHub Desktop.
Swift NSDateFormatter singleton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class var userDateFormatter : NSDateFormatter { | |
struct Static { | |
static let instance: NSDateFormatter = { | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" | |
return dateFormatter | |
}() | |
} | |
return Static.instance | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment