You can really do this "Super Directly"
But for a property in a class (or struct even in Swift), you can use @selector, to fetch the VALUE of the property, using a String, if you use Setters/Getters...
But no you can't really CREATE a variable with on the fly, but as others have said USE A DICTIONARY!
For instance
var myOnTheFlyHeap: [String : Any] = [ : ], or [String : Any?]
and just throw something in!
myOnTheFlyHeap["person1"] = "Johnny Appleseed"
Laters...
Topic:
Programming Languages
SubTopic:
Swift
Tags: