Skip to content

Commit

Permalink
Merge pull request #117 from ennioma/develop
Browse files Browse the repository at this point in the history
Merge to Master to release: 2.0.2
  • Loading branch information
ennioma authored Aug 27, 2018
2 parents 3f85456 + 58892bf commit 0337787
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 102 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

.DS_Store
## Build generated
build/
DerivedData/
Expand Down
108 changes: 56 additions & 52 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,78 +1,82 @@
PODS:
- arek (2.0.0):
- arek/Bluetooth (= 2.0.0)
- arek/Camera (= 2.0.0)
- arek/CloudKit (= 2.0.0)
- arek/Contacts (= 2.0.0)
- arek/Core (= 2.0.0)
- arek/Events (= 2.0.0)
- arek/Health (= 2.0.0)
- arek/Location (= 2.0.0)
- arek/MediaLibrary (= 2.0.0)
- arek/Microphone (= 2.0.0)
- arek/Motion (= 2.0.0)
- arek/Notifications (= 2.0.0)
- arek/Photos (= 2.0.0)
- arek/Reminders (= 2.0.0)
- arek/SpeechRecognizer (= 2.0.0)
- PMAlertController (= 3.2.0)
- arek/Bluetooth (2.0.0):
- arek (2.0.2):
- arek/Bluetooth (= 2.0.2)
- arek/Camera (= 2.0.2)
- arek/CloudKit (= 2.0.2)
- arek/Contacts (= 2.0.2)
- arek/Core (= 2.0.2)
- arek/Events (= 2.0.2)
- arek/Health (= 2.0.2)
- arek/Location (= 2.0.2)
- arek/MediaLibrary (= 2.0.2)
- arek/Microphone (= 2.0.2)
- arek/Motion (= 2.0.2)
- arek/Notifications (= 2.0.2)
- arek/Photos (= 2.0.2)
- arek/Reminders (= 2.0.2)
- arek/SpeechRecognizer (= 2.0.2)
- PMAlertController (= 3.4.0)
- arek/Bluetooth (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Camera (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Camera (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/CloudKit (2.0.0):
- PMAlertController (= 3.4.0)
- arek/CloudKit (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Contacts (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Contacts (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Core (2.0.0):
- PMAlertController (= 3.2.0)
- arek/Events (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Core (2.0.2):
- PMAlertController (= 3.4.0)
- arek/Events (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Health (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Health (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Location (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Location (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/MediaLibrary (2.0.0):
- PMAlertController (= 3.4.0)
- arek/MediaLibrary (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Microphone (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Microphone (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Motion (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Motion (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Notifications (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Notifications (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Photos (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Photos (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/Reminders (2.0.0):
- PMAlertController (= 3.4.0)
- arek/Reminders (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- arek/SpeechRecognizer (2.0.0):
- PMAlertController (= 3.4.0)
- arek/SpeechRecognizer (2.0.2):
- arek/Core
- PMAlertController (= 3.2.0)
- PMAlertController (3.2.0)
- PMAlertController (= 3.4.0)
- PMAlertController (3.4.0)

DEPENDENCIES:
- arek (from `../`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- PMAlertController

EXTERNAL SOURCES:
arek:
:path: ../
:path: "../"

SPEC CHECKSUMS:
arek: 23436a17670c4dd7244d70283a7392455a5a92de
PMAlertController: 46047b840f6e1833c2a5395c91ccad29e72ae2c0
arek: 9647d82c4c3c26c2902a15b3d7593a31a4e80ca7
PMAlertController: efb781925d741d50e0200018a00c53cecb8b4910

PODFILE CHECKSUM: 51391b981566b427912c687e0f5ba15813bf3aa4

COCOAPODS: 1.4.0
COCOAPODS: 1.5.3
40 changes: 16 additions & 24 deletions Example/arek_example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
7569AFB11E7447F300E81C95 /* arek_exampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7569AFB01E7447F300E81C95 /* arek_exampleUITests.swift */; };
756DA0AF1F0C285900F0460B /* ArekCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 756DA0AE1F0C285900F0460B /* ArekCell.swift */; };
A6424BD252FDA4DBE85428FA /* Pods_arek_example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B038FF5906D8EF852F54CE42 /* Pods_arek_example.framework */; };
E6A9B971213439690066F31E /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6A9B970213439690066F31E /* HealthKit.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -60,6 +61,8 @@
756DA0AE1F0C285900F0460B /* ArekCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArekCell.swift; sourceTree = "<group>"; };
B038FF5906D8EF852F54CE42 /* Pods_arek_example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_arek_example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C463D6F479D0910995B14428 /* Pods-arek_example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-arek_example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-arek_example/Pods-arek_example.debug.xcconfig"; sourceTree = "<group>"; };
E6A9B970213439690066F31E /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; };
E6A9B972213439690066F31E /* arek_example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = arek_example.entitlements; sourceTree = "<group>"; };
F2873BC2E9EC460C1FF497D9 /* Pods-arek_example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-arek_example.release.xcconfig"; path = "Pods/Target Support Files/Pods-arek_example/Pods-arek_example.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -69,6 +72,7 @@
buildActionMask = 2147483647;
files = (
A6424BD252FDA4DBE85428FA /* Pods_arek_example.framework in Frameworks */,
E6A9B971213439690066F31E /* HealthKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -134,6 +138,7 @@
7569AF8F1E7447F300E81C95 /* arek_example */ = {
isa = PBXGroup;
children = (
E6A9B972213439690066F31E /* arek_example.entitlements */,
6B6654161F0CF3CA0093A15E /* ArekCell */,
7569AF901E7447F300E81C95 /* AppDelegate.swift */,
7569AF971E7447F300E81C95 /* Assets.xcassets */,
Expand Down Expand Up @@ -167,6 +172,7 @@
8694E42A5C95D8F13E875D0F /* Frameworks */ = {
isa = PBXGroup;
children = (
E6A9B970213439690066F31E /* HealthKit.framework */,
B038FF5906D8EF852F54CE42 /* Pods_arek_example.framework */,
);
name = Frameworks;
Expand All @@ -184,7 +190,6 @@
7569AF8A1E7447F300E81C95 /* Frameworks */,
7569AF8B1E7447F300E81C95 /* Resources */,
C9C6CBF2904F6DB01B9F8DA2 /* [CP] Embed Pods Frameworks */,
C54E242E1C3F92433CB472A3 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -243,10 +248,12 @@
TargetAttributes = {
7569AF8C1E7447F300E81C95 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = MQ7M5YR8SU;
LastSwiftMigration = 0920;
ProvisioningStyle = Automatic;
ProvisioningStyle = Manual;
SystemCapabilities = {
com.apple.HealthKit = {
enabled = 1;
};
com.apple.Siri = {
enabled = 1;
};
Expand Down Expand Up @@ -333,21 +340,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C54E242E1C3F92433CB472A3 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-arek_example/Pods-arek_example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
C9C6CBF2904F6DB01B9F8DA2 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -552,10 +544,10 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_ENTITLEMENTS = arek_example/arek_example.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = MQ7M5YR8SU;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = arek_example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ennioma.arek;
Expand All @@ -572,10 +564,10 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_ENTITLEMENTS = arek_example/arek_example.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = MQ7M5YR8SU;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = arek_example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ennioma.arek;
Expand Down
28 changes: 20 additions & 8 deletions Example/arek_example/ArekCellVMServiceProgrammatically.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@

import Foundation
import arek
import HealthKit

class ArekCellVMServiceProgrammatically {
static private var permissions = [
["popupDataTitle": "Media Library Access - native", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
["popupDataTitle": "Camera Access - PMAlertController", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
["popupDataTitle": "Location Always Access - native", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
["popupDataTitle": "Motion - PMAlertController", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"]
["popupDataTitle": "Motion - PMAlertController", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
["popupDataTitle": "Notification - native", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
["popupDataTitle": "Health - PMAlertController", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"]
]

static func numberOfVMs() -> Int {
Expand All @@ -49,7 +52,7 @@ class ArekCellVMServiceProgrammatically {
denyButtonTitle: data["denyButtonTitle"]!,
type: getPopupType(index: index),
styling: ArekPopupStyle(cornerRadius: 0.9,
maskBackgroundColor: UIColor.orange,
maskBackgroundColor: UIColor.lightGray,
maskBackgroundAlpha: 1.0,
titleTextColor: UIColor.green,
titleFont: nil,
Expand Down Expand Up @@ -77,13 +80,9 @@ class ArekCellVMServiceProgrammatically {

static private func getPopupType(index: Int) -> ArekPopupType {
switch index {
case 0:
case 0, 2, 4:
return .native
case 1:
return .codeido
case 2:
return .native
case 3:
case 1, 3, 5:
return .codeido
default:
return .native
Expand All @@ -101,6 +100,19 @@ class ArekCellVMServiceProgrammatically {
return ArekLocationAlways(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)
case 3:
return ArekMotion(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)
case 4:
return ArekNotifications(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)
case 5:
let myType = HKObjectType.activitySummaryType()
var dataToRead = Set<HKObjectType>()
dataToRead.insert(HKObjectType.characteristicType(forIdentifier: HKCharacteristicTypeIdentifier.dateOfBirth)!)

let heightType = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.height)!
let weightType = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMass)!

let dataToShare: Set<HKSampleType> = [heightType, weightType]

return ArekHealth(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData, arekHealthConfiguration: ArekHealth.ArekHealthConfiguration(hkObjectType: myType, hkSampleTypesToShare: dataToShare, hkSampleTypesToRead: dataToRead))
default:
return nil
}
Expand Down
4 changes: 4 additions & 0 deletions Example/arek_example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<string>Get me the Location Dude!</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Get me the Location Dude!</string>
<key>NSHealthShareUsageDescription</key>
<string>Get me your data about Health</string>
<key>NSHealthUpdateUsageDescription</key>
<string>Your health data</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
8 changes: 8 additions & 0 deletions Example/arek_example/arek_example.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.healthkit</key>
<true/>
</dict>
</plist>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,15 @@ Add AREK to your Podfile
```ruby
use_frameworks!
target 'MyTarget' do
pod 'arek', '~> 2.0.1'
pod 'arek', '~> 2.0.2'
end
```

If you want to install just a specific permission, let's say `Bluetooth`, you have to specify:
```ruby
use_frameworks!
target 'MyTarget' do
pod 'arek/Bluetooth', '~> 2.0.1'
pod 'arek/Bluetooth', '~> 2.0.2'
end
```

Expand All @@ -210,7 +210,7 @@ $ pod install

## Carthage
```ruby
github "ennioma/arek" ~> "2.0.1"
github "ennioma/arek" ~> "2.0.2"
```

Then on your application target *Build Phases* settings tab, add a "New Run Script Phase". Create a Run Script with the following content:
Expand Down
2 changes: 1 addition & 1 deletion arek.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'arek'
s.version = '2.0.1'
s.version = '2.0.2'
s.summary = 'AREK is a clean and easy to use wrapper over any kind of iOS permission.'
s.homepage = 'https://github.com/ennioma/arek'
s.license = { :type => 'MIT', :file => 'LICENSE'}
Expand Down
Loading

0 comments on commit 0337787

Please sign in to comment.