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