Swift generic class initializer -
i found problem designing result class in swift struct result<t>{ private let data: t? let error: nserror? var issuccess: bool { { return data != nil } } init(data: t) { self.data = data self.error = nil } init(error: nserror) { self.data = nil self.error = error } } usage should this result(data: "something") // t string the problem occurs when want pass error result(error: errorfromsomewhere) //t not specified below real application usage: class parseregistrationprovider: registrationprovider { func register(model: registrationform) -> promise<result<string>> { return promise { accept, reject in let user = pfuser() user.username = model.nickname user.password = model.password user.email = model.emailadreess user.signupinbackgroundwithblock({ (issuccess, error) -> void i...