You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Set to notDetermined if all permissions are not determined
47
+
if allowDenyCount.0==0 && allowDenyCount.1==0{
48
+
return.notDetermined
49
+
}
50
+
//Set to authorized if majority are authorized
51
+
if allowDenyCount.0> allowDenyCount.1{
52
+
return.authorized
53
+
}
54
+
//Set to denied if majority are denied, or equal # of allowed and denied
55
+
return.denied
56
+
}
57
+
58
+
/**
59
+
- Note: From Apple Developer Documentation: "to help prevent possible leaks of sensitive health information, your app cannot determine whether or not a user has granted permission to read data. If you are not given permission, it simply appears as if there is no data of the requested type in the HealthKit store."
///The text for text label components, including header and descriptions
41
42
publicvarmainTexts=MainTexts()
43
+
/**
44
+
Encapsulates the surrounding texts and title
45
+
*/
46
+
publicstructMainTexts{
47
+
///Text to display for header text
48
+
publicvarheaderText:String="Need Permissions"
49
+
///Text to display for header description text
50
+
publicvarheaderDescription:String="""
51
+
In order for you use certain features of this app, you need to give permissions. See description for each permission
52
+
"""
53
+
///Text to display for bottom part description text
54
+
publicvarbottomDescription:String="""
55
+
Permission are necessary for all the features and functions to work properly. If not allowed, you have to enable permissions in settings
56
+
"""
57
+
}
58
+
//MARK: Customizing Colors
42
59
///The color configuration for permission allow buttons
43
60
publicvarallButtonColors=AllButtonColors()
61
+
62
+
//MARK: Change Auto Dismiss Behaviors
44
63
///Whether to auto dismiss the modal after last permission is allowed
45
64
publicvarautoDismissModal:Bool=true
46
65
///Whether to auto dismiss the alert after last permission is allowed
47
66
publicvarautoDismissAlert:Bool=true
67
+
68
+
//MARK: Configure Auto Authorization Checking
48
69
///Whether to auto check for authorization status before showing, and show the view only if permission is in `notDetermined`
49
70
publicvarautoCheckModalAuth:Bool=true
50
71
///Whether to auto check for authorization status before showing, and show the view only if permission is in `notDetermined`
51
72
publicvarautoCheckAlertAuth:Bool=true
73
+
74
+
//MARK: `onAppear` and `onDisappear` Executions
52
75
///Override point for executing action when PermissionsSwiftUI view appears
53
76
publicvaronAppear:(()->Void)?
54
77
///Override point for executing action when PermissionsSwiftUI view disappears
55
78
publicvaronDisappear:(()->Void)?
56
-
publicstructMainTexts{
57
-
///Text to display for header text
58
-
publicvarheaderText:String="Need Permissions"
59
-
///Text to display for header description text
60
-
publicvarheaderDescription:String="""
61
-
In order for you use certain features of this app, you need to give permissions. See description for each permission
62
-
"""
63
-
///Text to display for bottom part description text
64
-
publicvarbottomDescription:String="""
65
-
Permission are necessary for all the features and functions to work properly. If not allowed, you have to enable permissions in settings
66
-
"""
67
-
}
79
+
68
80
//MARK: Permission Components
69
81
///The displayed text and image icon for the camera permission
70
82
publicvarcameraPermission=JMPermission(
@@ -162,6 +174,7 @@ extension PermissionStore{
162
174
//Closure passes back PermissionStore instance, and the generic value passed in method
163
175
property(&PermissionStore.mutableShared, value)
164
176
}
177
+
165
178
}
166
179
// MARK: - Button Customizations
167
180
/**
@@ -210,7 +223,15 @@ public struct AllButtonColors{
210
223
self.init()
211
224
self.buttonDenied = buttonDenied
212
225
}
213
-
226
+
/**
227
+
Initializes a new `AllbuttonColors` from the primary and tertiary colors
228
+
229
+
Both `primaryColor` and `tertiaryColor` are non-required parameters. Colors without a given initializer parameter will be displayed with the default color.
230
+
231
+
- parameters:
232
+
- primaryColor: The primary color, characterized by the default blue
233
+
- tertiaryColor: The tertiary color, characterized by the default alert red
0 commit comments