Skip to content

Commit b6616c6

Browse files
authored
Merge pull request #11 from joeblau/master
Updated Project To Incorporate Motion Fitness Check
2 parents 039af52 + 5278078 commit b6616c6

File tree

16 files changed

+277
-13
lines changed

16 files changed

+277
-13
lines changed

.gitignore

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,69 @@
1-
.DS_Store
1+
2+
# Created by https://www.gitignore.io/api/swift
3+
4+
### Swift ###
5+
# Xcode
6+
#
7+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
8+
9+
## Build generated
10+
build/
11+
DerivedData/
12+
13+
## Various settings
14+
*.pbxuser
15+
!default.pbxuser
16+
*.mode1v3
17+
!default.mode1v3
18+
*.mode2v3
19+
!default.mode2v3
20+
*.perspectivev3
21+
!default.perspectivev3
22+
xcuserdata/
23+
24+
## Other
25+
*.moved-aside
26+
*.xcuserstate
27+
28+
## Obj-C/Swift specific
29+
*.hmap
30+
*.ipa
31+
*.dSYM.zip
32+
*.dSYM
33+
34+
## Playgrounds
35+
timeline.xctimeline
36+
playground.xcworkspace
37+
38+
# Swift Package Manager
39+
#
40+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
41+
# Packages/
42+
.build/
43+
44+
# CocoaPods
45+
#
46+
# We recommend against adding the Pods directory to your .gitignore. However
47+
# you should judge for yourself, the pros and cons are mentioned at:
48+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
49+
#
50+
Pods/
51+
52+
# Carthage
53+
#
54+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
55+
# Carthage/Checkouts
56+
57+
Carthage/Build
58+
59+
# fastlane
60+
#
61+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
62+
# screenshots whenever they are needed.
63+
# For more information about the recommended setup visit:
64+
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
65+
66+
fastlane/report.xml
67+
fastlane/Preview.html
68+
fastlane/screenshots
69+
fastlane/test_output

Example/PAPermissionsApp.xcodeproj/project.pbxproj

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
50E9DD881D7F3701007D0ED5 /* PACustomPermissionsCheck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E9DD871D7F3701007D0ED5 /* PACustomPermissionsCheck.swift */; };
2020
50E9DD8D1D7F548B007D0ED5 /* CustomPermissionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E9DD8C1D7F548B007D0ED5 /* CustomPermissionsViewController.swift */; };
2121
50E9DD8F1D80925F007D0ED5 /* background.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 50E9DD8E1D80925F007D0ED5 /* background.jpg */; };
22+
D02C8BB09C60CB72568B8FCA /* Pods_PAPermissionsApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7292F8A8CFD2909D2EA9DB6 /* Pods_PAPermissionsApp.framework */; };
2223
/* End PBXBuildFile section */
2324

2425
/* Begin PBXFileReference section */
@@ -36,6 +37,9 @@
3637
50E9DD871D7F3701007D0ED5 /* PACustomPermissionsCheck.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PACustomPermissionsCheck.swift; sourceTree = "<group>"; };
3738
50E9DD8C1D7F548B007D0ED5 /* CustomPermissionsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomPermissionsViewController.swift; sourceTree = "<group>"; };
3839
50E9DD8E1D80925F007D0ED5 /* background.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = background.jpg; sourceTree = "<group>"; };
40+
7A076817F20389BCFDB75226 /* Pods-PAPermissionsApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PAPermissionsApp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PAPermissionsApp/Pods-PAPermissionsApp.debug.xcconfig"; sourceTree = "<group>"; };
41+
C7292F8A8CFD2909D2EA9DB6 /* Pods_PAPermissionsApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PAPermissionsApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
42+
E57574E623D6435CA7FA8788 /* Pods-PAPermissionsApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PAPermissionsApp.release.xcconfig"; path = "Pods/Target Support Files/Pods-PAPermissionsApp/Pods-PAPermissionsApp.release.xcconfig"; sourceTree = "<group>"; };
3943
/* End PBXFileReference section */
4044

