I get one compiler error when I try to create one object in my xcode project. This is the code:
import UIKit class Rectangulo: NSObject { var ladoA : Int var ladoB : Int var area: Int { get { return ladoA*ladoB } } init (ladoA:Int,ladoB:Int) { self.ladoA = ladoA self.ladoB = ladoB } func description() -> NSString { return "El area es \(area)" } }
Error during compilation:
Rectangulo.swift:26:10: Method 'description()' with Objective-C selector 'description' conflicts with getter for 'description' from superclass 'NSObject' with the same Objective-C selector
What do I need to do to override this function without problems?
source share