Declare a class with inheritance


I have a parent class and want to create another one which "inherits" it.


// Create 'parent' class
class Animal {

	func sayHello() {

// Create a child class
// which 'inherits' our parent class
class Dog : Animal {


// Create a new Dog instance
let myDog = Dog()

// We can also access its parent's methods

Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)