Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ad819052c | ||
|
|
318d3e1f8e | ||
|
|
a7a6a1b315 | ||
|
|
96a45035a9 | ||
|
|
003ca5c285 | ||
|
|
bc2e69440c |
@@ -1,5 +1,14 @@
|
|||||||
Changelog
|
Changelog
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
### 2.1.2
|
||||||
|
|
||||||
|
- Use DispatchGroup for download
|
||||||
|
|
||||||
|
### 2.1.1
|
||||||
|
|
||||||
|
- Hide close button when push the controller
|
||||||
|
|
||||||
### 2.1.0
|
### 2.1.0
|
||||||
|
|
||||||
- Add push transition with `pushOpenSourceController(from: self)`
|
- Add push transition with `pushOpenSourceController(from: self)`
|
||||||
|
|||||||
Carthage/Build/iOS/OpenSourceController.framework.dSYM/Contents/Resources/DWARF/OpenSourceController
Generated
Vendored
BIN
Binary file not shown.
Generated
Vendored
BIN
Binary file not shown.
Generated
Vendored
BIN
Binary file not shown.
Generated
Vendored
BIN
Binary file not shown.
Generated
Vendored
BIN
Binary file not shown.
Generated
Vendored
BIN
Binary file not shown.
Generated
Vendored
BIN
Binary file not shown.
Generated
Vendored
BIN
Binary file not shown.
Generated
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -19,6 +19,7 @@
|
|||||||
76EAA8911E93F67B009A41DA /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76EAA8901E93F67B009A41DA /* Array+Extensions.swift */; };
|
76EAA8911E93F67B009A41DA /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76EAA8901E93F67B009A41DA /* Array+Extensions.swift */; };
|
||||||
76EAA8941E93F681009A41DA /* OpenSourceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76EAA8921E93F681009A41DA /* OpenSourceController.swift */; };
|
76EAA8941E93F681009A41DA /* OpenSourceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76EAA8921E93F681009A41DA /* OpenSourceController.swift */; };
|
||||||
76EAA8951E93F681009A41DA /* OpenSourceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76EAA8931E93F681009A41DA /* OpenSourceViewController.swift */; };
|
76EAA8951E93F681009A41DA /* OpenSourceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76EAA8931E93F681009A41DA /* OpenSourceViewController.swift */; };
|
||||||
|
C33E4D96204442AC00142EE6 /* CHANGELOG.md in Resources */ = {isa = PBXBuildFile; fileRef = C33E4D95204442AC00142EE6 /* CHANGELOG.md */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
76EAA8901E93F67B009A41DA /* Array+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Array+Extensions.swift"; path = "../../Sources/Extensions/Array+Extensions.swift"; sourceTree = "<group>"; };
|
76EAA8901E93F67B009A41DA /* Array+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Array+Extensions.swift"; path = "../../Sources/Extensions/Array+Extensions.swift"; sourceTree = "<group>"; };
|
||||||
76EAA8921E93F681009A41DA /* OpenSourceController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSourceController.swift; path = ../../Sources/Controller/OpenSourceController.swift; sourceTree = "<group>"; };
|
76EAA8921E93F681009A41DA /* OpenSourceController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSourceController.swift; path = ../../Sources/Controller/OpenSourceController.swift; sourceTree = "<group>"; };
|
||||||
76EAA8931E93F681009A41DA /* OpenSourceViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSourceViewController.swift; path = ../../Sources/Controller/OpenSourceViewController.swift; sourceTree = "<group>"; };
|
76EAA8931E93F681009A41DA /* OpenSourceViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSourceViewController.swift; path = ../../Sources/Controller/OpenSourceViewController.swift; sourceTree = "<group>"; };
|
||||||
|
C33E4D95204442AC00142EE6 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -52,6 +54,7 @@
|
|||||||
76EAA8581E93F2CC009A41DA = {
|
76EAA8581E93F2CC009A41DA = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
C33E4D95204442AC00142EE6 /* CHANGELOG.md */,
|
||||||
76EAA8631E93F2CC009A41DA /* OpenSourceControllerDemo */,
|
76EAA8631E93F2CC009A41DA /* OpenSourceControllerDemo */,
|
||||||
76EAA8621E93F2CC009A41DA /* Products */,
|
76EAA8621E93F2CC009A41DA /* Products */,
|
||||||
);
|
);
|
||||||
@@ -157,6 +160,7 @@
|
|||||||
76EAA86F1E93F2CC009A41DA /* LaunchScreen.storyboard in Resources */,
|
76EAA86F1E93F2CC009A41DA /* LaunchScreen.storyboard in Resources */,
|
||||||
76EAA86C1E93F2CC009A41DA /* Assets.xcassets in Resources */,
|
76EAA86C1E93F2CC009A41DA /* Assets.xcassets in Resources */,
|
||||||
76EAA86A1E93F2CC009A41DA /* Main.storyboard in Resources */,
|
76EAA86A1E93F2CC009A41DA /* Main.storyboard in Resources */,
|
||||||
|
C33E4D96204442AC00142EE6 /* CHANGELOG.md in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -41,7 +41,7 @@
|
|||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||||
</objects>
|
</objects>
|
||||||
<point key="canvasLocation" x="476" y="138.98050974512745"/>
|
<point key="canvasLocation" x="815.20000000000005" y="138.98050974512745"/>
|
||||||
</scene>
|
</scene>
|
||||||
</scenes>
|
</scenes>
|
||||||
</document>
|
</document>
|
||||||
|
|||||||
@@ -14,14 +14,8 @@ class ViewController: UIViewController {
|
|||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
// Do any additional setup after loading the view, typically from a nib
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func didReceiveMemoryWarning() {
|
|
||||||
super.didReceiveMemoryWarning()
|
|
||||||
// Dispose of any resources that can be recreated.
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - Action
|
// MARK: - Action
|
||||||
|
|
||||||
/// Handle button click & show the controller with licences
|
/// Handle button click & show the controller with licences
|
||||||
@@ -49,10 +43,10 @@ class ViewController: UIViewController {
|
|||||||
url: "https://raw.githubusercontent.com/kishikawakatsumi/KeychainAccess/master/LICENSE")]
|
url: "https://raw.githubusercontent.com/kishikawakatsumi/KeychainAccess/master/LICENSE")]
|
||||||
|
|
||||||
// Present controller
|
// Present controller
|
||||||
openSourceVC.pushOpenSourceController(from: self)
|
openSourceVC.presentOpenSourceController(from: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Customization
|
// MARK: - Customization
|
||||||
|
|
||||||
fileprivate func controllerCustomUI(openSourceVC: OpenSourceController) {
|
fileprivate func controllerCustomUI(openSourceVC: OpenSourceController) {
|
||||||
// Navigation bar title
|
// Navigation bar title
|
||||||
|
|||||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'OpenSourceController'
|
s.name = 'OpenSourceController'
|
||||||
s.version = '2.1.0'
|
s.version = '2.1.2'
|
||||||
s.summary = 'Display all the librarys licence used in your application. Enjoy !'
|
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.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'
|
s.homepage = 'https://github.com/floriangbh/OpenSourceController'
|
||||||
|
|||||||
@@ -124,14 +124,6 @@ OpenSourceController is currently write in english. If you need translation for
|
|||||||
"Unable to load this licence." = "<your_translation>";
|
"Unable to load this licence." = "<your_translation>";
|
||||||
```
|
```
|
||||||
|
|
||||||
## Applications
|
|
||||||
|
|
||||||
Some applications already use this controller like :
|
|
||||||
- [Troll Generator](https://itunes.apple.com/fr/app/troll-generator/id1038097542?mt=8)
|
|
||||||
- [Giraf](https://itunes.apple.com/fr/app/giraf/id1136592561?mt=8)
|
|
||||||
|
|
||||||
What about yours ? If your application also use this library, feel free to contact me or make pull request on the README 😁
|
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
Florian Gabach, florian.gabach@gmail.com
|
Florian Gabach, florian.gabach@gmail.com
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public class OpenSourceController: NSObject {
|
|||||||
open func pushOpenSourceController(from: UIViewController) {
|
open func pushOpenSourceController(from: UIViewController) {
|
||||||
// Create open source controller
|
// Create open source controller
|
||||||
let licenceController = OpenSourceViewController()
|
let licenceController = OpenSourceViewController()
|
||||||
|
licenceController.showCloseButton = false // Don't show close button
|
||||||
|
|
||||||
// Init licence
|
// Init licence
|
||||||
licenceController.licences = self.licences
|
licenceController.licences = self.licences
|
||||||
|
|||||||
@@ -29,9 +29,12 @@ class OpenSourceViewController: UITableViewController {
|
|||||||
/// Contains all licence object before downloaded
|
/// Contains all licence object before downloaded
|
||||||
internal var licences: [LicenceFile]?
|
internal var licences: [LicenceFile]?
|
||||||
|
|
||||||
// Controller configuration for customization
|
/// Controller configuration for customization
|
||||||
internal var config = OpenSourceControllerConfig()
|
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
|
/// Contains all licences object after downloaded
|
||||||
fileprivate var downloadedLicence: [LicenceFile]? {
|
fileprivate var downloadedLicence: [LicenceFile]? {
|
||||||
didSet {
|
didSet {
|
||||||
@@ -58,7 +61,11 @@ class OpenSourceViewController: UITableViewController {
|
|||||||
fileprivate func prepare() {
|
fileprivate func prepare() {
|
||||||
self.prepareTableView()
|
self.prepareTableView()
|
||||||
self.prepareActivityIndicator()
|
self.prepareActivityIndicator()
|
||||||
self.prepareCloseButton()
|
|
||||||
|
if showCloseButton {
|
||||||
|
self.prepareCloseButton()
|
||||||
|
}
|
||||||
|
|
||||||
self.prepareStyle()
|
self.prepareStyle()
|
||||||
self.prepareLicences()
|
self.prepareLicences()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
extension Array {
|
extension Array {
|
||||||
|
|
||||||
/// Get an index safely
|
/// Get an index safely
|
||||||
func get(at index: Int) -> Element? {
|
func get(at index: Int) -> Element? {
|
||||||
guard index >= 0
|
guard index >= 0
|
||||||
|
|||||||
@@ -16,22 +16,20 @@ class LicenceDownloader: NSObject {
|
|||||||
class func downloadLicences(licences: [LicenceFile],
|
class func downloadLicences(licences: [LicenceFile],
|
||||||
config: OpenSourceControllerConfig,
|
config: OpenSourceControllerConfig,
|
||||||
completion: @escaping () -> Void) {
|
completion: @escaping () -> Void) {
|
||||||
// Number of licences
|
let licenceGroupe = DispatchGroup()
|
||||||
let licenceCount = licences.count
|
|
||||||
|
|
||||||
// Already licence downloaded
|
|
||||||
var alreadyDownloaded = 0
|
|
||||||
|
|
||||||
// Download licence's detail for every lience
|
// Download licence's detail for every lience
|
||||||
for licence in licences {
|
for licence in licences {
|
||||||
|
licenceGroupe.enter()
|
||||||
|
|
||||||
licence.downloadLicenceDetail(config: config, completion: { () in
|
licence.downloadLicenceDetail(config: config, completion: { () in
|
||||||
alreadyDownloaded += 1
|
licenceGroupe.leave()
|
||||||
|
|
||||||
// If this is the last licence, perfom completion
|
|
||||||
if licenceCount == alreadyDownloaded {
|
|
||||||
completion()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When everything is downloaded
|
||||||
|
licenceGroupe.notify(queue: .main) {
|
||||||
|
completion()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,14 +22,6 @@ class OpenSourceTableViewCell: UITableViewCell {
|
|||||||
super.init(coder: aDecoder)
|
super.init(coder: aDecoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
||||||
super.setSelected(selected, animated: animated)
|
|
||||||
}
|
|
||||||
|
|
||||||
override func layoutSubviews() {
|
|
||||||
super.layoutSubviews()
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - Prepare
|
// MARK: - Prepare
|
||||||
|
|
||||||
func prepareCellComponent() {
|
func prepareCellComponent() {
|
||||||
|
|||||||
Reference in New Issue
Block a user