4145
/* Begin PBXFrameworksBuildPhase section */
@@ -46,12 +50,21 @@
4650
50E9DD2C1D7E44BD007D0ED5 /* AVFoundation.framework in Frameworks */,
4751
50E9DD281D7E41E9007D0ED5 /* CoreLocation.framework in Frameworks */,
4852
50E9DD191D7E37FC007D0ED5 /* CoreBluetooth.framework in Frameworks */,
53+
D02C8BB09C60CB72568B8FCA /* Pods_PAPermissionsApp.framework in Frameworks */,
4954
);
5055
runOnlyForDeploymentPostprocessing = 0;
5156
};
5257
/* End PBXFrameworksBuildPhase section */
5358

5459
/* Begin PBXGroup section */
60+
088A3FEE08AAB9A64E028FA0 /* Frameworks */ = {
61+
isa = PBXGroup;
62+
children = (
63+
C7292F8A8CFD2909D2EA9DB6 /* Pods_PAPermissionsApp.framework */,
64+
);
65+
name = Frameworks;
66+
sourceTree = "<group>";
67+
};
5568
50E9DCC61D7DC370007D0ED5 = {
5669
isa = PBXGroup;
5770
children = (
@@ -60,6 +73,8 @@
6073
50E9DD181D7E37FC007D0ED5 /* CoreBluetooth.framework */,
6174
50E9DCD11D7DC370007D0ED5 /* PAPermissionsApp */,
6275
50E9DCD01D7DC370007D0ED5 /* Products */,
76+
BE512304B20AC7F89D82B883 /* Pods */,
77+
088A3FEE08AAB9A64E028FA0 /* Frameworks */,
6378
);
6479
sourceTree = "<group>";
6580
};
@@ -88,16 +103,28 @@
88103
path = PAPermissionsApp;
89104
sourceTree = "<group>";
90105
};
106+
BE512304B20AC7F89D82B883 /* Pods */ = {
107+
isa = PBXGroup;
108+
children = (
109+
7A076817F20389BCFDB75226 /* Pods-PAPermissionsApp.debug.xcconfig */,
110+
E57574E623D6435CA7FA8788 /* Pods-PAPermissionsApp.release.xcconfig */,
111+
);
112+
name = Pods;
113+
sourceTree = "<group>";
114+
};
91115
/* End PBXGroup section */
92116

93117
/* Begin PBXNativeTarget section */
94118
50E9DCCE1D7DC370007D0ED5 /* PAPermissionsApp */ = {
95119
isa = PBXNativeTarget;
96120
buildConfigurationList = 50E9DCE11D7DC370007D0ED5 /* Build configuration list for PBXNativeTarget "PAPermissionsApp" */;
97121
buildPhases = (
122+
A52F1C072DA5097B808C9C37 /* [CP] Check Pods Manifest.lock */,
98123
50E9DCCB1D7DC370007D0ED5 /* Sources */,
99124
50E9DCCC1D7DC370007D0ED5 /* Frameworks */,
100125
50E9DCCD1D7DC370007D0ED5 /* Resources */,
126+
665D77414CAAF3B81144D9B0 /* [CP] Embed Pods Frameworks */,
127+
07A9B8B99C15E52D997403BA /* [CP] Copy Pods Resources */,
101128
);
102129
buildRules = (
103130
);
@@ -120,8 +147,8 @@
120147
TargetAttributes = {
121148
50E9DCCE1D7DC370007D0ED5 = {
122149
CreatedOnToolsVersion = 7.3.1;
123-
DevelopmentTeam = NRSZN92M5X;
124-
LastSwiftMigration = 0800;
150+
DevelopmentTeam = K78G42H4U2;
151+
LastSwiftMigration = 0810;
125152
};
126153
};
127154
};
@@ -158,6 +185,54 @@
158185
};
159186
/* End PBXResourcesBuildPhase section */
160187

