---
title: "#1: View Controller Initialization 🚀"
url: https://littlebitesofcocoa.com/1-view-controller-initialization
author: Jake Marsh
date: 2015-05-18
published: 2015-05-18
topics: ["UIKit","Swift"]
description: "So, we're crafting our brand new view controller and BAM! we see this: Let's try to break down how we got here: Subclasses only inherit their superclass's..."
---

# #1: View Controller Initialization 🚀

By Jake Marsh, May 18, 2015. HTML: https://littlebitesofcocoa.com/1-view-controller-initialization

So, we're crafting our brand new **view controller** and <span style='color: red'>**BAM!**</span> we see this:

<center>
<img src="https://media.littlebitesofcocoa.com/bite-assets/001-view-controller-init-screenshot.png" style="max-width: 507px;" />
</center>

Let's try to break down how we got here:

**Subclasses** only inherit their **superclass's initializers** <i>if certain conditions are met</i>.

If our **subclass** doesn't define any **designated initializers**, it automatically inherits **all** of its **superclass's designated initializers**.

If not though, <span style='color: red'>**then it inherits none of them.**</span>

We subclassed **UIViewController**.

**UIViewController** implements **NSCoding**. 

**NSCoding** requires `init(coder:)` be implemented.

By default **UIViewController** implements `init(coder:)` for us, and we don't need to do a thing.

But now, we defined our own new **designated initalizer** called `init()`, so we've stopped meeting the conditions for inheriting all of our **superclass's designated initializers**, and now have to override, implement and properly call `super` on `init(coder:)` all by ourselves!
