Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
752558b420 | ||
|
|
1af6fa81f0 | ||
|
|
37c07f099a | ||
|
|
612bb4ca11 | ||
|
|
e6fcda22fc | ||
|
|
f9282dcef2 | ||
|
|
8e47206f83 | ||
|
|
aca50feac8 | ||
|
|
bdc6b5b6dd | ||
|
|
846edcd8c1 | ||
|
|
e9192698e9 | ||
|
|
226b1e3219 | ||
|
|
0f4a0dc5ad | ||
|
|
7eb1e95fd6 | ||
|
|
b38c71af0b |
@@ -0,0 +1,15 @@
|
||||
name: Build
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: macOS-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Fastlane Action
|
||||
uses: maierj/fastlane-action@v1.0.0
|
||||
with:
|
||||
lane: scan_project
|
||||
@@ -40,4 +40,5 @@ Carthage/
|
||||
|
||||
# Cocoapods
|
||||
Pods/
|
||||
fastlane/report.xml
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
Changelog
|
||||
==========
|
||||
|
||||
### 4.1.0
|
||||
|
||||
- Add SwiftUI support (thanks to doronkatz)
|
||||
|
||||
### 4.0.2
|
||||
|
||||
- Fix pod release
|
||||
- Add Github workflow
|
||||
|
||||
### 4.0.1
|
||||
|
||||
- Fix SPM
|
||||
|
||||
### 4.0.0
|
||||
|
||||
- Swift 5.1
|
||||
|
||||
@@ -6,4 +6,5 @@ Contributors to the codebase :
|
||||
| Name | Github handle | Mail |
|
||||
| ------------- |------------- | ----- |
|
||||
| David Lari | DavidLari | / |
|
||||
| Doron Katz | | David Lari | DavidLari | / |
|
||||
|
||||
|
||||
BIN
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'OpenSourceController'
|
||||
s.version = '4.0.1'
|
||||
s.version = '4.1.0'
|
||||
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'
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
52D6D9871BEFF229002C0205 /* OpenSourceController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D97C1BEFF229002C0205 /* OpenSourceController.framework */; };
|
||||
76229B722180AD8400A61697 /* LicenceLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76229B712180AD8400A61697 /* LicenceLoader.swift */; };
|
||||
76229B7D2180AD9F00A61697 /* HTTPDataLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76229B7C2180AD9F00A61697 /* HTTPDataLoader.swift */; };
|
||||
76229B802180ADA800A61697 /* OpenSourceControllerConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76229B7E2180ADA800A61697 /* OpenSourceControllerConfig.swift */; };
|
||||
76229B812180ADA800A61697 /* OpenSourceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76229B7F2180ADA800A61697 /* OpenSourceController.swift */; };
|
||||
@@ -16,12 +15,16 @@
|
||||
769FD9D221871DEC00FB5A53 /* LicenceListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769FD9CE21871DEC00FB5A53 /* LicenceListViewController.swift */; };
|
||||
769FD9D321871DEC00FB5A53 /* LoadingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769FD9CF21871DEC00FB5A53 /* LoadingViewController.swift */; };
|
||||
769FD9D421871DEC00FB5A53 /* OpenSourceTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769FD9D021871DEC00FB5A53 /* OpenSourceTableViewCell.swift */; };
|
||||
76B7980F238844F300009193 /* LicenceLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76B7980E238844F300009193 /* LicenceLoader.swift */; };
|
||||
76B79811238845D300009193 /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76B79810238845D300009193 /* Style.swift */; };
|
||||
76D7F24521BEB18A004B74CB /* UITableView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D7F24021BEB18A004B74CB /* UITableView+Extensions.swift */; };
|
||||
76D7F24621BEB18A004B74CB /* Reusable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D7F24121BEB18A004B74CB /* Reusable.swift */; };
|
||||
76D7F24721BEB18A004B74CB /* UIViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D7F24221BEB18A004B74CB /* UIViewController+Extensions.swift */; };
|
||||
76D7F24821BEB18A004B74CB /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D7F24321BEB18A004B74CB /* Array+Extensions.swift */; };
|
||||
76D7F24921BEB18A004B74CB /* UIView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D7F24421BEB18A004B74CB /* UIView+Extensions.swift */; };
|
||||
76EAA84F1E93EDCD009A41DA /* LicenceFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76EAA84C1E93EDCD009A41DA /* LicenceFile.swift */; };
|
||||
C415E47723E0B3AE002F960D /* OpenSourceViewController+UISwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = C415E47623E0B3AE002F960D /* OpenSourceViewController+UISwift.swift */; };
|
||||
C415E47823E0B3AE002F960D /* OpenSourceViewController+UISwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = C415E47623E0B3AE002F960D /* OpenSourceViewController+UISwift.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -37,7 +40,6 @@
|
||||
/* Begin PBXFileReference section */
|
||||
52D6D97C1BEFF229002C0205 /* OpenSourceController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpenSourceController.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
52D6D9861BEFF229002C0205 /* OpenSourceController-iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OpenSourceController-iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
76229B712180AD8400A61697 /* LicenceLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LicenceLoader.swift; path = Sources/Model/LicenceLoader.swift; sourceTree = "<group>"; };
|
||||
76229B7C2180AD9F00A61697 /* HTTPDataLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPDataLoader.swift; path = Sources/Loader/HTTPDataLoader.swift; sourceTree = "<group>"; };
|
||||
76229B7E2180ADA800A61697 /* OpenSourceControllerConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSourceControllerConfig.swift; path = Sources/OpenSourceControllerConfig.swift; sourceTree = "<group>"; };
|
||||
76229B7F2180ADA800A61697 /* OpenSourceController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSourceController.swift; path = Sources/OpenSourceController.swift; sourceTree = "<group>"; };
|
||||
@@ -45,6 +47,8 @@
|
||||
769FD9CE21871DEC00FB5A53 /* LicenceListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LicenceListViewController.swift; path = Sources/Controller/LicenceListViewController.swift; sourceTree = "<group>"; };
|
||||
769FD9CF21871DEC00FB5A53 /* LoadingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LoadingViewController.swift; path = Sources/Controller/LoadingViewController.swift; sourceTree = "<group>"; };
|
||||
769FD9D021871DEC00FB5A53 /* OpenSourceTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSourceTableViewCell.swift; path = Sources/Controller/OpenSourceTableViewCell.swift; sourceTree = "<group>"; };
|
||||
76B7980E238844F300009193 /* LicenceLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LicenceLoader.swift; path = Sources/Loader/LicenceLoader.swift; sourceTree = "<group>"; };
|
||||
76B79810238845D300009193 /* Style.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Style.swift; path = Sources/Utils/Style.swift; sourceTree = "<group>"; };
|
||||
76D7F24021BEB18A004B74CB /* UITableView+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UITableView+Extensions.swift"; path = "Sources/Utils/UITableView+Extensions.swift"; sourceTree = "<group>"; };
|
||||
76D7F24121BEB18A004B74CB /* Reusable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Reusable.swift; path = Sources/Utils/Reusable.swift; sourceTree = "<group>"; };
|
||||
76D7F24221BEB18A004B74CB /* UIViewController+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIViewController+Extensions.swift"; path = "Sources/Utils/UIViewController+Extensions.swift"; sourceTree = "<group>"; };
|
||||
@@ -53,6 +57,7 @@
|
||||
76EAA84C1E93EDCD009A41DA /* LicenceFile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LicenceFile.swift; path = Sources/Model/LicenceFile.swift; sourceTree = "<group>"; };
|
||||
AD2FAA261CD0B6D800659CF4 /* OpenSourceController.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = OpenSourceController.plist; sourceTree = "<group>"; };
|
||||
AD2FAA281CD0B6E100659CF4 /* OpenSourceControllerTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = OpenSourceControllerTests.plist; sourceTree = "<group>"; };
|
||||
C415E47623E0B3AE002F960D /* OpenSourceViewController+UISwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OpenSourceViewController+UISwift.swift"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -104,7 +109,6 @@
|
||||
76229B702180AD7700A61697 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
76229B712180AD8400A61697 /* LicenceLoader.swift */,
|
||||
76EAA84C1E93EDCD009A41DA /* LicenceFile.swift */,
|
||||
);
|
||||
name = Model;
|
||||
@@ -114,6 +118,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
76229B7C2180AD9F00A61697 /* HTTPDataLoader.swift */,
|
||||
76B7980E238844F300009193 /* LicenceLoader.swift */,
|
||||
);
|
||||
name = Loader;
|
||||
sourceTree = "<group>";
|
||||
@@ -125,6 +130,7 @@
|
||||
76D7F24121BEB18A004B74CB /* Reusable.swift */,
|
||||
76D7F24021BEB18A004B74CB /* UITableView+Extensions.swift */,
|
||||
76D7F24421BEB18A004B74CB /* UIView+Extensions.swift */,
|
||||
76B79810238845D300009193 /* Style.swift */,
|
||||
76D7F24221BEB18A004B74CB /* UIViewController+Extensions.swift */,
|
||||
);
|
||||
name = Utils;
|
||||
@@ -134,6 +140,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
76229B7F2180ADA800A61697 /* OpenSourceController.swift */,
|
||||
C415E47623E0B3AE002F960D /* OpenSourceViewController+UISwift.swift */,
|
||||
76229B7E2180ADA800A61697 /* OpenSourceControllerConfig.swift */,
|
||||
76229B7B2180AD8E00A61697 /* Loader */,
|
||||
76229B702180AD7700A61697 /* Model */,
|
||||
@@ -238,7 +245,7 @@
|
||||
52D6D9851BEFF229002C0205 = {
|
||||
CreatedOnToolsVersion = 7.1;
|
||||
DevelopmentTeam = XEHEC9B46E;
|
||||
LastSwiftMigration = "";
|
||||
LastSwiftMigration = 1130;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -287,15 +294,17 @@
|
||||
76229B7D2180AD9F00A61697 /* HTTPDataLoader.swift in Sources */,
|
||||
76D7F24621BEB18A004B74CB /* Reusable.swift in Sources */,
|
||||
769FD9D221871DEC00FB5A53 /* LicenceListViewController.swift in Sources */,
|
||||
76B79811238845D300009193 /* Style.swift in Sources */,
|
||||
769FD9D121871DEC00FB5A53 /* OpenSourceViewController.swift in Sources */,
|
||||
76D7F24721BEB18A004B74CB /* UIViewController+Extensions.swift in Sources */,
|
||||
76EAA84F1E93EDCD009A41DA /* LicenceFile.swift in Sources */,
|
||||
76229B722180AD8400A61697 /* LicenceLoader.swift in Sources */,
|
||||
76D7F24521BEB18A004B74CB /* UITableView+Extensions.swift in Sources */,
|
||||
C415E47723E0B3AE002F960D /* OpenSourceViewController+UISwift.swift in Sources */,
|
||||
769FD9D421871DEC00FB5A53 /* OpenSourceTableViewCell.swift in Sources */,
|
||||
76D7F24821BEB18A004B74CB /* Array+Extensions.swift in Sources */,
|
||||
76229B812180ADA800A61697 /* OpenSourceController.swift in Sources */,
|
||||
769FD9D321871DEC00FB5A53 /* LoadingViewController.swift in Sources */,
|
||||
76B7980F238844F300009193 /* LicenceLoader.swift in Sources */,
|
||||
76229B802180ADA800A61697 /* OpenSourceControllerConfig.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -304,6 +313,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C415E47823E0B3AE002F960D /* OpenSourceViewController+UISwift.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
BIN
Binary file not shown.
@@ -10,10 +10,10 @@
|
||||
|
||||
<p align="center">
|
||||
<a href="#features">Features</a>
|
||||
• <a href="#installation">Installation</a>
|
||||
• <a href="#usage">Usage</a>
|
||||
• <a href="#translation">Translation</a>
|
||||
• <a href="#customisation">Customisation</a>
|
||||
• <a href="#installation">Installation</a>
|
||||
• <a href="#license">License</a>
|
||||
</p>
|
||||
|
||||
@@ -28,39 +28,11 @@ Display a screen with all licences used in your application can be painful to ma
|
||||
- [x] Display tableView with licences used in your app
|
||||
- [x] Download licence from an URL
|
||||
|
||||
## Todo (feel free to make PR)
|
||||
|
||||
- [ ] Download licence from Podfile (https://github.com/terflogag/OpenSourceController/issues/1)
|
||||
- [ ] Download licence from Cartfile (https://github.com/terflogag/OpenSourceController/issues/2)
|
||||
- [ ] Download licence from local file
|
||||
|
||||
## Requirements
|
||||
|
||||
* Xcode 9
|
||||
* Xcode 11
|
||||
* iOS 9.0+ target deployment
|
||||
* Swift 3, Swift 4 or Swift 4.2 project
|
||||
|
||||
## Installation
|
||||
|
||||
- To integrate OpenSourceController into your Xcode project using [CocoaPods](http://cocoapods.org), specify it in your Podfile :
|
||||
|
||||
```ruby
|
||||
pod "OpenSourceController", '~> 3.0.0' # Swift 4.2 Version
|
||||
|
||||
pod "OpenSourceController", '~> 2.0' # Swift 4.0 Version
|
||||
|
||||
pod "OpenSourceController", '~> 1.0.8' # Swift 3.1 version
|
||||
```
|
||||
|
||||
- To integrate OpenSourceController into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your Cartfile :
|
||||
|
||||
```ruby
|
||||
github "floriangbh/OpenSourceController" ~> 3.0.0 # Swift 4.2 version
|
||||
|
||||
github "floriangbh/OpenSourceController" ~> 2.0 # Swift 4.0 version
|
||||
|
||||
github "floriangbh/OpenSourceController" ~> 1.0.8 # Swift 3.1 version
|
||||
```
|
||||
* Swift 3, Swift 4 or Swift 5.1 project
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -89,6 +61,30 @@ openSourceVC.presentOpenSourceController(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
|
||||
|
||||
You can apply some customisation. To do it you can use the OpenSourceControllerConfig structure like this :
|
||||
@@ -124,6 +120,30 @@ OpenSourceController is currently write in english. If you need translation for
|
||||
"Unable to load this licence." = "<your_translation>";
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
- To integrate OpenSourceController into your Xcode project using [Swift Packet Manager](https://github.com/apple/swift-package-manager), specify this url in Xcode : `https://github.com/floriangbh/OpenSourceController`
|
||||
|
||||
- To integrate OpenSourceController into your Xcode project using [CocoaPods](http://cocoapods.org), specify it in your Podfile :
|
||||
|
||||
```ruby
|
||||
pod "OpenSourceController", '~> 3.0.0' # Swift 4.2 Version
|
||||
|
||||
pod "OpenSourceController", '~> 2.0' # Swift 4.0 Version
|
||||
|
||||
pod "OpenSourceController", '~> 1.0.8' # Swift 3.1 version
|
||||
```
|
||||
|
||||
- To integrate OpenSourceController into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your Cartfile :
|
||||
|
||||
```ruby
|
||||
github "floriangbh/OpenSourceController" ~> 3.0.0 # Swift 4.2 version
|
||||
|
||||
github "floriangbh/OpenSourceController" ~> 2.0 # Swift 4.0 version
|
||||
|
||||
github "floriangbh/OpenSourceController" ~> 1.0.8 # Swift 3.1 version
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
Florian Gabach, florian.gabach@gmail.com
|
||||
|
||||
@@ -6,9 +6,13 @@
|
||||
// Copyright © 2018 OpenSourceController. All rights reserved.
|
||||
//
|
||||
|
||||
#if !os(macOS)
|
||||
import UIKit
|
||||
#else
|
||||
import AppKit
|
||||
#endif
|
||||
|
||||
final class LicenceListViewController: UITableViewController {
|
||||
open class LicenceListViewController: UITableViewController {
|
||||
|
||||
// MARK: - Var
|
||||
|
||||
@@ -24,11 +28,11 @@ final class LicenceListViewController: UITableViewController {
|
||||
super.init(style: .plain)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
override open func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.prepareTableView()
|
||||
@@ -50,22 +54,22 @@ extension LicenceListViewController {
|
||||
|
||||
// MARK: - Table View Data Source
|
||||
|
||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
override open func numberOfSections(in tableView: UITableView) -> Int {
|
||||
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
|
||||
}
|
||||
|
||||
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)
|
||||
guard let licence = self.downloadedLicence.get(at: indexPath.row) else { return cell }
|
||||
cell.configure(licence: licence, config: self.config)
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
override open func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
return UITableView.automaticDimension
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
final class LoadingViewController: UIViewController {
|
||||
open class LoadingViewController: UIViewController {
|
||||
|
||||
// MARK: - Var
|
||||
|
||||
@@ -32,11 +32,11 @@ final class LoadingViewController: UIViewController {
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
override open func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.view.backgroundColor = self.config.uiConfig.backgroundColor
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
final class OpenSourceTableViewCell: UITableViewCell, Reusable {
|
||||
open class OpenSourceTableViewCell: UITableViewCell, Reusable {
|
||||
|
||||
// MARK: - Lifecycle
|
||||
|
||||
@@ -15,7 +15,7 @@ final class OpenSourceTableViewCell: UITableViewCell, Reusable {
|
||||
self.prepareCellComponent()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
final class OpenSourceViewController: UIViewController {
|
||||
open class OpenSourceViewController: UIViewController {
|
||||
|
||||
// MARK: - Var
|
||||
|
||||
@@ -30,7 +30,7 @@ final class OpenSourceViewController: UIViewController {
|
||||
|
||||
// MARK: - Lifecyle
|
||||
|
||||
init(licences: [LicenceFile],
|
||||
public init(licences: [LicenceFile],
|
||||
showCloseButton: Bool,
|
||||
configuration: OpenSourceControllerConfig,
|
||||
licenceLoader: LicenceLoader) {
|
||||
@@ -42,11 +42,11 @@ final class OpenSourceViewController: UIViewController {
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
override open func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.title = self.config.title
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
final class HTTPDataLoader {
|
||||
open class HTTPDataLoader {
|
||||
func loadData(fromUrl url: String, completion: @escaping (Data?) -> Void) {
|
||||
if let url = URL(string: url) {
|
||||
let task = URLSession.shared.dataTask(with: url) { (data, _, error) in
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
final class LicenceLoader {
|
||||
open class LicenceLoader {
|
||||
|
||||
/// Download every licence
|
||||
///
|
||||
@@ -32,4 +32,6 @@ final class LicenceLoader {
|
||||
completion()
|
||||
}
|
||||
}
|
||||
public init() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
public final class LicenceFile {
|
||||
open class LicenceFile {
|
||||
|
||||
// MARK- Var
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
// Created by Florian Gabach on 05/02/2017.
|
||||
|
||||
import UIKit
|
||||
#if canImport(SwiftUI)
|
||||
import SwiftUI
|
||||
#endif
|
||||
|
||||
open class OpenSourceController: NSObject {
|
||||
|
||||
@@ -43,3 +46,4 @@ open class OpenSourceController: NSObject {
|
||||
navigationController.pushViewController(licenceController, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,5 +35,8 @@ public struct OpenSourceControllerConfig {
|
||||
public var verbose: Bool = false
|
||||
|
||||
/// UI-specific configuration.
|
||||
|
||||
public init() {
|
||||
}
|
||||
public var uiConfig = UIConfig()
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
import UIKit
|
||||
|
||||
extension UITableView {
|
||||
final func register<T: UITableViewCell>(cellType: T.Type)
|
||||
open func register<T: UITableViewCell>(cellType: T.Type)
|
||||
where T: Reusable {
|
||||
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 {
|
||||
guard let cell = self.dequeueReusableCell(withIdentifier: cellType.reuseIdentifier, for: indexPath) as? T else {
|
||||
fatalError(
|
||||
|
||||
@@ -18,6 +18,11 @@ platform :ios do
|
||||
release("major")
|
||||
end
|
||||
|
||||
desc "Scan the project"
|
||||
lane :scan_project do
|
||||
scan(scheme: "OpenSourceController-iOS")
|
||||
end
|
||||
|
||||
def release(type)
|
||||
podspec_name = "OpenSourceController.podspec"
|
||||
pod_lib_lint(use_bundle_exec: false)
|
||||
|
||||
@@ -31,6 +31,11 @@ Release a new version with a minor bump_type
|
||||
fastlane ios major
|
||||
```
|
||||
Release a new version with a major bump_type
|
||||
### ios buildproject
|
||||
```
|
||||
fastlane ios buildproject
|
||||
```
|
||||
Build the project
|
||||
|
||||
----
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Test Results | xcpretty</title>
|
||||
<style type="text/css">
|
||||
body { font-family:Avenir Next, Helvetica Neue, sans-serif; color: #4A4A4A; background-color: #F0F3FB; margin:0;}
|
||||
h1 { font-weight: normal; font-size: 24px; margin: 10px 0 0 0;}
|
||||
h3 { font-weight: normal; margin: 2px; font-size: 1.1em;}
|
||||
header { position: fixed;width: 100%;background: rgba(249, 254, 255, 0.9);margin: 0;padding: 10px;}
|
||||
header:before, header:after { content:""; display:table;}
|
||||
header:after { clear:both;}
|
||||
a:link { color: #A1D761;}
|
||||
footer { clear: both;position: relative;z-index: 10;height: 40px;margin-top: -10px; margin-left:30px; font-size:12px;}
|
||||
table { width:100%; border-collapse: collapse;}
|
||||
tr td:first-child { width:7%}
|
||||
.left { float: left; margin-left:30px;}
|
||||
.right { float: right; margin-right: 40px; margin-top: 0; margin-bottom:0;}
|
||||
.test-suite { margin: 0 0 30px 0;}
|
||||
.test-suite > .heading { font-family:Menlo, Monaco, monospace; font-weight: bold; border-color: #A1D761; background-color: #B8E986; border-width: 1px;}
|
||||
.test-suite.failing > .heading { border-color: #C84F5E; background-color: #E58591;}
|
||||
.test-suite > .heading > .title { margin-top: 4px; margin-left: 10px;}
|
||||
.tests { overflow: scroll;margin: 0 30px 0 60px;}
|
||||
.test, .test-suite > .heading { height: 30px; overflow: hidden; margin: 0 30px;}
|
||||
.test, .test-suite > .heading { border-width: 1px; border-collapse: collapse; border-style: solid; }
|
||||
.test { margin-left: 30px; border-top:none;}
|
||||
.test.failing { border-color: #C84F5E; background-color: #F4DDE0;}
|
||||
.test.passing { border-color: #A1D761;}
|
||||
.test.failing { background-color: #E7A1AA;}
|
||||
.test.passing { background-color: #CAF59F;}
|
||||
.test.failing.odd { background-color: #EEC7CC;}
|
||||
.test.passing.odd { background-color: #E5FBCF;}
|
||||
.details.failing { background-color: #F4DDE0; border: 1px solid #C84F5E;}
|
||||
.details.passing { background-color: #E5F4DC; border: 1px solid #A1D761;}
|
||||
.test .test-detail:last-child { padding-bottom: 8px;}
|
||||
.test .title { float: left; font-size: 0.9em; margin-top: 8px; font-family: Menlo, Monaco, monospace;}
|
||||
.test .time { float: left;margin: 4px 10px 0 20px;}
|
||||
.test-detail { font-family:Menlo, Monaco, monospace; font-size: 0.9em; margin: 5px 0 5px 0px;}
|
||||
.screenshots { height: auto; overflow: hidden; padding: 4px 4px 0 4px; background-color: #B8E986; border: #A1D761; border-width: 0 1px; border-style: solid; }
|
||||
.screenshots.failing { border-color: #C84F5E; background-color: #E58591; }
|
||||
.screenshot { max-height: 60px; float: left; transition: max-height 0.2s; margin: 0 4px 4px 0 }
|
||||
.screenshot.selected { max-height: 568px; }
|
||||
#test-suites { display: inline-block; width: 100%;margin-top:100px;}
|
||||
#segment-bar { margin-top: 10px;margin-left: 14px;float:right;}
|
||||
#segment-bar a:first-child { border-radius: 9px 0 0 9px; border-right: none;}
|
||||
#segment-bar a:last-child { border-radius: 0 9px 9px 0; border-left: none;}
|
||||
#segment-bar > a { color: #565656; border: 2px solid #7B7B7B; width: 80px; font-weight: bold; display:inline-block;text-align:center; font-weight: normal;}
|
||||
#segment-bar > a.selected { background-color: #979797; color: #F0F3FB;}
|
||||
#counters { float: left;margin: 10px;text-align: right;}
|
||||
#counters h2 { font-size: 16px; font-family: Avenir, sans-serif; font-weight: lighter; display:inline;}
|
||||
#counters .number { font-size: 20px;}
|
||||
#fail-count { color: #D0021B; margin-left:10px;}
|
||||
@media (max-width: 640px) {
|
||||
h1, #counters, #segment-bar { margin: 5px auto; text-align:center;}
|
||||
header, #segment-bar { width: 100%; position: relative; background:none;}
|
||||
.left, .right { float:none; margin:0;}
|
||||
#test-suites { margin-top: 0;}
|
||||
#counters { float:none;}
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var hide = function(element) { element.style.display = 'none';}
|
||||
var show = function(element) { element.style.display = '';}
|
||||
var isHidden = function(element) { return element.style.display == 'none';}
|
||||
var isSelected = function(element) { return element.classList.contains("selected");}
|
||||
var deselect = function(element) { return element.classList.remove("selected");}
|
||||
var select = function(element) { return element.classList.add("selected");}
|
||||
var toggle = function(element) { isHidden(element) ? show(element) : hide(element);};
|
||||
var toggleTests = function(heading) { toggle(heading.parentNode.children[1]);};
|
||||
var toggleDetails = function(detailClass) {
|
||||
var details = document.querySelectorAll('.' + detailClass);
|
||||
for (var i = details.length - 1; i >= 0; i--) { toggle(details[i]);};
|
||||
};
|
||||
var hideAll = function(collection) {
|
||||
for (var i = collection.length - 1; i >= 0; i--) { hide(collection[i]); };
|
||||
}
|
||||
var showAll = function(collection) {
|
||||
for (var i = collection.length - 1; i >= 0; i--) { show(collection[i]); };
|
||||
}
|
||||
var selectSegment = function(segment) {
|
||||
if (isSelected(segment)) return;
|
||||
var segments = document.querySelectorAll('#segment-bar > a');
|
||||
for (var i = segments.length - 1; i >= 0; i--) { deselect(segments[i]);};
|
||||
select(segment);
|
||||
if (segment.id == "all-segment") {
|
||||
showAll(document.querySelectorAll('.test-suite'));
|
||||
showAll(document.querySelectorAll('.test'));
|
||||
} else if (segment.id == "failing-segment") {
|
||||
hideAll(document.querySelectorAll('.test.passing'));
|
||||
showAll(document.querySelectorAll('.test.failing'));
|
||||
hideAll(document.querySelectorAll('.test-suite.passing'));
|
||||
showAll(document.querySelectorAll('.test-suite.failing'));
|
||||
} else if (segment.id == "passing-segment") {
|
||||
hideAll(document.querySelectorAll('.test.failing'));
|
||||
showAll(document.querySelectorAll('.test.passing'));
|
||||
hideAll(document.querySelectorAll('.test-suite.failing'));
|
||||
showAll(document.querySelectorAll('.test-suite.passing'));
|
||||
}
|
||||
}
|
||||
var toggleScreenshot = function(suiteName, index) {
|
||||
var screenshot = document.getElementById("screenshot-" + suiteName + "-" + index);
|
||||
isSelected(screenshot) ? deselect(screenshot) : select(screenshot);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<section class="left">
|
||||
<h1>Test Results</h1>
|
||||
</section>
|
||||
<section class="right">
|
||||
<section id="counters">
|
||||
<h2 id="test-count"><span class="number">0</span> tests</h2>
|
||||
|
||||
</section>
|
||||
<section id="segment-bar">
|
||||
<a id="all-segment" onclick="selectSegment(this);" class="selected">All</a><a id="failing-segment" onclick="selectSegment(this);">Failing</a><a id="passing-segment" onclick="selectSegment(this);">Passing</a>
|
||||
</section>
|
||||
</section>
|
||||
</header>
|
||||
<section id="test-suites">
|
||||
|
||||
</section>
|
||||
<footer>Report generated with <a href="https://github.com/supermarin/xcpretty">xcpretty</a></footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<testsuites tests='0' failures='0'/>
|
||||
Reference in New Issue
Block a user