Created
March 17, 2015 15:36
-
-
Save krzyzanowskim/1722bcd1c4ba665bf087 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import Foundation | |
| public class Foo { | |
| private var key:NSData | |
| private var goo:NSData? | |
| public init(key: NSData) { | |
| self.key = key | |
| self.goo = nil | |
| } | |
| convenience init?(keyy:String, gooo:String) { | |
| let kkey = keyy.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) | |
| let ggoo = gooo.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) | |
| if let kkey = kkey, let ggoo = ggoo | |
| { | |
| self.init(key:kkey) | |
| } else { | |
| return nil | |
| } | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rdar://problem/20193929