Skip to content

Commit

Permalink
Merge pull request #126 from ennioma/develop
Browse files Browse the repository at this point in the history
Release 4.0.1
  • Loading branch information
Ennio Masi authored Sep 26, 2018
2 parents 0337787 + 61f3469 commit be604ff
Show file tree
Hide file tree
Showing 12 changed files with 213 additions and 94 deletions.
108 changes: 52 additions & 56 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,82 +1,78 @@
PODS:
- 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 (4.0.1):
- arek/Bluetooth (= 4.0.1)
- arek/Camera (= 4.0.1)
- arek/CloudKit (= 4.0.1)
- arek/Contacts (= 4.0.1)
- arek/Core (= 4.0.1)
- arek/Events (= 4.0.1)
- arek/Health (= 4.0.1)
- arek/Location (= 4.0.1)
- arek/MediaLibrary (= 4.0.1)
- arek/Microphone (= 4.0.1)
- arek/Motion (= 4.0.1)
- arek/Notifications (= 4.0.1)
- arek/Photos (= 4.0.1)
- arek/Reminders (= 4.0.1)
- arek/SpeechRecognizer (= 4.0.1)
- PMAlertController (= 3.5.0)
- arek/Bluetooth (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Camera (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Camera (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/CloudKit (2.0.2):
- PMAlertController (= 3.5.0)
- arek/CloudKit (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Contacts (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Contacts (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Core (2.0.2):
- PMAlertController (= 3.4.0)
- arek/Events (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Core (4.0.1):
- PMAlertController (= 3.5.0)
- arek/Events (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Health (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Health (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Location (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Location (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/MediaLibrary (2.0.2):
- PMAlertController (= 3.5.0)
- arek/MediaLibrary (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Microphone (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Microphone (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Motion (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Motion (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Notifications (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Notifications (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Photos (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Photos (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/Reminders (2.0.2):
- PMAlertController (= 3.5.0)
- arek/Reminders (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- arek/SpeechRecognizer (2.0.2):
- PMAlertController (= 3.5.0)
- arek/SpeechRecognizer (4.0.1):
- arek/Core
- PMAlertController (= 3.4.0)
- PMAlertController (3.4.0)
- PMAlertController (= 3.5.0)
- PMAlertController (3.5.0)

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

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

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

SPEC CHECKSUMS:
arek: 9647d82c4c3c26c2902a15b3d7593a31a4e80ca7
PMAlertController: efb781925d741d50e0200018a00c53cecb8b4910
arek: c24ee64110b3218894403653437ba1a45a1f1316
PMAlertController: 06dab8160066fc4ce991c880e3722cd403e2926a

PODFILE CHECKSUM: 51391b981566b427912c687e0f5ba15813bf3aa4

COCOAPODS: 1.5.3
COCOAPODS: 1.4.0
24 changes: 20 additions & 4 deletions Example/arek_example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
7569AF8A1E7447F300E81C95 /* Frameworks */,
7569AF8B1E7447F300E81C95 /* Resources */,
C9C6CBF2904F6DB01B9F8DA2 /* [CP] Embed Pods Frameworks */,
02E1FE4A0A2D25E9D073C746 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -322,6 +323,21 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
02E1FE4A0A2D25E9D073C746 /* [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;
};
749983BE198146DE8643834E /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -481,7 +497,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -530,7 +546,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -554,7 +570,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -574,7 +590,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Example/arek_example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Why AREK could help you building a better app is well described by Apple <a href
```
Request personal data only when your app clearly needs it.
...
Explain why your app needs the information if it’s not obvious.
Explain why your app needs the information if it’s not obvious.
...
Request permission at launch only when necessary for your app to function.
...
Expand All @@ -28,7 +28,12 @@ Every goal could be easily reached using **AREK**.
* show a popup to invite the user to re-enable the permission if it has been denied
* manage through an easy configuration how many times to ask the user to re-enable the permission (Only once, every hour, once a day, weekly, always😷)

🚨 AREK is a **Swift 4** and **XCode 9** compatible project 🚨
🚨 AREK is a **Swift 4.2** and **Xcode 10** compatible project 🚨

Important!
- If you want to use it with **Xcode 10**, swift 4.2, point to the version [4.0.1](/~https://github.com/ennioma/arek/releases/tag/4.0.1)
- If you want to use it with **Xcode 9**, point to any prior version


## Build Status

Expand Down Expand Up @@ -62,6 +67,7 @@ Every goal could be easily reached using **AREK**.
- [x] Notifications
- [x] Photo
- [x] Reminders
- [x] Siri
- [x] Speech Recognizer

<a name="howTo"></a>
Expand Down Expand Up @@ -98,7 +104,7 @@ Every goal could be easily reached using **AREK**.
case .notAvailable:
return "🚫"
}
}
}
```

<a name="permissionsConfiguration"></a>
Expand Down Expand Up @@ -167,19 +173,20 @@ In the following table there are the configurations for:

Messages related to the iOS native permission popup should be configured following the conventions described <a href="https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW1">here</a>.

| Permission | Pre-permission Title | Pre-permission Message | Re-Enable Title | Re-Enable Message | Image | Allow Button Title | Deny Button Title |
| Permission | Pre-permission Title | Pre-permission Message | Re-Enable Title | Re-Enable Message | Image | Allow Button Title | Deny Button Title |
| :-------------: | :-------------: | :-------------: | :-------------: | :---------------: | :---: | :----------------: | :---------------: |
| Camera | ArekCamera_initial_title | ArekCamera_initial_message | ArekCamera_reenable_title | ArekCamera_reenable_message | ArekCamera_image | ArekCamera_allow_button_title | ArekCamera_deny_button_title |
| CloudKit | ArekCloudKit_initial_title | ArekCloudKit_initial_message | ArekCloudKit_reenable_title | ArekCloudKit_reenable_message | ArekCloudKit_image | ArekCloudKit_allow_button_title | ArekCloudKit_deny_button_title
| Contacts | ArekContacts_initial_title | ArekContacts_initial_message | ArekContacts_reenable_title | ArekContacts_reenable_message | ArekContacts_image | ArekContacts_allow_button_title | ArekContacts_deny_button_title
| Events | ArekEvents_initial_title | ArekEvents_initial_message | ArekEvents_reenable_title | ArekEvents_reenable_message | ArekEvents_image | ArekEvents_allow_button_title | ArekEvents_deny_button_title |
| HealthKit | ArekHealth_initial_title | ArekHealth_initial_message | ArekHealth_reenable_title | ArekHealth_reenable_message | ArekHealth_image | ArekHealth_allow_button_title | ArekHealth_deny_button_title |
| Media Library | ArekMediaLibrary_initial_title | ArekMediaLibrary_initial_message | ArekMediaLibrary_reenable_title | ArekMediaLibrary_reenable_message | ArekMediaLibrary_image | ArekMediaLibrary_allow_button_title | ArekMediaLibrary_deny_button_title |
| Microphone | ArekMicrophone_initial_title | ArekMicrophone_initial_message | ArekMicrophone_reenable_title | ArekMicrophone_reenable_message | ArekMicrophone_image | ArekMicrophone_allow_button_title | ArekMicrophone_deny_button_title |
| Motion | ArekMotion_initial_title | ArekMotion_initial_message | ArekMotion_reenable_title | ArekMotion_reenable_message | ArekMotion_image | ArekMotion_allow_button_title | ArekMotion_deny_button_title |
| Microphone | ArekMicrophone_initial_title | ArekMicrophone_initial_message | ArekMicrophone_reenable_title | ArekMicrophone_reenable_message | ArekMicrophone_image | ArekMicrophone_allow_button_title | ArekMicrophone_deny_button_title |
| Motion | ArekMotion_initial_title | ArekMotion_initial_message | ArekMotion_reenable_title | ArekMotion_reenable_message | ArekMotion_image | ArekMotion_allow_button_title | ArekMotion_deny_button_title |
| Notifications | ArekNotifications_initial_title | ArekNotifications_initial_message | ArekNotifications_reenable_title | ArekNotifications_reenable_message | ArekNotifications_image | ArekNotifications_allow_button_title | ArekNotifications_deny_button_title |
| Photo Library | ArekPhoto_initial_title | ArekPhoto_initial_message | ArekPhoto_reenable_title | ArekPhoto_reenable_message | ArekPhoto_image | ArekPhoto_allow_button_title | ArekPhoto_deny_button_title |
| Reminders | ArekReminders_initial_title | ArekReminders_initial_message | ArekReminders_reenable_title | ArekReminders_reenable_message | ArekReminders_image | ArekReminders_allow_button_title | ArekReminders_ deny_button_title|
| Siri | ArekSiri_initial_title | ArekSiri_initial_message | ArekSiri_reenable_title | ArekSiri_reenable_message | ArekSiri_image | ArekSiri_allow_button_title | ArekSiri_deny_button_title |
| Speech Recognizer | ArekSpeechRecognizer_initial_title | ArekSpeechRecognizer_initial_message | ArekSpeechRecognizer_reenable_title | ArekSpeechRecognizer_reenable_message | ArekSpeechRecognizer_image | ArekSpeechRecognizer_allow_button_title | ArekSpeechRecognizer_deny_button_title |
| Bluetooth | ArekBluetooth_initial_title | ArekBluetooth_initial_message | ArekBluetooth_reenable_title | ArekBluetooth_reenable_message | ArekBluetooth_image | ArekBluetooth_allow_button_title | ArekBluetooth_deny_button_title |
| Location | ArekBaseLocation_initial_title | ArekBaseLocation_initial_message | ArekBaseLocation_reenable_title | ArekBaseLocation_reenable_message | ArekBaseLocation_image | ArekBaseLocation_allow_button_title | ArekBaseLocation_deny_button_title |
Expand Down Expand Up @@ -238,7 +245,8 @@ let package = Package(
)
```

Note that if you want to install a *Swift 3* version of Arek, the latest compatible version is the *1.7.0*.
- Note that if you want to install a *Swift 3* version of Arek, the latest compatible version is the *1.7.0*.
- If you need to build it on Xcode 10, you have to point to the version `3.0.0`.

## Add AREK source code to your project
Add [/~https://github.com/ennioma/arek/tree/master/arek/arek/Arek](/~https://github.com/ennioma/arek/tree/master/arek/Classes) folder to your project.
Expand Down
9 changes: 4 additions & 5 deletions arek.podspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Pod::Spec.new do |s|
s.name = 'arek'
s.version = '2.0.2'
s.version = '4.0.1'
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'}
s.author = { 'Ennio Masi' => 'ennio.masi@gmail.com' }
s.source = { :git => '/~https://github.com/ennioma/arek.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/ennioma'
s.ios.deployment_target = '9.0'
s.swift_version = '4.0'
s.ios.deployment_target = '11.0'
s.swift_version = '4.2'
s.source_files = 'code/Classes/**/*', 'code/Classes/Core/**/*', 'code/Classes/Permissions/**/*'
s.exclude_files = 'Example/*'
s.dependency 'PMAlertController', '3.4.0'
s.dependency 'PMAlertController', '3.5.0'

s.subspec 'Core' do |ss|
ss.source_files = 'code/Classes/Core/**/*.swift'
Expand Down Expand Up @@ -98,7 +98,6 @@ Pod::Spec.new do |s|
ss.dependency 'arek/Core'
ss.source_files = 'code/Classes/Permissions/ArekSpeechRecognizer.swift'
ss.frameworks = 'Speech'
ss.ios.deployment_target = '9.0'
end

end
4 changes: 4 additions & 0 deletions arek.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
6BB101FC1E70450B000CA36F /* ArekBaseLocationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB101E01E70450B000CA36F /* ArekBaseLocationDelegate.swift */; };
6BB101FD1E70450B000CA36F /* ArekLocationAlways.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB101E11E70450B000CA36F /* ArekLocationAlways.swift */; };
6BB101FE1E70450B000CA36F /* ArekLocationWhenInUse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB101E21E70450B000CA36F /* ArekLocationWhenInUse.swift */; };
B6999B072154994A00E5D92A /* ArekSiri.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6999B062154994A00E5D92A /* ArekSiri.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -70,6 +71,7 @@
6BB101E01E70450B000CA36F /* ArekBaseLocationDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArekBaseLocationDelegate.swift; sourceTree = "<group>"; };
6BB101E11E70450B000CA36F /* ArekLocationAlways.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArekLocationAlways.swift; sourceTree = "<group>"; };
6BB101E21E70450B000CA36F /* ArekLocationWhenInUse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArekLocationWhenInUse.swift; sourceTree = "<group>"; };
B6999B062154994A00E5D92A /* ArekSiri.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArekSiri.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -168,6 +170,7 @@
6BB101D81E70450B000CA36F /* ArekPhoto.swift */,
6BB101D91E70450B000CA36F /* ArekReminders.swift */,
6BB101DA1E70450B000CA36F /* ArekSpeechRecognizer.swift */,
B6999B062154994A00E5D92A /* ArekSiri.swift */,
6BB101DB1E70450B000CA36F /* Bluetooth */,
6BB101DE1E70450B000CA36F /* Location */,
);
Expand Down Expand Up @@ -299,6 +302,7 @@
6BB101FC1E70450B000CA36F /* ArekBaseLocationDelegate.swift in Sources */,
6BB101F21E70450B000CA36F /* ArekMediaLibrary.swift in Sources */,
6BB101EF1E70450B000CA36F /* ArekContacts.swift in Sources */,
B6999B072154994A00E5D92A /* ArekSiri.swift in Sources */,
6BB101FB1E70450B000CA36F /* ArekBaseLocation.swift in Sources */,
6BB101EE1E70450B000CA36F /* ArekCloudKit.swift in Sources */,
);
Expand Down
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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
11 changes: 5 additions & 6 deletions code/Classes/Core/Arek.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ open class ArekBasePermission {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = alertDescriptionLineHeight
let attrString = NSMutableAttributedString(string: message)
attrString.addAttribute(NSAttributedStringKey.paragraphStyle, value:paragraphStyle, range:NSMakeRange(0, attrString.length))
attrString.addAttribute(NSAttributedString.Key.paragraphStyle, value:paragraphStyle, range:NSMakeRange(0, attrString.length))
alertVC.alertDescription.attributedText = attrString
}
}
Expand Down Expand Up @@ -337,11 +337,10 @@ open class ArekBasePermission {
let allow = UIAlertAction(title: allowButtonTitle, style: .default) { _ in
alert.dismiss(animated: true, completion: nil)

guard let url = URL(string: UIApplicationOpenSettingsURLString) else { return }

guard let url = URL(string: UIApplication.openSettingsURLString) else { return }
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else if #available(iOS 9.0, *) {
} else {
UIApplication.shared.openURL(url)
}
}
Expand Down Expand Up @@ -377,11 +376,11 @@ open class ArekBasePermission {

alertVC.addAction(PMAlertAction(title: allowButtonTitle, style: .default, action: {
alertVC.dismiss(animated: true, completion: nil)
guard let url = URL(string: UIApplicationOpenSettingsURLString) else { return }
guard let url = URL(string: UIApplication.openSettingsURLString) else { return }

if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else if #available(iOS 9.0, *) {
} else {
UIApplication.shared.openURL(url)
}
}))
Expand Down
Loading

0 comments on commit be604ff

Please sign in to comment.