Import Core framework into iOS target
This commit is contained in:
parent
f661008679
commit
5237aa3916
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
@UIApplicationMain
|
@UIApplicationMain
|
||||||
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
|
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
import MessageUI
|
import MessageUI
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
class IssueReporter: NSObject {
|
class IssueReporter: NSObject {
|
||||||
struct Attachments {
|
struct Attachments {
|
||||||
|
|
|
@ -27,6 +27,7 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
import SwiftyBeaver
|
import SwiftyBeaver
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
private let log = SwiftyBeaver.self
|
private let log = SwiftyBeaver.self
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
extension UITableViewCell {
|
extension UITableViewCell {
|
||||||
func applyChecked(_ checked: Bool, _ theme: Theme) {
|
func applyChecked(_ checked: Bool, _ theme: Theme) {
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import MessageUI
|
import MessageUI
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
extension UIColor {
|
extension UIColor {
|
||||||
convenience init(rgb: UInt32, alpha: CGFloat) {
|
convenience init(rgb: UInt32, alpha: CGFloat) {
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import Intents
|
import Intents
|
||||||
import SwiftyBeaver
|
import SwiftyBeaver
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
private let log = SwiftyBeaver.self
|
private let log = SwiftyBeaver.self
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
protocol AccountViewControllerDelegate: class {
|
protocol AccountViewControllerDelegate: class {
|
||||||
func accountController(_: AccountViewController, didEnterCredentials credentials: Credentials)
|
func accountController(_: AccountViewController, didEnterCredentials credentials: Credentials)
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
import SwiftyBeaver
|
import SwiftyBeaver
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
private let log = SwiftyBeaver.self
|
private let log = SwiftyBeaver.self
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import SwiftyBeaver
|
import SwiftyBeaver
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
private let log = SwiftyBeaver.self
|
private let log = SwiftyBeaver.self
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
protocol EndpointViewControllerDelegate: class {
|
protocol EndpointViewControllerDelegate: class {
|
||||||
func endpointController(_: EndpointViewController, didUpdateWithNewAddress newAddress: String?, newProtocol: EndpointProtocol?)
|
func endpointController(_: EndpointViewController, didUpdateWithNewAddress newAddress: String?, newProtocol: EndpointProtocol?)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
class AboutViewController: UITableViewController, TableModelHost {
|
class AboutViewController: UITableViewController, TableModelHost {
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
class CreditsViewController: UITableViewController, TableModelHost {
|
class CreditsViewController: UITableViewController, TableModelHost {
|
||||||
private let licenses = AppConstants.License.all
|
private let licenses = AppConstants.License.all
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
import SwiftyBeaver
|
import SwiftyBeaver
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
private let log = SwiftyBeaver.self
|
private let log = SwiftyBeaver.self
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
class LabelViewController: UIViewController {
|
class LabelViewController: UIViewController {
|
||||||
@IBOutlet private weak var scrollView: UIScrollView?
|
@IBOutlet private weak var scrollView: UIScrollView?
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
// XXX: convoluted due to the separation of provider/host profiles
|
// XXX: convoluted due to the separation of provider/host profiles
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
class VersionViewController: UIViewController {
|
class VersionViewController: UIViewController {
|
||||||
@IBOutlet private weak var scrollView: UIScrollView?
|
@IBOutlet private weak var scrollView: UIScrollView?
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
import SwiftyBeaver
|
import SwiftyBeaver
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
private let log = SwiftyBeaver.self
|
private let log = SwiftyBeaver.self
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
class WizardProviderViewController: UITableViewController {
|
class WizardProviderViewController: UITableViewController {
|
||||||
var availableNames: [Infrastructure.Name] = []
|
var availableNames: [Infrastructure.Name] = []
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
protocol ProviderPoolViewControllerDelegate: class {
|
protocol ProviderPoolViewControllerDelegate: class {
|
||||||
func providerPoolController(_: ProviderPoolViewController, didSelectPool pool: Pool)
|
func providerPoolController(_: ProviderPoolViewController, didSelectPool pool: Pool)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
protocol ProviderPresetViewControllerDelegate: class {
|
protocol ProviderPresetViewControllerDelegate: class {
|
||||||
func providerPresetController(_: ProviderPresetViewController, didSelectPreset preset: InfrastructurePreset)
|
func providerPresetController(_: ProviderPresetViewController, didSelectPreset preset: InfrastructurePreset)
|
||||||
|
|
|
@ -27,6 +27,7 @@ import UIKit
|
||||||
import NetworkExtension
|
import NetworkExtension
|
||||||
import CoreTelephony
|
import CoreTelephony
|
||||||
import TunnelKit
|
import TunnelKit
|
||||||
|
import Passepartout_Core
|
||||||
|
|
||||||
class ServiceViewController: UIViewController, TableModelHost {
|
class ServiceViewController: UIViewController, TableModelHost {
|
||||||
@IBOutlet private weak var tableView: UITableView!
|
@IBOutlet private weak var tableView: UITableView!
|
||||||
|
@ -511,6 +512,19 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
|
||||||
return ip
|
return ip
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func mappedTrustedNetworksRow(_ from: TrustedNetworksModel.RowType) -> RowType {
|
||||||
|
switch from {
|
||||||
|
case .trustsMobile:
|
||||||
|
return .trustedMobile
|
||||||
|
|
||||||
|
case .trustedWiFi:
|
||||||
|
return .trustedWiFi
|
||||||
|
|
||||||
|
case .addCurrentWiFi:
|
||||||
|
return .trustedAddCurrentWiFi
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func numberOfSections(in tableView: UITableView) -> Int {
|
func numberOfSections(in tableView: UITableView) -> Int {
|
||||||
return model.count
|
return model.count
|
||||||
}
|
}
|
||||||
|
@ -938,7 +952,7 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
|
||||||
|
|
||||||
trustedNetworks.delegate = self
|
trustedNetworks.delegate = self
|
||||||
trustedNetworks.load(from: service.preferences)
|
trustedNetworks.load(from: service.preferences)
|
||||||
model.set(trustedNetworks.rows, in: .trusted)
|
model.set(trustedNetworks.rows.map { mappedTrustedNetworksRow($0) }, in: .trusted)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func reloadVpnStatus() {
|
private func reloadVpnStatus() {
|
||||||
|
@ -1005,7 +1019,7 @@ extension ServiceViewController: TrustedNetworksModelDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func trustedNetworks(_: TrustedNetworksModel, shouldInsertWifiAt rowIndex: Int) {
|
func trustedNetworks(_: TrustedNetworksModel, shouldInsertWifiAt rowIndex: Int) {
|
||||||
model.set(trustedNetworks.rows, in: .trusted)
|
model.set(trustedNetworks.rows.map { mappedTrustedNetworksRow($0) }, in: .trusted)
|
||||||
tableView.insertRows(at: [IndexPath(row: rowIndex, section: trustedSectionIndex)], with: .bottom)
|
tableView.insertRows(at: [IndexPath(row: rowIndex, section: trustedSectionIndex)], with: .bottom)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1021,7 +1035,7 @@ extension ServiceViewController: TrustedNetworksModelDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func trustedNetworks(_: TrustedNetworksModel, shouldDeleteWifiAt rowIndex: Int) {
|
func trustedNetworks(_: TrustedNetworksModel, shouldDeleteWifiAt rowIndex: Int) {
|
||||||
model.set(trustedNetworks.rows, in: .trusted)
|
model.set(trustedNetworks.rows.map { mappedTrustedNetworksRow($0) }, in: .trusted)
|
||||||
tableView.deleteRows(at: [IndexPath(row: rowIndex, section: trustedSectionIndex)], with: .top)
|
tableView.deleteRows(at: [IndexPath(row: rowIndex, section: trustedSectionIndex)], with: .top)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,14 @@ public protocol TrustedNetworksModelDelegate: class {
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrustedNetworksModel {
|
public class TrustedNetworksModel {
|
||||||
|
public enum RowType {
|
||||||
|
case trustsMobile
|
||||||
|
|
||||||
|
case trustedWiFi
|
||||||
|
|
||||||
|
case addCurrentWiFi
|
||||||
|
}
|
||||||
|
|
||||||
public private(set) var trustedWifis: [String: Bool]
|
public private(set) var trustedWifis: [String: Bool]
|
||||||
|
|
||||||
public private(set) var sortedWifis: [String]
|
public private(set) var sortedWifis: [String]
|
||||||
|
@ -49,9 +57,7 @@ public class TrustedNetworksModel {
|
||||||
|
|
||||||
public private(set) var trustsMobileNetwork: Bool
|
public private(set) var trustsMobileNetwork: Bool
|
||||||
|
|
||||||
// FIXME
|
public private(set) var rows: [RowType]
|
||||||
// public private(set) var rows: [ServiceViewController.RowType]
|
|
||||||
public private(set) var rows: [Int]
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public weak var delegate: TrustedNetworksModelDelegate?
|
public weak var delegate: TrustedNetworksModelDelegate?
|
||||||
|
@ -73,15 +79,14 @@ public class TrustedNetworksModel {
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
trustsMobileNetwork = preferences.trustsMobileNetwork
|
trustsMobileNetwork = preferences.trustsMobileNetwork
|
||||||
// FIXME
|
rows.removeAll()
|
||||||
// rows.removeAll()
|
if hasMobileNetwork {
|
||||||
// if hasMobileNetwork {
|
rows.append(.trustsMobile)
|
||||||
// rows.append(.trustedMobile)
|
}
|
||||||
// }
|
for _ in sortedWifis {
|
||||||
// for _ in sortedWifis {
|
rows.append(.trustedWiFi)
|
||||||
// rows.append(.trustedWiFi)
|
}
|
||||||
// }
|
rows.append(.addCurrentWiFi)
|
||||||
// rows.append(.trustedAddCurrentWiFi)
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,8 +144,7 @@ public class TrustedNetworksModel {
|
||||||
if !isDuplicate {
|
if !isDuplicate {
|
||||||
sortedWifis.insert(wifiToAdd, at: index)
|
sortedWifis.insert(wifiToAdd, at: index)
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
// FIXME
|
rows.insert(.trustedWiFi, at: rowIndex)
|
||||||
// rows.insert(.trustedWiFi, at: rowIndex)
|
|
||||||
#endif
|
#endif
|
||||||
delegate?.trustedNetworks(self, shouldInsertWifiAt: rowIndex)
|
delegate?.trustedNetworks(self, shouldInsertWifiAt: rowIndex)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue