Use singleton with Realm Struct

I have a project with Swift 3, and I update to Swift 5, I deal with a lot of problems.
Now I have a problem like topic, I have problem to use singleton with Realm Struct.
After updated to Swift 5, I also updated RealmSwift to 5.5.1(original is 3.X.X) to solved “Primary key property ‘id’ does not exist on object”.
However, when I want to call the Struct RealmHelper, it will get error with this:
“Property FilterModel.type is declared as FilterType, which is not a supported managed Object property type. If it is not supposed to be a managed property, either add it to ignoredProperties() or do not declare it as @objc dynamic . See for more information.”
I don’t have any way to solve it.Now I use Xcode 13 with Swift 5.
This is my code:

`import RealmSwift`

    struct RealmHelper {
    static let sharedInstanse = RealmHelper()
    fileprivate let version: UInt64 = 0
    fileprivate var config: Realm.Configuration
    let realm: Realm

    private init() {
        do {
            config = Realm.Configuration(
                schemaVersion: version,
                migrationBlock: migration()
            Realm.Configuration.defaultConfiguration = config
            realm = try Realm(configuration: config)
        } catch let error {
            fatalError("Realm Error Can't Open : \(error)")
        }"Realm Path: \(config.fileURL!.absoluteString)", userInfo: Tag.sensitive.dictionary)

    func …

Thank you!

The issue appears to be with whatever class (FilterModel?) defines a property as FilterType.

However, that class is not included in the question - I would suggest adding it TO the question to make it more clear.

Also, there’s no problem using Singletons but the object in your current question is not a “Realm” Struct, it’s just a Struct.