I am bit confused If any memory related issue happen when I declare classes like below by using Swift programming language, The main purpose is to reduce real-time compile process. Because my system goes very slow If I declare class globally that is using in only one class.
class Person {
private var edu: Education? //network sync
let name: String
init(name: String) {
self.name = name
}
private class Education { }
}
Here I used above class person
class SectionA {
let amy: Person = .init(name: "Amy")
let rachel: Person = .init(name: "Rachel")
let sarah: Person = .init(name: "Sarah")
let jack: Person = .init(name: "Jack")
}
What I am worried about is with class Education. Is the above class Person can take more process or memory than declaring class Education outside of Person like below?
class Person {
private var edu: Education?
let name: String
init(name: String) {
self.name = name
}
}
class Education { }
Thank you!