Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa41530d47 | ||
|
|
1ac46a4859 | ||
|
|
2c02475a49 | ||
|
|
752558b420 | ||
|
|
1af6fa81f0 | ||
|
|
37c07f099a | ||
|
|
612bb4ca11 | ||
|
|
e6fcda22fc | ||
|
|
f9282dcef2 | ||
|
|
8e47206f83 |
@@ -1,6 +1,19 @@
|
|||||||
Changelog
|
Changelog
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
### 4.1.1
|
||||||
|
|
||||||
|
- Fix build
|
||||||
|
|
||||||
|
### 4.1.0
|
||||||
|
|
||||||
|
- Add SwiftUI support (thanks to doronkatz)
|
||||||
|
|
||||||
|
### 4.0.2
|
||||||
|
|
||||||
|
- Fix pod release
|
||||||
|
- Add Github workflow
|
||||||
|
|
||||||
### 4.0.1
|
### 4.0.1
|
||||||
|
|
||||||
- Fix SPM
|
- Fix SPM
|
||||||
|
|||||||
@@ -6,4 +6,5 @@ Contributors to the codebase :
|
|||||||
| Name | Github handle | Mail |
|
| Name | Github handle | Mail |
|
||||||
| ------------- |------------- | ----- |
|
| ------------- |------------- | ----- |
|
||||||
| David Lari | DavidLari | / |
|
| David Lari | DavidLari | / |
|
||||||
|
| Doron Katz | | David Lari | DavidLari | / |
|
||||||
|
|
||||||
|
|||||||
BIN
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 = '4.0.2'
|
s.version = '4.1.1'
|
||||||
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'
|
||||||
|
|||||||
@@ -241,7 +241,7 @@
|
|||||||
52D6D9851BEFF229002C0205 = {
|
52D6D9851BEFF229002C0205 = {
|
||||||
CreatedOnToolsVersion = 7.1;
|
CreatedOnToolsVersion = 7.1;
|
||||||
DevelopmentTeam = XEHEC9B46E;
|
DevelopmentTeam = XEHEC9B46E;
|
||||||
LastSwiftMigration = "";
|
LastSwiftMigration = 1130;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -499,7 +499,7 @@
|
|||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.OpenSourceController.OpenSourceController-iOS-Tests";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.OpenSourceController.OpenSourceController-iOS-Tests";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@@ -514,7 +514,7 @@
|
|||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.OpenSourceController.OpenSourceController-iOS-Tests";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.OpenSourceController.OpenSourceController-iOS-Tests";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -61,6 +61,30 @@ openSourceVC.presentOpenSourceController(from: self)
|
|||||||
openSourceVC.pushOpenSourceController(from: self)
|
openSourceVC.pushOpenSourceController(from: self)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
With SwiftUI :
|
||||||
|
|
||||||
|
```swift
|
||||||
|
struct OpenSourceView: UIViewControllerRepresentable {
|
||||||
|
@available(iOS 13, *)
|
||||||
|
public func updateUIViewController(_ uiViewController: OpenSourceViewController, context: UIViewControllerRepresentableContext<OpenSourceView>) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
@available(iOS 13, *)
|
||||||
|
public func makeUIViewController(context: UIViewControllerRepresentableContext<OpenSourceView>) -> OpenSourceViewController {
|
||||||
|
let openSourceVC = OpenSourceViewController(licences:
|
||||||
|
[LicenceFile(title: "FacebookImagePicker",
|
||||||
|
url: "https://raw.githubusercontent.com/terflogag/FacebookImagePicker/master/LICENSE"),
|
||||||
|
LicenceFile(title: "JSQMessagesViewController",
|
||||||
|
url: "https://raw.githubusercontent.com/jessesquires/JSQMessagesViewController/develop/LICENSE")],
|
||||||
|
showCloseButton: true,
|
||||||
|
configuration: OpenSourceControllerConfig(),
|
||||||
|
licenceLoader: LicenceLoader())
|
||||||
|
return openSourceVC
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Customisation
|
## Customisation
|
||||||
|
|
||||||
You can apply some customisation. To do it you can use the OpenSourceControllerConfig structure like this :
|
You can apply some customisation. To do it you can use the OpenSourceControllerConfig structure like this :
|
||||||
|
|||||||
@@ -6,9 +6,13 @@
|
|||||||
// Copyright © 2018 OpenSourceController. All rights reserved.
|
// Copyright © 2018 OpenSourceController. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if !os(macOS)
|
||||||
import UIKit
|
import UIKit
|
||||||
|
#else
|
||||||
|
import AppKit
|
||||||
|
#endif
|
||||||
|
|
||||||
final class LicenceListViewController: UITableViewController {
|
open class LicenceListViewController: UITableViewController {
|
||||||
|
|
||||||
// MARK: - Var
|
// MARK: - Var
|
||||||
|
|
||||||
@@ -24,11 +28,11 @@ final class LicenceListViewController: UITableViewController {
|
|||||||
super.init(style: .plain)
|
super.init(style: .plain)
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder aDecoder: NSCoder) {
|
required public init?(coder aDecoder: NSCoder) {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override open func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
self.prepareTableView()
|
self.prepareTableView()
|
||||||
@@ -50,22 +54,22 @@ extension LicenceListViewController {
|
|||||||
|
|
||||||
// MARK: - Table View Data Source
|
// MARK: - Table View Data Source
|
||||||
|
|
||||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
override open func numberOfSections(in tableView: UITableView) -> Int {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
override open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||||
return self.downloadedLicence.count
|
return self.downloadedLicence.count
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
override open func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||||
let cell: OpenSourceTableViewCell = tableView.dequeueReusableCell(for: indexPath)
|
let cell: OpenSourceTableViewCell = tableView.dequeueReusableCell(for: indexPath)
|
||||||
guard let licence = self.downloadedLicence.get(at: indexPath.row) else { return cell }
|
guard let licence = self.downloadedLicence.get(at: indexPath.row) else { return cell }
|
||||||
cell.configure(licence: licence, config: self.config)
|
cell.configure(licence: licence, config: self.config)
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
|
override open func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||||
return UITableView.automaticDimension
|
return UITableView.automaticDimension
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
final class LoadingViewController: UIViewController {
|
open class LoadingViewController: UIViewController {
|
||||||
|
|
||||||
// MARK: - Var
|
// MARK: - Var
|
||||||
|
|
||||||
@@ -32,11 +32,11 @@ final class LoadingViewController: UIViewController {
|
|||||||
super.init(nibName: nil, bundle: nil)
|
super.init(nibName: nil, bundle: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder aDecoder: NSCoder) {
|
required public init?(coder aDecoder: NSCoder) {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override open func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
self.view.backgroundColor = self.config.uiConfig.backgroundColor
|
self.view.backgroundColor = self.config.uiConfig.backgroundColor
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
final class OpenSourceTableViewCell: UITableViewCell, Reusable {
|
open class OpenSourceTableViewCell: UITableViewCell, Reusable {
|
||||||
|
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ final class OpenSourceTableViewCell: UITableViewCell, Reusable {
|
|||||||
self.prepareCellComponent()
|
self.prepareCellComponent()
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder aDecoder: NSCoder) {
|
required public init?(coder aDecoder: NSCoder) {
|
||||||
super.init(coder: aDecoder)
|
super.init(coder: aDecoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
final class OpenSourceViewController: UIViewController {
|
open class OpenSourceViewController: UIViewController {
|
||||||
|
|
||||||
// MARK: - Var
|
// MARK: - Var
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ final class OpenSourceViewController: UIViewController {
|
|||||||
|
|
||||||
// MARK: - Lifecyle
|
// MARK: - Lifecyle
|
||||||
|
|
||||||
init(licences: [LicenceFile],
|
public init(licences: [LicenceFile],
|
||||||
showCloseButton: Bool,
|
showCloseButton: Bool,
|
||||||
configuration: OpenSourceControllerConfig,
|
configuration: OpenSourceControllerConfig,
|
||||||
licenceLoader: LicenceLoader) {
|
licenceLoader: LicenceLoader) {
|
||||||
@@ -42,11 +42,11 @@ final class OpenSourceViewController: UIViewController {
|
|||||||
super.init(nibName: nil, bundle: nil)
|
super.init(nibName: nil, bundle: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder aDecoder: NSCoder) {
|
required public init?(coder aDecoder: NSCoder) {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override open func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
self.title = self.config.title
|
self.title = self.config.title
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
final class HTTPDataLoader {
|
open class HTTPDataLoader {
|
||||||
func loadData(fromUrl url: String, completion: @escaping (Data?) -> Void) {
|
func loadData(fromUrl url: String, completion: @escaping (Data?) -> Void) {
|
||||||
if let url = URL(string: url) {
|
if let url = URL(string: url) {
|
||||||
let task = URLSession.shared.dataTask(with: url) { (data, _, error) in
|
let task = URLSession.shared.dataTask(with: url) { (data, _, error) in
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
final class LicenceLoader {
|
open class LicenceLoader {
|
||||||
|
|
||||||
/// Download every licence
|
/// Download every licence
|
||||||
///
|
///
|
||||||
@@ -32,4 +32,6 @@ final class LicenceLoader {
|
|||||||
completion()
|
completion()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public init() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public final class LicenceFile {
|
open class LicenceFile {
|
||||||
|
|
||||||
// MARK- Var
|
// MARK- Var
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
// Created by Florian Gabach on 05/02/2017.
|
// Created by Florian Gabach on 05/02/2017.
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
#if canImport(SwiftUI)
|
||||||
|
import SwiftUI
|
||||||
|
#endif
|
||||||
|
|
||||||
open class OpenSourceController: NSObject {
|
open class OpenSourceController: NSObject {
|
||||||
|
|
||||||
@@ -43,3 +46,4 @@ open class OpenSourceController: NSObject {
|
|||||||
navigationController.pushViewController(licenceController, animated: true)
|
navigationController.pushViewController(licenceController, animated: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,5 +35,8 @@ public struct OpenSourceControllerConfig {
|
|||||||
public var verbose: Bool = false
|
public var verbose: Bool = false
|
||||||
|
|
||||||
/// UI-specific configuration.
|
/// UI-specific configuration.
|
||||||
|
|
||||||
|
public init() {
|
||||||
|
}
|
||||||
public var uiConfig = UIConfig()
|
public var uiConfig = UIConfig()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
extension UITableView {
|
extension UITableView {
|
||||||
final func register<T: UITableViewCell>(cellType: T.Type)
|
open func register<T: UITableViewCell>(cellType: T.Type)
|
||||||
where T: Reusable {
|
where T: Reusable {
|
||||||
self.register(cellType.self, forCellReuseIdentifier: cellType.reuseIdentifier)
|
self.register(cellType.self, forCellReuseIdentifier: cellType.reuseIdentifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
final func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath, cellType: T.Type = T.self) -> T
|
open func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath, cellType: T.Type = T.self) -> T
|
||||||
where T: Reusable {
|
where T: Reusable {
|
||||||
guard let cell = self.dequeueReusableCell(withIdentifier: cellType.reuseIdentifier, for: indexPath) as? T else {
|
guard let cell = self.dequeueReusableCell(withIdentifier: cellType.reuseIdentifier, for: indexPath) as? T else {
|
||||||
fatalError(
|
fatalError(
|
||||||
|
|||||||
Reference in New Issue
Block a user