Programatically change view controller when button clicked

I'm getting started with macOS development and I'm trying to implement a button which switches to another view controller. I don't want to use a segue for this as it is a login button. I would like to do it the same as iOS where you push the view controller. Is there a similar method for macOS? Can't seem to find anything that helps.


Thanks

Replies

There isn't anything like a standard navigation controller on macOS, but to get login information, a sheet (NSSheet) would be a likely candidate for something like this. It's basically the same idea as modal presentation on iOS. The sheet appears on top of an existing window, so it blocks the user from doing anything to the window underneath.