Skip to content

Commit

Permalink
Update to 5.0.4
Browse files Browse the repository at this point in the history
Fix protect level for `SPPermissionData`.
  • Loading branch information
ivanvorobei committed Nov 19, 2019
1 parent 54ef5ed commit 268d491
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Example/Controllers/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ class ViewController: UITableViewController {
switch segmentControl.selectedSegmentIndex {
case 0:
let controller = SPPermissions.list(selectedPermissions)
controller.dataSource = self
controller.present(on: self)
case 1:
let controller = SPPermissions.dialog(selectedPermissions)
controller.dataSource = self
controller.present(on: self)
case 2:
break
Expand All @@ -46,6 +48,16 @@ class ViewController: UITableViewController {
}
}

/**
DataSource for each permission. REturn nil if you want use default data.
*/
extension ViewController: SPPermissionsDataSource {

func data(for permission: SPPermission) -> SPPermissionData? {
return nil
}
}

extension ViewController {

override func numberOfSections(in tableView: UITableView) -> Int {
Expand Down
2 changes: 1 addition & 1 deletion SPPermissions.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "SPPermissions"
s.version = "5.0.3"
s.version = "5.0.4"
s.summary = "Ask permissions on Swift. Available List, Dialog & Native interface. Can check state permission."
s.homepage = "https://github.com/IvanVorobei/SPPermissions"
s.source = { :git => "https://github.com/IvanVorobei/SPPermissions.git", :tag => s.version }
Expand Down
8 changes: 8 additions & 0 deletions Source/SPPermissions/Models/SPPermissionData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,12 @@ public struct SPPermissionData {
var image: UIImage?
var allowTitle: String
var allowedTitle: String

public init(name: String, description: String, image: UIImage?, allowTitle: String, allowedTitle: String) {
self.name = name
self.description = description
self.image = image
self.allowTitle = allowTitle
self.allowedTitle = allowedTitle
}
}

0 comments on commit 268d491

Please sign in to comment.