This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car { | |
private let brand: String | |
var owner: Owner? | |
init(brand: String) { | |
self.brand = brand | |
} | |
deinit { print("Car deallocated") } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
/// | |
/// A file reader class. | |
/// | |
/// - Note: Here we will decode JSON data from a static file contaning Movies. | |
/// | |
final class FileReader { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// MARK: - A node | |
final class Node { | |
/// Value of the node | |
var value: Int | |
/// Left child node | |
var left: Node? |