[Feature] Locations list #10

Merged
javier merged 13 commits from feature/locations-list into main 2023-04-12 16:58:28 +00:00
3 changed files with 58 additions and 1 deletions
Showing only changes of commit 543417744b - Show all commits

View File

@ -0,0 +1,21 @@
//
// Location+CoreDataClass.swift
// Locations
//
// Created by Javier Cicchelli on 12/04/2023.
// Copyright © 2023 Röck+Cöde. All rights reserved.
//
//
import Foundation
import CoreData
@objc(Location)
public class Location: NSManagedObject {
convenience init(context: NSManagedObjectContext) {
self.init(
entity: .entity(forEntityName: "Location", in: context)!,
insertInto: context
)
}
}

View File

@ -0,0 +1,36 @@
//
// Location+CoreDataProperties.swift
// Locations
//
// Created by Javier Cicchelli on 12/04/2023.
// Copyright © 2023 Röck+Cöde. All rights reserved.
//
//
import Foundation
import CoreData
extension Location {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Location> {
return NSFetchRequest<Location>(entityName: "Location")
}
@NSManaged public var createdAt: Date
@NSManaged public var latitude: Float
@NSManaged public var longitude: Float
@NSManaged public var name: String?
@NSManaged public var source: LocationSource
}
// MARK: - Identifiable
extension Location: Identifiable {}
// MARK: - Enumerations
@objc public enum LocationSource: Int16 {
case remote = 0
case local
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="21754" systemVersion="22E261" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="Location" representedClassName="Location" syncable="YES" codeGenerationType="class">
<entity name="Location" representedClassName="Location" syncable="YES">
<attribute name="createdAt" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="latitude" attributeType="Float" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="longitude" attributeType="Float" defaultValueString="0.0" usesScalarValueType="YES"/>