I am new to Swift and would like to initialize an object\'s member variable using an instance method like this:
class MyClass { var x: String var y: Stri
You can use in this approach
class MyClass: NSObject {
let x: String var y: String init(x: String) { self.x = x self.y = self.x + "_test" print(self.x) print(self.y) } }