Swift — Creating a view without storyboard
I know it is easy to build a single view application with storyboard. Xcode practically sets up everything for you. I will let you google the reasons why you should stop using storyboard. I’m just going to show you how to set one up to match what Apple creates for you.

After creating the project, go into Project->Targets->Deployment Info, delete the word “Main” from Main Interface.

Next, delete Main.storyboard.

Now, you need add the code to draw the window, make it key and visible, and set ViewController.swift as the root view controller in AppDelegate.swift to create the view. This is the code:
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
window?.rootViewController = ViewController()

Feel free to read up on Apple’s documentation on UIWindow to learn about the methods used in the code.
Now, go to ViewController.swift and change the background to white so it matches what Apple gave you in storyboard.
view.backgroundColor = .white

At this point, you are done. If you run the app now, you will have a blank white screen in the simulator, exactly the same thing Apple provides you with storyboard.

But you ask, how do I add buttons, text fields, image views? All programmatically. I won’t cover all that in this post, but here’s a small snippet of code to show you how to add a text field in ViewController.swift.
// In ViewController class, outside of any methods
let textField = UITextField(frame: CGRect(x: 0, y: 10, width: 200, height: 40))
// In ViewDidLoad() method
textField.text = “Hello World”
view.addSubview(textField)

This is how it looks.

That’s it. Of course there’s a lot more to it: Using layout anchors to set constraint; Changing the font type, font size and color; Adding targets. The list goes on. But this is a good start.
