2017-02-09 01:41:17 +08:00
|
|
|
//
|
|
|
|
|
// OpenSourceComponentsTableViewController.swift
|
|
|
|
|
// pass
|
|
|
|
|
//
|
|
|
|
|
// Created by Mingshen Sun on 9/2/2017.
|
|
|
|
|
// Copyright © 2017 Bob Sun. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
2017-02-09 15:58:32 +08:00
|
|
|
import SafariServices
|
2020-06-28 21:25:40 +02:00
|
|
|
import UIKit
|
2017-02-09 01:41:17 +08:00
|
|
|
|
|
|
|
|
class OpenSourceComponentsTableViewController: BasicStaticTableViewController {
|
2020-02-12 23:28:46 +01:00
|
|
|
private static let openSourceComponents = [
|
2017-02-09 13:16:42 +08:00
|
|
|
["FavIcon",
|
|
|
|
|
"https://github.com/bitserf/FavIcon",
|
|
|
|
|
"https://github.com/bitserf/FavIcon/blob/master/LICENSE"],
|
2020-02-12 23:28:46 +01:00
|
|
|
["GopenPGP",
|
|
|
|
|
"https://gopenpgp.org/",
|
|
|
|
|
"https://github.com/ProtonMail/gopenpgp/blob/master/LICENSE"],
|
2017-02-19 22:18:52 +08:00
|
|
|
["KeychainAccess",
|
|
|
|
|
"https://github.com/kishikawakatsumi/KeychainAccess",
|
|
|
|
|
"https://github.com/kishikawakatsumi/KeychainAccess/blob/master/LICENSE"],
|
2017-02-09 01:41:17 +08:00
|
|
|
["ObjectiveGit",
|
|
|
|
|
"https://github.com/libgit2/objective-git",
|
|
|
|
|
"https://github.com/libgit2/objective-git/blob/master/LICENSE"],
|
2017-03-08 09:29:47 -08:00
|
|
|
["OneTimePassword",
|
|
|
|
|
"https://github.com/mattrubin/OneTimePassword",
|
2020-02-12 23:28:46 +01:00
|
|
|
"https://github.com/mattrubin/OneTimePassword/blob/develop/LICENSE.md"],
|
2017-02-09 01:41:17 +08:00
|
|
|
["SVProgressHUD",
|
|
|
|
|
"https://github.com/SVProgressHUD/SVProgressHUD",
|
2019-11-15 22:37:55 +01:00
|
|
|
"https://github.com/SVProgressHUD/SVProgressHUD/blob/master/LICENSE"],
|
2020-02-12 23:28:46 +01:00
|
|
|
["SwiftyUserDefaults",
|
|
|
|
|
"https://github.com/radex/SwiftyUserDefaults",
|
|
|
|
|
"https://github.com/radex/SwiftyUserDefaults/blob/master/LICENSE"],
|
2020-02-23 03:06:23 +08:00
|
|
|
["EFF's Wordlists",
|
|
|
|
|
"https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases",
|
|
|
|
|
"http://creativecommons.org/licenses/by/3.0"],
|
2017-02-09 01:41:17 +08:00
|
|
|
]
|
2018-12-09 16:59:07 -08:00
|
|
|
|
2017-02-09 01:41:17 +08:00
|
|
|
override func viewDidLoad() {
|
2020-02-12 23:28:46 +01:00
|
|
|
super.viewDidLoad()
|
2017-02-09 01:41:17 +08:00
|
|
|
tableData.append([])
|
2020-02-12 23:28:46 +01:00
|
|
|
for item in Self.openSourceComponents {
|
2020-07-05 00:16:22 +02:00
|
|
|
tableData[0].append(
|
|
|
|
|
[
|
|
|
|
|
.title: item[0],
|
|
|
|
|
.action: "link",
|
|
|
|
|
.link: item[1],
|
|
|
|
|
.accessoryType: UITableViewCell.AccessoryType.detailDisclosureButton,
|
|
|
|
|
.detailDisclosureAction: #selector(actOnDetailDisclosureButton(_:)),
|
|
|
|
|
.detailDisclosureData: item[2],
|
|
|
|
|
]
|
|
|
|
|
)
|
2017-02-09 01:41:17 +08:00
|
|
|
}
|
|
|
|
|
}
|
2018-12-09 16:59:07 -08:00
|
|
|
|
2020-06-28 21:25:40 +02:00
|
|
|
@objc
|
|
|
|
|
func actOnDetailDisclosureButton(_ sender: Any?) {
|
2020-02-12 23:28:46 +01:00
|
|
|
if let link = sender as? String, let url = URL(string: link) {
|
|
|
|
|
let svc = SFSafariViewController(url: url, entersReaderIfAvailable: false)
|
|
|
|
|
present(svc, animated: true)
|
2017-02-09 11:12:14 +08:00
|
|
|
}
|
|
|
|
|
}
|
2017-02-09 01:41:17 +08:00
|
|
|
}
|