mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-10 23:33:29 +01:00
Adds basic MyAppsViewController implementation
This commit is contained in:
@@ -7,13 +7,22 @@
|
||||
<attribute name="localizedDescription" attributeType="String" syncable="YES"/>
|
||||
<attribute name="name" attributeType="String" syncable="YES"/>
|
||||
<attribute name="screenshotNames" attributeType="Transformable" syncable="YES"/>
|
||||
<relationship name="installedApp" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="InstalledApp" inverseName="app" inverseEntity="InstalledApp" syncable="YES"/>
|
||||
<uniquenessConstraints>
|
||||
<uniquenessConstraint>
|
||||
<constraint value="identifier"/>
|
||||
</uniquenessConstraint>
|
||||
</uniquenessConstraints>
|
||||
</entity>
|
||||
<entity name="InstalledApp" representedClassName="InstalledApp" syncable="YES">
|
||||
<attribute name="bundleIdentifier" attributeType="String" syncable="YES"/>
|
||||
<attribute name="expirationDate" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="isBeta" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="signedDate" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
|
||||
<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="135"/>
|
||||
<element name="App" positionX="-63" positionY="-18" width="128" height="150"/>
|
||||
<element name="InstalledApp" positionX="-63" positionY="0" width="128" height="120"/>
|
||||
</elements>
|
||||
</model>
|
||||
@@ -22,6 +22,9 @@ class App: NSManagedObject, Decodable
|
||||
@NSManaged private(set) var iconName: String
|
||||
@NSManaged private(set) var screenshotNames: [String]
|
||||
|
||||
/* Relationships */
|
||||
@NSManaged private(set) var installedApp: InstalledApp?
|
||||
|
||||
private override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?)
|
||||
{
|
||||
super.init(entity: entity, insertInto: context)
|
||||
|
||||
50
AltStore/Model/InstalledApp.swift
Normal file
50
AltStore/Model/InstalledApp.swift
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// InstalledApp.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 5/20/19.
|
||||
// Copyright © 2019 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
@objc(InstalledApp)
|
||||
class InstalledApp: NSManagedObject
|
||||
{
|
||||
/* Properties */
|
||||
@NSManaged var bundleIdentifier: String
|
||||
|
||||
@NSManaged var signedDate: Date
|
||||
@NSManaged var expirationDate: Date
|
||||
|
||||
@NSManaged var isBeta: Bool
|
||||
|
||||
/* Relationships */
|
||||
@NSManaged private(set) var app: App?
|
||||
|
||||
private override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?)
|
||||
{
|
||||
super.init(entity: entity, insertInto: context)
|
||||
}
|
||||
|
||||
init(app: App, bundleIdentifier: String, signedDate: Date, expirationDate: Date, context: NSManagedObjectContext)
|
||||
{
|
||||
super.init(entity: InstalledApp.entity(), insertInto: context)
|
||||
|
||||
let app = context.object(with: app.objectID) as! App
|
||||
self.app = app
|
||||
|
||||
self.bundleIdentifier = bundleIdentifier
|
||||
self.signedDate = signedDate
|
||||
self.expirationDate = expirationDate
|
||||
}
|
||||
}
|
||||
|
||||
extension InstalledApp
|
||||
{
|
||||
@nonobjc class func fetchRequest() -> NSFetchRequest<InstalledApp>
|
||||
{
|
||||
return NSFetchRequest<InstalledApp>(entityName: "InstalledApp")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user