I want to assign a color to each instance of the "Subject" class but it seems like I can't assign a type "Color" or "UIColor" to the variable "color",
import Foundation
class Subject {
var name: String
var color: NSObject
init(name: String, color: NSObject) {
self.name = name
self.color = color
}
I worked around the problem by using NSObject but in the future i would like to add a Realm database to my application and i can't use NSObject