Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e05dd8699e | ||
|
|
599de6b72a |
@@ -1,6 +1,10 @@
|
||||
Changelog
|
||||
==========
|
||||
|
||||
### 1.0.5
|
||||
|
||||
- Fix default customisation
|
||||
|
||||
### 1.0.4
|
||||
|
||||
- Add customisation way
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'OpenSourceController'
|
||||
s.version = '1.0.4'
|
||||
s.version = '1.0.5'
|
||||
s.summary = 'Display all the librarys licence used in your application. Enjoy !'
|
||||
s.description = 'Display a screen with all licence used in your apply can be painful to maintain. OpenSourceController was built to respond to this problem. OpenSourceController is a simple parser to display the licences which are used in your application.'
|
||||
s.homepage = 'https://github.com/terflogag/OpenSourceController'
|
||||
|
||||
@@ -76,18 +76,24 @@ class OpenSourceViewController: UITableViewController {
|
||||
self.tableView.dataSource = self
|
||||
self.tableView.delegate = self
|
||||
self.tableView.separatorStyle = .singleLine
|
||||
self.tableView.backgroundColor = config.uiConfig.backgroundColor
|
||||
if let backgroundColor = self.config.uiConfig.backgroundColor {
|
||||
self.tableView.backgroundColor = backgroundColor
|
||||
}
|
||||
|
||||
// Navigation bar
|
||||
self.navigationController?.navigationBar.barTintColor = self.config.uiConfig.barTintColor
|
||||
let attribut = [NSForegroundColorAttributeName: self.config.uiConfig.titleColor]
|
||||
self.navigationController?.navigationBar.titleTextAttributes = attribut
|
||||
if let tintColor = self.config.uiConfig.barTintColor {
|
||||
self.navigationController?.navigationBar.barTintColor = tintColor
|
||||
}
|
||||
if let textColor = self.config.uiConfig.titleColor {
|
||||
let attribut = [NSForegroundColorAttributeName: textColor]
|
||||
self.navigationController?.navigationBar.titleTextAttributes = attribut
|
||||
}
|
||||
|
||||
// Close button (on the right corner of navigation bar)
|
||||
let closeButton = UIBarButtonItem(barButtonSystemItem: .stop,
|
||||
target: self,
|
||||
action: #selector(self.closePicker))
|
||||
closeButton.tintColor = config.uiConfig.closeButtonColor
|
||||
closeButton.tintColor = config.uiConfig.closeButtonColor ?? UIColor.black
|
||||
self.navigationItem.rightBarButtonItem = closeButton
|
||||
|
||||
// Loading indicator
|
||||
|
||||
@@ -12,22 +12,22 @@ public struct OpenSourceControllerConfig {
|
||||
/// Sub-stuct holding configuration relevant to UI presentation !
|
||||
public struct UIConfig {
|
||||
/// Will be applied to the navigation bar
|
||||
public var barTintColor: UIColor = UIColor(red: 246/255.0, green: 246/255.0, blue: 246/255.0, alpha: 1.0)
|
||||
public var barTintColor: UIColor?
|
||||
|
||||
/// Will be applied to the navigation bar
|
||||
public var backgroundColor: UIColor = UIColor(red: 246/255.0, green: 246/255.0, blue: 246/255.0, alpha: 1.0)
|
||||
public var backgroundColor: UIColor?
|
||||
|
||||
/// Will be applied to licence text
|
||||
public var licenceBackgroundColor: UIColor = UIColor.white
|
||||
public var licenceBackgroundColor: UIColor?
|
||||
|
||||
/// Will be applied to the navigation bar
|
||||
public var closeButtonColor: UIColor = UIColor.black
|
||||
public var closeButtonColor: UIColor?
|
||||
|
||||
/// Will be applied to licence text
|
||||
public var licenceTextColor: UIColor = UIColor.black
|
||||
public var licenceTextColor: UIColor?
|
||||
|
||||
/// Will be applied to licence text
|
||||
public var titleColor: UIColor = UIColor.black
|
||||
public var titleColor: UIColor?
|
||||
}
|
||||
|
||||
/// Will be applied to the navigation bar title
|
||||
|
||||
@@ -64,6 +64,8 @@ class OpenSourceTableViewCell: UITableViewCell {
|
||||
self.textLabel?.textColor = config.uiConfig.licenceTextColor
|
||||
|
||||
// Background
|
||||
self.backgroundColor = config.uiConfig.licenceBackgroundColor
|
||||
if let backgroundColor = config.uiConfig.licenceBackgroundColor {
|
||||
self.backgroundColor = backgroundColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user