[AltStore] Revises authentication flow with better UI

This commit is contained in:
Riley Testut
2019-06-05 18:05:21 -07:00
parent 5c4613fd20
commit 0895e4238f
15 changed files with 1323 additions and 258 deletions

View File

@@ -0,0 +1,59 @@
//
// Account.swift
// AltStore
//
// Created by Riley Testut on 6/5/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
import Foundation
import CoreData
import AltSign
@objc(Account)
class Account: NSManagedObject
{
var localizedName: String {
var components = PersonNameComponents()
components.givenName = self.firstName
components.familyName = self.lastName
let name = PersonNameComponentsFormatter.localizedString(from: components, style: .default)
return name
}
/* Properties */
@NSManaged var appleID: String
@NSManaged var identifier: String
@NSManaged var firstName: String
@NSManaged var lastName: String
/* Relationships */
@NSManaged var teams: Set<Team>
private override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?)
{
super.init(entity: entity, insertInto: context)
}
init(_ account: ALTAccount, context: NSManagedObjectContext)
{
super.init(entity: Account.entity(), insertInto: context)
self.appleID = account.appleID
self.identifier = account.identifier
self.firstName = account.firstName
self.lastName = account.lastName
}
}
extension Account
{
@nonobjc class func fetchRequest() -> NSFetchRequest<Account>
{
return NSFetchRequest<Account>(entityName: "Account")
}
}