188+
/* Begin PBXShellScriptBuildPhase section */
189+
07A9B8B99C15E52D997403BA /* [CP] Copy Pods Resources */ = {
190+
isa = PBXShellScriptBuildPhase;
191+
buildActionMask = 2147483647;
192+
files = (
193+
);
194+
inputPaths = (
195+
);
196+
name = "[CP] Copy Pods Resources";
197+
outputPaths = (
198+
);
199+
runOnlyForDeploymentPostprocessing = 0;
200+
shellPath = /bin/sh;
201+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PAPermissionsApp/Pods-PAPermissionsApp-resources.sh\"\n";
202+
showEnvVarsInLog = 0;
203+
};
204+
665D77414CAAF3B81144D9B0 /* [CP] Embed Pods Frameworks */ = {
205+
isa = PBXShellScriptBuildPhase;
206+
buildActionMask = 2147483647;
207+
files = (
208+
);
209+
inputPaths = (
210+
);
211+
name = "[CP] Embed Pods Frameworks";
212+
outputPaths = (
213+
);
214+
runOnlyForDeploymentPostprocessing = 0;
215+
shellPath = /bin/sh;
216+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PAPermissionsApp/Pods-PAPermissionsApp-frameworks.sh\"\n";
217+
showEnvVarsInLog = 0;
218+
};
219+
A52F1C072DA5097B808C9C37 /* [CP] Check Pods Manifest.lock */ = {
220+
isa = PBXShellScriptBuildPhase;
221+
buildActionMask = 2147483647;
222+
files = (
223+
);
224+
inputPaths = (
225+
);
226+
name = "[CP] Check Pods Manifest.lock";
227+
outputPaths = (
228+
);
229+
runOnlyForDeploymentPostprocessing = 0;
230+
shellPath = /bin/sh;
231+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
232+
showEnvVarsInLog = 0;
233+
};
234+
/* End PBXShellScriptBuildPhase section */
235+
161236
/* Begin PBXSourcesBuildPhase section */
162237
50E9DCCB1D7DC370007D0ED5 /* Sources */ = {
163238
isa = PBXSourcesBuildPhase;
@@ -284,9 +359,11 @@
284359
};
285360
50E9DCE21D7DC370007D0ED5 /* Debug */ = {
286361
isa = XCBuildConfiguration;
362+
baseConfigurationReference = 7A076817F20389BCFDB75226 /* Pods-PAPermissionsApp.debug.xcconfig */;
287363
buildSettings = {
288364
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289365
CODE_SIGN_IDENTITY = "iPhone Developer";
366+
DEVELOPMENT_TEAM = K78G42H4U2;
290367
INFOPLIST_FILE = PAPermissionsApp/Info.plist;
291368
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
292369
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -298,9 +375,11 @@
298375
};
299376
50E9DCE31D7DC370007D0ED5 /* Release */ = {
300377
isa = XCBuildConfiguration;
378+
baseConfigurationReference = E57574E623D6435CA7FA8788 /* Pods-PAPermissionsApp.release.xcconfig */;
301379
buildSettings = {
302380
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
303381
CODE_SIGN_IDENTITY = "iPhone Developer";
382+
DEVELOPMENT_TEAM = K78G42H4U2;
304383
INFOPLIST_FILE = PAPermissionsApp/Info.plist;
305384
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
306385
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

Example/PAPermissionsApp/Assets.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
{
22
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
313
{
414
"idiom" : "iphone",
515
"size" : "29x29",
@@ -30,6 +40,16 @@
3040
"size" : "60x60",
3141
"scale" : "3x"
3242
},
43+
{
44+
"idiom" : "ipad",
45+
"size" : "20x20",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"size" : "20x20",
51+
"scale" : "2x"
52+
},
3353
{
3454
"idiom" : "ipad",
3555
"size" : "29x29",
@@ -59,6 +79,11 @@
5979
"idiom" : "ipad",
6080
"size" : "76x76",
6181
"scale" : "2x"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"size" : "83.5x83.5",
86+
"scale" : "2x"
6287
}
6388
],
6489
"info" : {

Example/PAPermissionsApp/CustomPermissionsViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class CustomPermissionsViewController: PAPermissionsViewController {
1414
let bluetoothCheck = PABluetoothPermissionsCheck()
1515
let locationCheck = PALocationPermissionsCheck()
1616
let microphoneCheck = PAMicrophonePermissionsCheck()
17+
let motionFitnessCheck = PAMotionFitnessPermissionsCheck()
1718
let cameraCheck = PACameraPermissionsCheck()
1819
lazy var notificationsCheck : PAPermissionsCheck = {
1920
if #available(iOS 10.0, *) {
@@ -46,6 +47,7 @@ class CustomPermissionsViewController: PAPermissionsViewController {
4647
PAPermissionsItem.itemForType(.bluetooth, reason: PAPermissionDefaultReason)!,
4748
PAPermissionsItem.itemForType(.location, reason: PAPermissionDefaultReason)!,
4849
PAPermissionsItem.itemForType(.microphone, reason: PAPermissionDefaultReason)!,
50+
PAPermissionsItem.itemForType(.motionFitness, reason: PAPermissionDefaultReason)!,
4951
PAPermissionsItem.itemForType(.notifications, reason: "Required to send you great updates")!,
5052
PAPermissionsItem.itemForType(.camera, reason: PAPermissionDefaultReason)!,
5153
PAPermissionsItem(type: .custom, identifier: "my-custom-permission", title: "Custom Option", reason: "Optional", icon: UIImage(named: "pa_checkmark_icon", in: Bundle(for: PAPermissionsViewController.self), compatibleWith: nil)!)]
@@ -57,6 +59,7 @@ class CustomPermissionsViewController: PAPermissionsViewController {
5759
PAPermissionsType.bluetooth.rawValue: self.bluetoothCheck,
5860
PAPermissionsType.location.rawValue: self.locationCheck,
5961
PAPermissionsType.microphone.rawValue: self.microphoneCheck,
62+
PAPermissionsType.motionFitness.rawValue: self.motionFitnessCheck,
6063
PAPermissionsType.camera.rawValue: self.cameraCheck,
6164
PAPermissionsType.notifications.rawValue: self.notificationsCheck,
6265
"my-custom-permission": self.customCheck]

Example/PAPermissionsApp/InfoPlist.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ NSLocationWhenInUseUsageDescription="Required to locate yourself";
1515
NSBluetoothPeripheralUsageDescription = "Required to connect with your cool device";
1616
NSMicrophoneUsageDescription = "Required to hear your beautiful voice";
1717
NSCameraUsageDescription = "Required to shoot awesome photos";
18+
NSMotionUsageDescription = "Required to monitor motion & fitness";

Example/PAPermissionsApp/PACustomPermissionsCheck.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import PAPermissions
1111

1212
class PACustomPermissionsCheck: PAPermissionsCheck {
1313

14-
public override func checkStatus() {
14+
open override func checkStatus() {
1515
self.status = .disabled
1616
self.updateStatus()
1717
}
1818

19-
public override func defaultAction() {
19+
open override func defaultAction() {
2020
self.status = .enabled
2121
self.updateStatus()
2222
}

Example/Podfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,13 @@
22
use_frameworks!
33

44
target 'PAPermissionsApp' do
5-
pod 'PAPermissions'
6-
end
5+
pod 'PAPermissions', :path => '../'
6+
end
7+
8+
post_install do |installer|
9+
installer.pods_project.targets.each do |target|
10+
target.build_configurations.each do |config|
11+
config.build_settings['SWIFT_VERSION'] = '3.0'
12+
end
13+
end
14+
end

Example/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
PODS:
2-
- PAPermissions (0.9.0)
2+
- PAPermissions (0.9.5)
33

44
DEPENDENCIES:
5-
- PAPermissions (from `~/Dropbox/Altri_progetti/PAPermissionsApp/`)
5+
- PAPermissions (from `../`)
66

77
EXTERNAL SOURCES:
88
PAPermissions:
9-
:path: "~/Dropbox/Altri_progetti/PAPermissionsApp/"
9+
:path: ../
1010

1111
SPEC CHECKSUMS:
12-
PAPermissions: b57c549edff6779cf146d745dcdb7cb0fc1e22cf
12+
PAPermissions: f3f679385ab603011a2bdb22584b184eb91e626a
1313

14-
PODFILE CHECKSUM: 4eb91480bf97c03cfb7d034bf01235ca8e09fbe5
14+
PODFILE CHECKSUM: 17cb6692260f5448df0c61e2797ca370af384594
1515

16-
COCOAPODS: 1.1.0.rc.2
16+
COCOAPODS: 1.0.1

PAPermissions.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ Pod::Spec.new do |s|
1212

1313
s.source_files = 'PAPermissions/Classes/**/*.{swift}'
1414
s.resources = "PAPermissions/Assets/**/*"
15+
s.ios.framework = ['AVFoundation', 'CoreLocation', 'CoreBluetooth', 'CoreMotion']
1516
end
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "pa_motion_activity_icon.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "pa_motion_activity_icon@2x.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "pa_motion_activity_icon@3x.png",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
}
23+
}

0 commit comments

Comments
 (0)