In the past I always used
override fun viewDidLoad()
// Initialisation of my views
self.label.text = "text"
self.imageView.image = UIImage( named: "image" )
// Initialisation of my models
self.videoRecorder = VideoRecorder()
The reason people usually do not do this is because view controllers often get instantiated from storyboards and xib files. When that is the case, the normal
init is not called. Instead
initiWithCoder: is used and then any properties marked with
IBOutlet are set accordingly.
Note that this very often makes initializing properties redundant, as they tend to be set via
IBOutlet as well.
So if you want your view controller to properly work also when just using it with init, ensure you won't have troubles when it's used from a storyboard (unless you're absolutely certain that will never happen), you would most likely have to implement both,
initWithCoder:. I have seen a lot of people running into problems because they expected a property set in
init to be there in
viewDidLoad (when loading the controller from a storyboard).
Because of all this, most programmers don't bother about
init and rely on
viewDidLoad, because that is definitely called at some point. Writing a proper "both ways usable" controller is just more code.