Last active
August 29, 2015 14:02
-
-
Save corosukeK/8ced080342cc50dcdd44 to your computer and use it in GitHub Desktop.
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 Hoge{ | |
init(){ | |
println("Hoge") | |
} | |
} | |
class Fuga{ | |
init(){ | |
println("Fuga") | |
} | |
} | |
class Homu{ | |
init(){ | |
println("Homu") | |
} | |
} | |
class JSONResponse{ | |
var responseString : String? = nil | |
func responseObject() -> String? | |
{ | |
return responseString | |
} | |
} | |
extension JSONResponse{ | |
func responseObject() -> Hoge? | |
{ | |
var response:String? = self.responseObject() | |
return Hoge() | |
} | |
} | |
extension JSONResponse{ | |
func responseObject() -> Fuga? | |
{ | |
return Fuga() | |
} | |
} | |
extension JSONResponse{ | |
func responseObject() -> Homu? | |
{ | |
return Homu() | |
} | |
} | |
var response = JSONResponse() | |
var hoge:Hoge? = response.responseObject() | |
var fuga:Fuga? = response.responseObject() | |
var homu:Homu? = response.responseObject() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment