mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-13 08:43:27 +01:00
Create swift package
This commit is contained in:
46
Sources/SideStoreCore/Protocols/AppProtocol.swift
Normal file
46
Sources/SideStoreCore/Protocols/AppProtocol.swift
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// AppProtocol.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 7/26/19.
|
||||
// Copyright © 2019 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import AltSign
|
||||
import Foundation
|
||||
|
||||
public protocol AppProtocol {
|
||||
var name: String { get }
|
||||
var bundleIdentifier: String { get }
|
||||
var url: URL? { get }
|
||||
}
|
||||
|
||||
public struct AnyApp: AppProtocol {
|
||||
public var name: String
|
||||
public var bundleIdentifier: String
|
||||
public var url: URL?
|
||||
|
||||
public init(name: String, bundleIdentifier: String, url: URL?) {
|
||||
self.name = name
|
||||
self.bundleIdentifier = bundleIdentifier
|
||||
self.url = url
|
||||
}
|
||||
}
|
||||
|
||||
extension ALTApplication: AppProtocol {
|
||||
public var url: URL? {
|
||||
fileURL
|
||||
}
|
||||
}
|
||||
|
||||
extension StoreApp: AppProtocol {
|
||||
public var url: URL? {
|
||||
downloadURL
|
||||
}
|
||||
}
|
||||
|
||||
extension InstalledApp: AppProtocol {
|
||||
public var url: URL? {
|
||||
fileURL
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user