diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f3ba8c..cb2cd96 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
Changelog
==========
+### 2.1.1
+
+- Hide close button when push the controller
+
### 2.1.0
- Add push transition with `pushOpenSourceController(from: self)`
diff --git a/Exemple/OpenSourceControllerDemo.xcodeproj/project.xcworkspace/xcuserdata/florian.gabach.xcuserdatad/UserInterfaceState.xcuserstate b/Exemple/OpenSourceControllerDemo.xcodeproj/project.xcworkspace/xcuserdata/florian.gabach.xcuserdatad/UserInterfaceState.xcuserstate
index 5211b0f..700610c 100644
Binary files a/Exemple/OpenSourceControllerDemo.xcodeproj/project.xcworkspace/xcuserdata/florian.gabach.xcuserdatad/UserInterfaceState.xcuserstate and b/Exemple/OpenSourceControllerDemo.xcodeproj/project.xcworkspace/xcuserdata/florian.gabach.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/Exemple/OpenSourceControllerDemo/Base.lproj/Main.storyboard b/Exemple/OpenSourceControllerDemo/Base.lproj/Main.storyboard
index e188514..10a8afa 100644
--- a/Exemple/OpenSourceControllerDemo/Base.lproj/Main.storyboard
+++ b/Exemple/OpenSourceControllerDemo/Base.lproj/Main.storyboard
@@ -41,7 +41,7 @@
-
+
diff --git a/Exemple/OpenSourceControllerDemo/ViewController.swift b/Exemple/OpenSourceControllerDemo/ViewController.swift
index ff579e4..769ebee 100644
--- a/Exemple/OpenSourceControllerDemo/ViewController.swift
+++ b/Exemple/OpenSourceControllerDemo/ViewController.swift
@@ -49,7 +49,7 @@ class ViewController: UIViewController {
url: "https://raw.githubusercontent.com/kishikawakatsumi/KeychainAccess/master/LICENSE")]
// Present controller
- openSourceVC.pushOpenSourceController(from: self)
+ openSourceVC.presentOpenSourceController(from: self)
}
// Customization
diff --git a/OpenSourceController.podspec b/OpenSourceController.podspec
index 88012b9..23bc2c3 100644
--- a/OpenSourceController.podspec
+++ b/OpenSourceController.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'OpenSourceController'
-s.version = '2.1.0'
+s.version = '2.1.1'
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/floriangbh/OpenSourceController'
diff --git a/Sources/Controller/OpenSourceController.swift b/Sources/Controller/OpenSourceController.swift
index b1942c7..094157d 100644
--- a/Sources/Controller/OpenSourceController.swift
+++ b/Sources/Controller/OpenSourceController.swift
@@ -40,6 +40,7 @@ public class OpenSourceController: NSObject {
open func pushOpenSourceController(from: UIViewController) {
// Create open source controller
let licenceController = OpenSourceViewController()
+ licenceController.showCloseButton = false // Don't show close button
// Init licence
licenceController.licences = self.licences
diff --git a/Sources/Controller/OpenSourceViewController.swift b/Sources/Controller/OpenSourceViewController.swift
index e07a7ee..2bd1b0f 100644
--- a/Sources/Controller/OpenSourceViewController.swift
+++ b/Sources/Controller/OpenSourceViewController.swift
@@ -29,9 +29,12 @@ class OpenSourceViewController: UITableViewController {
/// Contains all licence object before downloaded
internal var licences: [LicenceFile]?
- // Controller configuration for customization
+ /// Controller configuration for customization
internal var config = OpenSourceControllerConfig()
+ /// Do we need to show the close button ? (disable if push the controller)
+ internal var showCloseButton: Bool = true
+
/// Contains all licences object after downloaded
fileprivate var downloadedLicence: [LicenceFile]? {
didSet {
@@ -58,7 +61,11 @@ class OpenSourceViewController: UITableViewController {
fileprivate func prepare() {
self.prepareTableView()
self.prepareActivityIndicator()
- self.prepareCloseButton()
+
+ if showCloseButton {
+ self.prepareCloseButton()
+ }
+
self.prepareStyle()
self.prepareLicences()
}