In general your idea is correct, but there are a few possible bugs/pitfalls here
A few notes inline.
(you can use the preformatted block feature of the editor here to format code by the way)
class ViewController: UIViewController, TTSDKDelegate {
// In Swift it is customary to start variable names with lower case letters.
// Of course you are free to deviate from this convention and use your preferred style
//
// You are never actually assigning an instance here.
// Is this intentional?
var ttObject : TTLock!
// If `ttObject` will be passed in from the outside you could just
// make it a regular `Optional` (`TTLock?`) to be on the safe side.
override func viewDidLoad() {
super.viewDidLoad()
// If `ttObject` was never assigned an actual instance of type `TTLock`
// this following line will try to set the `delegate` on something that is `nil` and crash.
// Also, the compiler knows that `self` is a `TTSDKDelegate`, as you told it in your
// first line where you declare the ViewController.
// So you can remove the `as TTSDKDelegate` here.
ttObject.delegate = self as TTSDKDelegate
}
}