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.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import UIKit
|
2017-02-09 15:58:32 +08:00
|
|
|
import SafariServices
|
2017-02-09 01:41:17 +08:00
|
|
|
|
|
|
|
|
class OpenSourceComponentsTableViewController: BasicStaticTableViewController {
|
|
|
|
|
let openSourceComponents = [
|
2017-02-09 13:16:42 +08:00
|
|
|
["FavIcon",
|
|
|
|
|
"https://github.com/bitserf/FavIcon",
|
|
|
|
|
"https://github.com/bitserf/FavIcon/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-02-09 14:04:01 +08:00
|
|
|
["ObjectivePGP",
|
|
|
|
|
"https://github.com/krzyzanowskim/ObjectivePGP",
|
|
|
|
|
"https://github.com/krzyzanowskim/ObjectivePGP/blob/master/LICENSE.txt"],
|
2017-03-08 09:29:47 -08:00
|
|
|
["OneTimePassword",
|
|
|
|
|
"https://github.com/mattrubin/OneTimePassword",
|
|
|
|
|
"https://github.com/mattrubin/OneTimePassword/blob/develop/LICENSE.md",],
|
2017-02-09 01:41:17 +08:00
|
|
|
["SwiftyUserDefaults",
|
|
|
|
|
"https://github.com/radex/SwiftyUserDefaults",
|
|
|
|
|
"https://github.com/radex/SwiftyUserDefaults/blob/master/LICENSE"],
|
|
|
|
|
["SVProgressHUD",
|
|
|
|
|
"https://github.com/SVProgressHUD/SVProgressHUD",
|
|
|
|
|
"https://github.com/SVProgressHUD/SVProgressHUD/blob/master/LICENSE.txt"],
|
2018-02-26 16:53:39 +01:00
|
|
|
["Yams",
|
|
|
|
|
"https://github.com/jpsim/Yams",
|
|
|
|
|
"https://github.com/jpsim/Yams/blob/master/LICENSE"],
|
2017-02-09 01:41:17 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
|
tableData.append([])
|
|
|
|
|
for item in openSourceComponents {
|
|
|
|
|
tableData[0].append(
|
2017-02-10 16:44:59 +08:00
|
|
|
[CellDataKey.title: item[0], CellDataKey.action: "link", CellDataKey.link: item[1], CellDataKey.accessoryType: UITableViewCellAccessoryType.detailDisclosureButton, CellDataKey.detailDisclosureAction: #selector(actOnDetailDisclosureButton(_:)), CellDataKey.detailDisclosureData: item[2]]
|
2017-02-09 01:41:17 +08:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
super.viewDidLoad()
|
|
|
|
|
}
|
2017-02-09 11:12:14 +08:00
|
|
|
|
2017-09-23 16:29:03 +08:00
|
|
|
@objc func actOnDetailDisclosureButton(_ sender: Any?) {
|
2017-02-09 11:12:14 +08:00
|
|
|
if let link = sender as? String {
|
2017-02-09 15:58:32 +08:00
|
|
|
let svc = SFSafariViewController(url: URL(string: link)!, entersReaderIfAvailable: false)
|
|
|
|
|
self.present(svc, animated: true, completion: nil)
|
2017-02-09 11:12:14 +08:00
|
|
|
}
|
|
|
|
|
}
|
2017-02-09 01:41:17 +08:00
|
|
|
|
|
|
|
|
}
|