class baseclass {
init() {
counter++;
}deinit {
counter--;
}
}var print: baseclass? = baseclass()println(counter)
println(counter)When we run the above program using playground, we get the following result:
1
1 class baseclass {
init() {
counter++;
}deinit {
counter--;
}
}var print: baseclass? = baseclass()println(counter)
println(counter)When we run the above program using playground, we get the following result:
1
1