Skip to content

Commit

Permalink
Formatted swift code with swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Oct 3, 2023
1 parent 3c07eac commit d89cf54
Show file tree
Hide file tree
Showing 30 changed files with 1,821 additions and 1,727 deletions.
20 changes: 10 additions & 10 deletions ios/LanternTests/LanternTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@

import Internalsdk
import SQLite
@testable import Runner
import XCTest

@testable import Runner

final class LanternTests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

}
129 changes: 65 additions & 64 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import UIKit
import SQLite
import Flutter
import Internalsdk
import SQLite
import Toast_Swift
import UIKit

// Before Commit Run linter
// swiftlint autocorrect --format
Expand All @@ -11,77 +11,78 @@ import Toast_Swift

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
// Flutter Properties
var flutterViewController: FlutterViewController!
var flutterbinaryMessenger: FlutterBinaryMessenger!
// Model Properties
var sessionModel: SessionModel!
var lanternModel: LanternModel!
var navigationModel: NavigationModel!
var vpnModel: VpnModel!
var messagingModel: MessagingModel!
// IOS
var loadingManager: LoadingIndicatorManager?
// Flutter Properties
var flutterViewController: FlutterViewController!
var flutterbinaryMessenger: FlutterBinaryMessenger!
// Model Properties
var sessionModel: SessionModel!
var lanternModel: LanternModel!
var navigationModel: NavigationModel!
var vpnModel: VpnModel!
var messagingModel: MessagingModel!

// IOS
var loadingManager: LoadingIndicatorManager?

override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
initializeFlutterComponents()
do {
try setupAppComponents()
} catch {
logger.error("Unexpected error setting up app components: \(error)")
exit(1)
}
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
initializeFlutterComponents()
do {
try setupAppComponents()
} catch {
logger.error("Unexpected error setting up app components: \(error)")
exit(1)
}
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

// Flutter related stuff
private func initializeFlutterComponents() {
flutterViewController = window?.rootViewController as! FlutterViewController
flutterbinaryMessenger = flutterViewController.binaryMessenger}
// Flutter related stuff
private func initializeFlutterComponents() {
flutterViewController = window?.rootViewController as! FlutterViewController
flutterbinaryMessenger = flutterViewController.binaryMessenger
}

// Intlize this GO model and callback
private func setupAppComponents() throws {
try setupModels()
startUpSequency()
setupLoadingBar()
}
// Intlize this GO model and callback
private func setupAppComponents() throws {
try setupModels()
startUpSequency()
setupLoadingBar()
}

// Init all the models
private func setupModels() throws {
logger.log("setupModels method called")
sessionModel=try SessionModel(flutterBinary: flutterbinaryMessenger)
lanternModel=LanternModel(flutterBinary: flutterbinaryMessenger)
vpnModel=try VpnModel(flutterBinary: flutterbinaryMessenger, vpnBase: VPNManager.appDefault)
navigationModel=NavigationModel(flutterBinary: flutterbinaryMessenger)
messagingModel=try MessagingModel(flutterBinary: flutterbinaryMessenger)
}
// Init all the models
private func setupModels() throws {
logger.log("setupModels method called")
sessionModel = try SessionModel(flutterBinary: flutterbinaryMessenger)
lanternModel = LanternModel(flutterBinary: flutterbinaryMessenger)
vpnModel = try VpnModel(flutterBinary: flutterbinaryMessenger, vpnBase: VPNManager.appDefault)
navigationModel = NavigationModel(flutterBinary: flutterbinaryMessenger)
messagingModel = try MessagingModel(flutterBinary: flutterbinaryMessenger)
}

// Post start up
// Init all method needed for user
func startUpSequency() {
// setupLocal()
// createUser()
askNotificationPermssion()
// Post start up
// Init all method needed for user
func startUpSequency() {
// setupLocal()
// createUser()
askNotificationPermssion()

}
}

func askNotificationPermssion() {
UserNotificationsManager.shared.requestNotificationPermission { granted in
if granted {
logger.debug("Notification Permssion is granted")
} else {
logger.debug("Notification Permssion is denied")
}
}
func askNotificationPermssion() {
UserNotificationsManager.shared.requestNotificationPermission { granted in
if granted {
logger.debug("Notification Permssion is granted")
} else {
logger.debug("Notification Permssion is denied")
}
}
}

func setupLoadingBar() {
loadingManager = LoadingIndicatorManager(parentView: flutterViewController.view)
}
func setupLoadingBar() {
loadingManager = LoadingIndicatorManager(parentView: flutterViewController.view)
}

}
Loading

0 comments on commit d89cf54

Please sign in to comment.