Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floriangbh/OpenSourceController
The simplest way to display the librarie's licences used in your application.
https://github.com/floriangbh/OpenSourceController
Last synced: 3 days ago
JSON representation
The simplest way to display the librarie's licences used in your application.
- Host: GitHub
- URL: https://github.com/floriangbh/OpenSourceController
- Owner: floriangbh
- License: mit
- Created: 2017-02-27T16:03:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-01-29T14:59:54.000Z (almost 5 years ago)
- Last Synced: 2024-11-14T14:42:35.089Z (28 days ago)
- Language: Swift
- Homepage:
- Size: 6.28 MB
- Stars: 52
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - OpenSourceController - The simplest way to display the libraries licences used in your application. (Utility / Web View)
- awesome-swift - OpenSourceController - The simplest way to display the librarie's licences used in your application. (Libs / Utility)
- awesome-swift - OpenSourceController - The simplest way to display the librarie's licences used in your application. (Libs / Utility)
- awesome-ios-star - OpenSourceController - The simplest way to display the libraries licences used in your application. (Utility / Web View)
- fucking-awesome-swift - OpenSourceController - The simplest way to display the librarie's licences used in your application. (Libs / Utility)
- awesome-swift - OpenSourceController - The simplest way to display the librarie's licences used in your application. ` 📝 a year ago ` (Utility [🔝](#readme))
README
Features
• Usage
• Translation
• Customisation
• Installation
• LicenseDisplay a screen with all licences used in your application 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.
## Features
- [x] Display tableView with licences used in your app
- [x] Download licence from an URL## Requirements
* Xcode 11
* iOS 9.0+ target deployment
* Swift 3, Swift 4 or Swift 5.1 project## Usage
- Import the library :
```swift
import OpenSourceController
```- Display the controller :
```swift
// Create controller
let openSourceVC = OpenSourceController()// Init with LicenceFile object
openSourceVC.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")]// Present controller
openSourceVC.presentOpenSourceController(from: self)// OR push the controller if the source controller is embeded in navigation controller
openSourceVC.pushOpenSourceController(from: self)
```With SwiftUI :
```swift
struct OpenSourceView: UIViewControllerRepresentable {
@available(iOS 13, *)
public func updateUIViewController(_ uiViewController: OpenSourceViewController, context: UIViewControllerRepresentableContext) {
//
}
@available(iOS 13, *)
public func makeUIViewController(context: UIViewControllerRepresentableContext) -> 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 :
```swift
// Navigation bar title
openSourceVC.config.title = "MyCustomTitle"// Close button color
openSourceVC.config.uiConfig.closeButtonColor = UIColor.white// BackgroundColor
openSourceVC.config.uiConfig.backgroundColor = UIColor.red.withAlphaComponent(0.6)// Licence text color
openSourceVC.config.uiConfig.licenceTextColor = UIColor.white// Navigation bar title color
openSourceVC.config.uiConfig.titleColor = UIColor.white// Licence cell background color
openSourceVC.config.uiConfig.licenceBackgroundColor = UIColor.red// Verbose mode
openSourceVC.config.verbose = true
```## Translation
OpenSourceController is currently write in english. If you need translation for the permission popup (or whatever thing), just add this line in your localized file :
```
"Unable to load this licence." = "";
```## 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 Versionpod "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 versiongithub "floriangbh/OpenSourceController" ~> 2.0 # Swift 4.0 version
github "floriangbh/OpenSourceController" ~> 1.0.8 # Swift 3.1 version
```## Author
Florian Gabach, [email protected]
## License
OpenSourceController is available under the [MIT license](LICENSE).