# Instances in programming with swift

**URL:** <https://forums.kodeco.com/t/instances-in-programming-with-swift/40393>\
**Category:** Swift\
**Created:** [March 18, 2018, 12:12am UTC](https://forums.kodeco.com/t/instances-in-programming-with-swift/40393 "2018-03-18T00:12:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![miraz16](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@miraz16](https://forums.kodeco.com/u/miraz16)\
**Post date:** [March 18, 2018, 12:12am UTC](https://forums.kodeco.com/t/instances-in-programming-with-swift/40393/1 "2018-03-18T00:12:40Z")

</div>

im currently doing the programming in swift course and they often time use the word instance, for example they would say “instance of the class” and i’ve been trying to google what it means, but havent found a definitive answer.

---

<div class="post-metadata">

**Author:** ![jayantvarma](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jayantvarma/32/111768_2.png) [@jayantvarma](https://forums.kodeco.com/u/jayantvarma)\
**Post date:** [March 18, 2018, 11:25am UTC](https://forums.kodeco.com/t/instances-in-programming-with-swift/40393/2 "2018-03-18T11:25:05Z")

</div>

Hi @miraz16,  
Google has plenty of links with the answer to your question. Anyways, to answer your question,

a Class is a definition, something like a blue print, specifications. However when an object is created from this class definition, it is called an instance.

Cheers,

Jayant

---

<div class="post-metadata">

**Author:** ![7stud](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/7stud/32/81494_2.png) [@7stud](https://forums.kodeco.com/u/7stud)\
**Post date:** [March 19, 2018, 3:12am UTC](https://forums.kodeco.com/t/instances-in-programming-with-swift/40393/3 "2018-03-19T03:12:33Z")

</div>

```
import UIKit

class Dog {
    func bark() {
        print("Woof, woof!")
    }
}

let d = Dog()
d.bark()

--output:--
Woof, woof!

```

d is an instance of the class Dog. It is also said that d is an object of class Dog.

---

<div class="post-metadata">

**Author:** ![jessycatterwaul](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jessycatterwaul/32/110937_2.png) [@jessycatterwaul](https://forums.kodeco.com/u/jessycatterwaul)\
**Post date:** [March 20, 2018, 5:15am UTC](https://forums.kodeco.com/t/instances-in-programming-with-swift/40393/4 "2018-03-20T05:15:05Z")

</div>

Instances are _of_ a type: the options I can think of are class, struct, enum, tuple, and closure. An object is specifically a class instance. (It’s a decades-old term from when classes were new.)

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [August 31, 2018, 4:13pm UTC](https://forums.kodeco.com/t/instances-in-programming-with-swift/40393/5 "2018-08-31T16:13:57Z")

</div>

Closed on August 31, 2018, 4:13pm UTC

This topic was automatically closed after 166 days. New replies are no longer allowed.
