mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-27 23:47:39 +01:00
refactor: streamline the repo again and removed unused files from altstore
This commit is contained in:
43
AltStore/Permissions/AppPermissionProtocol.swift
Normal file
43
AltStore/Permissions/AppPermissionProtocol.swift
Normal file
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// AppPermissionProtocol.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 5/23/23.
|
||||
// Copyright © 2023 Riley Testut. All rights reserved.
|
||||
//
|
||||
import AltStoreCore
|
||||
|
||||
@dynamicMemberLookup
|
||||
protocol AppPermissionProtocol: Hashable
|
||||
{
|
||||
var permission: any ALTAppPermission { get }
|
||||
var usageDescription: String? { get }
|
||||
|
||||
subscript<T>(dynamicMember dynamicMember: KeyPath<any ALTAppPermission, T>) -> T { get }
|
||||
}
|
||||
|
||||
extension AppPermission: AppPermissionProtocol {}
|
||||
|
||||
struct PreviewAppPermission: AppPermissionProtocol
|
||||
{
|
||||
var permission: any ALTAppPermission
|
||||
var usageDescription: String? { "Allows Delta to use images from your Photo Library as game artwork." }
|
||||
|
||||
subscript<T>(dynamicMember dynamicMember: KeyPath<any ALTAppPermission, T>) -> T
|
||||
{
|
||||
return self.permission[keyPath: dynamicMember]
|
||||
}
|
||||
}
|
||||
|
||||
extension PreviewAppPermission
|
||||
{
|
||||
static func ==(lhs: PreviewAppPermission, rhs: PreviewAppPermission) -> Bool
|
||||
{
|
||||
return lhs.permission.isEqual(rhs.permission)
|
||||
}
|
||||
|
||||
func hash(into hasher: inout Hasher)
|
||||
{
|
||||
hasher.combine(self.permission)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user