Downloads, resigns, and installs apps from start to finish

This commit is contained in:
Riley Testut
2019-05-31 18:24:08 -07:00
parent 87ac2799be
commit 8513c8242c
15 changed files with 590 additions and 113 deletions

View File

@@ -2,6 +2,7 @@
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="14490.99" systemVersion="18D109" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="App" representedClassName="App" syncable="YES">
<attribute name="developerName" attributeType="String" syncable="YES"/>
<attribute name="downloadURL" attributeType="URI" syncable="YES"/>
<attribute name="iconName" attributeType="String" syncable="YES"/>
<attribute name="identifier" attributeType="String" syncable="YES"/>
<attribute name="localizedDescription" attributeType="String" syncable="YES"/>
@@ -26,7 +27,7 @@
<relationship name="app" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="App" inverseName="installedApp" inverseEntity="App" syncable="YES"/>
</entity>
<elements>
<element name="App" positionX="-63" positionY="-18" width="128" height="195"/>
<element name="App" positionX="-63" positionY="-18" width="128" height="210"/>
<element name="InstalledApp" positionX="-63" positionY="0" width="128" height="135"/>
</elements>
</model>

View File

@@ -28,6 +28,8 @@ class App: NSManagedObject, Decodable
@NSManaged private(set) var versionDate: Date
@NSManaged private(set) var versionDescription: String?
@NSManaged private(set) var downloadURL: URL
/* Relationships */
@NSManaged private(set) var installedApp: InstalledApp?
@@ -47,6 +49,7 @@ class App: NSManagedObject, Decodable
case versionDate
case iconName
case screenshotNames
case downloadURL
}
required init(from decoder: Decoder) throws
@@ -68,6 +71,8 @@ class App: NSManagedObject, Decodable
self.iconName = try container.decode(String.self, forKey: .iconName)
self.screenshotNames = try container.decodeIfPresent([String].self, forKey: .screenshotNames) ?? []
self.downloadURL = try container.decode(URL.self, forKey: .downloadURL)
context.insert(self)
}
}