mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.6 KiB
Swift
112 lines
3.6 KiB
Swift
//
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
import SignalMessaging
|
|
import PureLayout
|
|
import SignalServiceKit
|
|
|
|
class ShareViewController: UIViewController {
|
|
|
|
override func loadView() {
|
|
super.loadView()
|
|
|
|
// This should be the first thing we do.
|
|
SetCurrentAppContext(ShareAppExtensionContext())
|
|
|
|
// DebugLogger.shared().enableTTYLogging()
|
|
// if _isDebugAssertConfiguration() {
|
|
// DebugLogger.shared().enableFileLogging()
|
|
// } else {
|
|
// // TODO: Consult OWSPreferences.loggingIsEnabled.
|
|
// DebugLogger.shared().enableFileLogging()
|
|
// }
|
|
|
|
_ = AppVersion()
|
|
|
|
//DDLogWarn(@"%@ application: didFinishLaunchingWithOptions.", self.logTag);
|
|
//
|
|
//// We need to do this _after_ we set up logging but _before_ we do
|
|
//// anything else.
|
|
//[self ensureIsReadyForAppExtensions];
|
|
//
|
|
//#if RELEASE
|
|
// // ensureIsReadyForAppExtensions may have changed the state of the logging
|
|
// // preference (due to [NSUserDefaults migrateToSharedUserDefaults]), so honor
|
|
// // that change if necessary.
|
|
//if (loggingIsEnabled && !OWSPreferences.loggingIsEnabled) {
|
|
// [DebugLogger.sharedLogger disableFileLogging];
|
|
//}
|
|
//#endif
|
|
//
|
|
//[AppVersion instance];
|
|
//
|
|
//[self startupLogging];
|
|
|
|
Logger.debug("\(self.logTag()) \(#function)")
|
|
print("\(self.logTag()) \(#function) \(self.view.frame)")
|
|
}
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
showLoadingAnimation()
|
|
|
|
let proofOfSharedFramework = StorageCoordinator.shared.path
|
|
let proofOfSSK = textSecureServerURL
|
|
|
|
// TODO: Shared Storage via app container
|
|
//let proofOfSharedStorage = TSAccountManager.localNumber()
|
|
let proofOfSharedStorage = "TODO"
|
|
|
|
print("shared framework: \(proofOfSharedFramework) \n sharedStorage: \(proofOfSharedStorage) \n proof of ssk: \(proofOfSSK)")
|
|
|
|
Logger.debug("\(self.logTag()) \(#function)")
|
|
print("\(self.logTag()) \(#function) \(self.view.frame)")
|
|
}
|
|
|
|
private func showLoadingAnimation() {
|
|
Logger.debug("\(self.logTag()) \(#function)")
|
|
print("\(self.logTag()) \(#function) \(self.view.frame)")
|
|
|
|
// Proof of cocoapods, utilizes PureLayout
|
|
let rootView = UIView()
|
|
rootView.backgroundColor = UIColor.ows_signalBrandBlue()
|
|
view.addSubview(rootView)
|
|
rootView.autoCenterInSuperview()
|
|
rootView.autoSetDimension(.width, toSize: 200)
|
|
rootView.autoSetDimension(.height, toSize: 300)
|
|
rootView.layer.cornerRadius = 3
|
|
|
|
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle:.whiteLarge)
|
|
rootView.addSubview(activityIndicator)
|
|
activityIndicator.autoCenterInSuperview()
|
|
activityIndicator.startAnimating()
|
|
|
|
let label = UILabel()
|
|
label.textColor = UIColor.white
|
|
label.font = UIFont.ows_mediumFont(withSize: 14)
|
|
label.text = NSLocalizedString("SHARE_EXTENSION_LOADING",
|
|
comment: "Indicates that the share extension is still loading.")
|
|
rootView.addSubview(label)
|
|
label.autoHCenterInSuperview()
|
|
label.autoPinEdge(.top, to: .bottom, of: activityIndicator, withOffset: 10)
|
|
}
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
Logger.debug("\(self.logTag()) \(#function)")
|
|
print("\(self.logTag()) \(#function) \(self.view.frame)")
|
|
|
|
super.viewWillAppear(animated)
|
|
}
|
|
|
|
override func viewDidAppear(_ animated: Bool) {
|
|
Logger.debug("\(self.logTag()) \(#function)")
|
|
print("\(self.logTag()) \(#function) \(self.view.frame)")
|
|
|
|
super.viewDidAppear(animated)
|
|
}
|
|
}
|