This is so weird. Normally I could understand a class not being declared, but this is claiming the Object class itself is not declared. NSObject works, but the way my project is setup I need it to be a pure Swift Object. My class header looks like this:
import UIKit
import Foundation
class Person: Object {
I know foundation isn't really necessary, I just added it because I wasn't sure if that was causing me issues. The issue is occurring in both actual projects and playgrounds as well as in Xcode 6 and the latest Xcode 7 beta with Swift 2.0
if you are using Realm then import
import RealmSwift
Complete syntax of class.
import UIKit
import RealmSwift
class User: Object {
}
If you face any difficulty to implement this code. Watch below video Link: https://youtu.be/5Z8tBKwk6-c
Just remove : Object
. Pure Swift classes don't need to inherit from a superclass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With