Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ad819052c | ||
|
|
318d3e1f8e | ||
|
|
a7a6a1b315 | ||
|
|
96a45035a9 | ||
|
|
003ca5c285 | ||
|
|
bc2e69440c | ||
|
|
794d5a2d86 | ||
|
|
c5beca03f7 | ||
|
|
7ee4cfa0fd | ||
|
|
4dc34e956a | ||
|
|
584e357f0e | ||
|
|
243ee49fc1 | ||
|
|
5f53dbe6b5 | ||
|
|
97ceb32d29 |
+43
@@ -0,0 +1,43 @@
|
||||
# Mac OS X
|
||||
.DS_Store
|
||||
|
||||
# Xcode
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
*.xcscmblueprint
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
*.ipa
|
||||
|
||||
## Playgrounds
|
||||
timeline.xctimeline
|
||||
playground.xcworkspace
|
||||
|
||||
# Swift Package Manager
|
||||
.build/
|
||||
|
||||
# Carthage
|
||||
Carthage/
|
||||
|
||||
# Cocoapods
|
||||
Pods/
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
Changelog
|
||||
==========
|
||||
|
||||
### 2.1.2
|
||||
|
||||
- Use DispatchGroup for download
|
||||
|
||||
### 2.1.1
|
||||
|
||||
- Hide close button when push the controller
|
||||
|
||||
### 2.1.0
|
||||
|
||||
- Add push transition with `pushOpenSourceController(from: self)`
|
||||
|
||||
### 2.0.1
|
||||
|
||||
- Clean code and move loader position
|
||||
|
||||
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 */; };
|
||||
76EAA8941E93F681009A41DA /* OpenSourceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76EAA8921E93F681009A41DA /* OpenSourceController.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 */
|
||||
|
||||
/* 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>"; };
|
||||
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>"; };
|
||||
C33E4D95204442AC00142EE6 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -52,6 +54,7 @@
|
||||
76EAA8581E93F2CC009A41DA = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C33E4D95204442AC00142EE6 /* CHANGELOG.md */,
|
||||
76EAA8631E93F2CC009A41DA /* OpenSourceControllerDemo */,
|
||||
76EAA8621E93F2CC009A41DA /* Products */,
|
||||
);
|
||||
@@ -157,6 +160,7 @@
|
||||
76EAA86F1E93F2CC009A41DA /* LaunchScreen.storyboard in Resources */,
|
||||
76EAA86C1E93F2CC009A41DA /* Assets.xcassets in Resources */,
|
||||
76EAA86A1E93F2CC009A41DA /* Main.storyboard in Resources */,
|
||||
C33E4D96204442AC00142EE6 /* CHANGELOG.md in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
BIN
Binary file not shown.
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -37,10 +37,11 @@
|
||||
<constraint firstItem="LI4-fC-2Ry" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="wVV-oT-zRH"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="0ga-4U-IeA"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="136.80000000000001" y="138.98050974512745"/>
|
||||
<point key="canvasLocation" x="815.20000000000005" y="138.98050974512745"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
||||
@@ -14,14 +14,8 @@ class ViewController: UIViewController {
|
||||
|
||||
override func 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
|
||||
|
||||
/// Handle button click & show the controller with licences
|
||||
@@ -52,7 +46,7 @@ class ViewController: UIViewController {
|
||||
openSourceVC.presentOpenSourceController(from: self)
|
||||
}
|
||||
|
||||
// Customization
|
||||
// MARK: - Customization
|
||||
|
||||
fileprivate func controllerCustomUI(openSourceVC: OpenSourceController) {
|
||||
// Navigation bar title
|
||||
|
||||
Binary file not shown.
@@ -1,12 +1,12 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'OpenSourceController'
|
||||
s.version = '2.0.1'
|
||||
s.version = '2.1.2'
|
||||
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'
|
||||
s.homepage = 'https://github.com/floriangbh/OpenSourceController'
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
s.author = { 'Florian Gabach' => 'contact@floriangabach.fr' }
|
||||
s.source = { :git => 'https://github.com/terflogag/OpenSourceController.git', :tag => s.version.to_s }
|
||||
s.author = { 'Florian Gabach' => 'florian.gabach@gmail.com' }
|
||||
s.source = { :git => 'https://github.com/floriangbh/OpenSourceController.git', :tag => s.version.to_s }
|
||||
s.ios.deployment_target = '9.0'
|
||||
s.source_files = 'Sources/**/*'
|
||||
end
|
||||
|
||||
BIN
Binary file not shown.
@@ -81,6 +81,9 @@ url: "https://raw.githubusercontent.com/jessesquires/JSQMessagesViewController/d
|
||||
|
||||
// Present controller
|
||||
openSourceVC.presentOpenSourceController(from: self)
|
||||
|
||||
// OR push the controller if the source controller is embeded in navigation controller
|
||||
openSourceVC.pushOpenSourceController(from: self)
|
||||
```
|
||||
|
||||
## Customisation
|
||||
@@ -121,14 +124,6 @@ OpenSourceController is currently write in english. If you need translation for
|
||||
"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
|
||||
|
||||
Florian Gabach, florian.gabach@gmail.com
|
||||
|
||||
@@ -33,4 +33,26 @@ public class OpenSourceController: NSObject {
|
||||
// Present controller
|
||||
from.present(navController, animated: true)
|
||||
}
|
||||
|
||||
/// Push OpenSourceViewController from navigation controller
|
||||
///
|
||||
/// - Parameter from: the source controller
|
||||
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
|
||||
|
||||
// Init config
|
||||
licenceController.config = self.config
|
||||
|
||||
// Push controller
|
||||
guard let navigationController = from.navigationController else {
|
||||
print("Source controller isn't embeded in navigation controller. Can't push.")
|
||||
return
|
||||
}
|
||||
navigationController.pushViewController(licenceController, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
import Foundation
|
||||
|
||||
extension Array {
|
||||
|
||||
/// Get an index safely
|
||||
func get(at index: Int) -> Element? {
|
||||
guard index >= 0
|
||||
|
||||
@@ -16,22 +16,20 @@ class LicenceDownloader: NSObject {
|
||||
class func downloadLicences(licences: [LicenceFile],
|
||||
config: OpenSourceControllerConfig,
|
||||
completion: @escaping () -> Void) {
|
||||
// Number of licences
|
||||
let licenceCount = licences.count
|
||||
|
||||
// Already licence downloaded
|
||||
var alreadyDownloaded = 0
|
||||
let licenceGroupe = DispatchGroup()
|
||||
|
||||
// Download licence's detail for every lience
|
||||
for licence in licences {
|
||||
licenceGroupe.enter()
|
||||
|
||||
licence.downloadLicenceDetail(config: config, completion: { () in
|
||||
alreadyDownloaded += 1
|
||||
|
||||
// If this is the last licence, perfom completion
|
||||
if licenceCount == alreadyDownloaded {
|
||||
completion()
|
||||
}
|
||||
licenceGroupe.leave()
|
||||
})
|
||||
}
|
||||
|
||||
// When everything is downloaded
|
||||
licenceGroupe.notify(queue: .main) {
|
||||
completion()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,14 +22,6 @@ class OpenSourceTableViewCell: UITableViewCell {
|
||||
super.init(coder: aDecoder)
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
}
|
||||
|
||||
// MARK: - Prepare
|
||||
|
||||
func prepareCellComponent() {
|
||||
|
||||
Reference in New Issue
Block a user