ios - Passing a swift class to objective c with segue -


i have vc1 has this:

if segue.identifier == "toaccountsummary" {     let secondviewcontroller = segue.destinationviewcontroller as! dynamicsummarytableviewcontroller     secondviewcontroller.firstname1 = self.account.firstname1  } 

plus:

vc2.h:

@property (strong, nonatomic) nsstring *firstname1; 

and passes string swift objective c fine. want pass whole class contains variables.

my class looks in swift:

class account {      var firstname1 = ""     var lastname1 = ""     var accountnumber = ""     var address1 = ""     var address2 = ""     var city = "" ... } 

i dont know how accept on objective c side , example, print

account.address1 

you have subclass nsobject objective-c work swift.

class account: nsobject {     var firstname1 = ""     var lastname1 = ""     var accountnumber = ""     var address1 = ""     var address2 = ""     var city = "" } 

in objective-c file, want import swift header, so:

#import "project-swift.h" 

where "project" name of project.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -