8000 Merge update to popup customisation (#113) · ennioma/arek@3f85456 · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Merge update to popup customisation (#113)
Browse files Browse the repository at this point in the history
* Added optional ArekPopupStyle parameter

It allows to manipulate PMAlertController visual aspects such as:

- cornerRadius
- alertMaskBackground (color/alpha)
- alertTitleText (color/font)
- alertDescriptionText (color/font)
- headerViewHeight (to adjust image size)
- deny/allow buttons (color/font)

If ArekPopupStyle is not passed, then defaults of PMAlertController are used.

* Added line height customisation option

* Code refactoring

* Added padding options supported by PMAlertController

Supported optional options:

- headerViewTopSpace
- alertDescriptionLeftSpace
- alertDescriptionRightSpace
- alertDescriptionTopSpace
- alertButtonsLeftSpace
- alertButtonsRightSpace
- alertButtonsTopSpace
- alertButtonsBottomSpace

* Example update

* Podspec update to PMAlertController 3.4.0

* Bump version 2.0.1
  • Loading branch information
ennioma authored Jun 7, 2018
1 parent 3533d17 commit 3f85456
Show file tree
Hide file tree
Showing 6 changed files with 319 additions and 30 deletions.
30 changes: 28 additions & 2 deletions Example/arek_example/ArekCellVMServiceProgrammatically.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,34 @@ class ArekCellVMServiceProgrammatically {
let data = permissions[index]

let configuration = ArekConfiguration(frequency: .Always, presentInitialPopup: true, presentReEnablePopup: true)
let initialPopupData = ArekPopupData(title: data["popupDataTitle"]!, message: data["enableTitle"]!, image: "", allowButtonTitle: data["allowButtonTitle"]!, denyButtonTitle: data["denyButtonTitle"]!, type: getPopupType(index: index))
let reenablePopupData = ArekPopupData(title: data["popupDataTitle"]!, message: data["reEnableTitle"]!, image: "", allowButtonTitle: data["allowButtonTitle"]!, denyButtonTitle: data["denyButtonTitle"]!, type: getPopupType(index: index))
let initialPopupData = ArekPopupData(title: data["popupDataTitle"]!,
message: data["enableTitle"]!,
image: "",
allowButtonTitle: data["allowButtonTitle"]!,
denyButtonTitle: data["denyButtonTitle"]!,
type: getPopupType(index: index),
styling: ArekPopupStyle(cornerRadius: 0.9,
maskBackgroundColor: UIColor.orange,
maskBackgroundAlpha: 1.0,
titleTextColor: UIColor.green,
titleFont: nil,
descriptionFont: nil,
descriptionLineHeight: nil,
headerViewHeightConstraint: nil,
allowButtonTitleColor: nil,
allowButtonTitleFont: nil,
denyButtonTitleColor: UIColor.brown,
denyButtonTitleFont: nil,
headerViewTopSpace: 20,
descriptionLeftSpace: 20,
descriptionRightSpace: 20,
descriptionTopSpace: 20,
buttonsLeftSpace: 0,
buttonsRightSpace: 0,
buttonsTopSpace: 20,
buttonsBottomSpace: 0))

let reenablePopupData = ArekPopupData(title: data["popupDataTitle"]!, message: data["reEnableTitle"]!, image: "", allowButtonTitle: data["allowButtonTitle"]!, denyButtonTitle: data["denyButtonTitle"]!, type: getPopupType(index: index), styling: nil)

let permission = getPermissionType(index: index, configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reenablePopupData)
return ArekCellVM(permission: permission!, title: data["popupDataTitle"]!)
Expand Down
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.0'
pod 'arek', '~> 2.0.1'
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.0'
pod 'arek/Bluetooth', '~> 2.0.1'
end
```

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

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

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
4 changes: 2 additions & 2 deletions 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.0'
s.version = '2.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'}
Expand All @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.swift_version = '4.0'
s.source_files = 'code/Classes/**/*', 'code/Classes/Core/**/*', 'code/Classes/Permissions/**/*'
s.exclude_files = 'Example/*'
s.dependency 'PMAlertController', '3.2.0'
s.dependency 'PMAlertController', '3.4.0'

s.subspec 'Core' do |ss|
ss.source_files = 'code/Classes/Core/**/*.swift'
Expand Down
Loading

0 comments on commit 3f85456

Please sign in to comment.
0