Skip to content
This repository was archived by the owner on Feb 28, 2020. It is now read-only.
This repository was archived by the owner on Feb 28, 2020. It is now read-only.

Migrating 5.2 to 6.0.1 #183

@JakubLares

Description

@JakubLares

Hello, I am trying to migrate our project from version 5.2 to 6.0.1 and I am encountering some problems. Below is current code

import AlecrimCoreData
import CoreData
import CoreLocation

open class AbstractCoordinateCD: NSManagedObject {

    @NSManaged open var latitude: CLLocationDegrees
    @NSManaged open var longitude: CLLocationDegrees
}

// MARK: - AbstractCoordinateCD query attributes
extension AbstractCoordinateCD {

    static let latitude = AlecrimCoreData.Attribute<CLLocationDegrees>("latitude")
    static let longitude = AlecrimCoreData.Attribute<CLLocationDegrees>("longitude")
}

// MARK: - AttributeProtocol extensions
extension AlecrimCoreData.AttributeProtocol where Self.ValueType: AbstractCoordinateCD {

    var latitude: AlecrimCoreData.Attribute<CLLocationDegrees> { return AlecrimCoreData.Attribute<CLLocationDegrees>("latitude", self) }
    var longitude: AlecrimCoreData.Attribute<CLLocationDegrees> { return AlecrimCoreData.Attribute<CLLocationDegrees>("longitude", self) }
}

extension AlecrimCoreData.TableProtocol where Self.Element: AbstractCoordinateCD {

    func create(_ coordinate: CLLocationCoordinate2D) -> Self.Element {
        let retValue = create()
        retValue.latitude = coordinate.latitude
        retValue.longitude = coordinate.longitude
        return retValue
    }
}

extension AbstractCoordinateCD {

    var coordinate: CLLocationCoordinate2D {
        return CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
    }
}

In version 6.0.1 there is no AlecrimCoreData.Attribute, AlecrimCoreData.AttributeProtocol, AlecrimCoreData.TableProtocol ... maybe I am blind, but I don't find any alternatives in 6.0.1 version.
Can somebody help me please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions