Declare a class


I want to create a new class and create a new instance of it.


// Declare our new class

class myClass {
    init() {
        // Called when a new object is created
        print("A new instance was created!")

// Create a new object of myClass
let c = myClass()


Find answers here

Hi there! Ask Us a Question We are ready to help