mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Redesigns store page permissions UI to show all entitlements and privacy permissions
This commit is contained in:
44
AltStore/Previews/AppPermissionProtocol.swift
Normal file
44
AltStore/Previews/AppPermissionProtocol.swift
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// 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