gestures and done possible fix
This commit is contained in:
parent
ba795b6d35
commit
9881feb39b
@ -38,6 +38,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
|
|||||||
splitViewController.delegate = self
|
splitViewController.delegate = self
|
||||||
splitViewController.preferredDisplayMode = .allVisible
|
splitViewController.preferredDisplayMode = .allVisible
|
||||||
|
|
||||||
|
let gr = UILongPressGestureRecognizer(target: self, action: #selector(pasteAndGo))
|
||||||
|
splitViewController.view.addGestureRecognizer(gr)
|
||||||
|
|
||||||
NotificationCenter.default.addObserver(forName: UIViewController.showDetailTargetDidChangeNotification, object: splitViewController, queue: nil) { [weak self] (notification) in
|
NotificationCenter.default.addObserver(forName: UIViewController.showDetailTargetDidChangeNotification, object: splitViewController, queue: nil) { [weak self] (notification) in
|
||||||
if let strongSelf = self, let svc = notification.object as? UISplitViewController {
|
if let strongSelf = self, let svc = notification.object as? UISplitViewController {
|
||||||
if svc.isCollapsed {
|
if svc.isCollapsed {
|
||||||
@ -50,6 +53,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func pasteAndGo() {
|
||||||
|
(dvc as? DetailViewController)?.textView.text = UIPasteboard.general.string
|
||||||
|
(dvc as? DetailViewController)?.play()
|
||||||
|
}
|
||||||
|
|
||||||
func applicationWillResignActive(_ application: UIApplication) {
|
func applicationWillResignActive(_ application: UIApplication) {
|
||||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||||
@ -93,4 +101,3 @@ extension AppDelegate: UINavigationControllerDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,11 @@ class DetailViewController: UIViewController {
|
|||||||
let loadObject = MVMCoreLoadObject(pageJSON: page, modulesJSON: jsonObject.optionalDictionaryForKey(KeyModuleMap), requestParameters: nil, dataForPage: nil, delegateObject: nil),
|
let loadObject = MVMCoreLoadObject(pageJSON: page, modulesJSON: jsonObject.optionalDictionaryForKey(KeyModuleMap), requestParameters: nil, dataForPage: nil, delegateObject: nil),
|
||||||
viewController.shouldFinishProcessingLoad(loadObject, error: &errorObject!) {
|
viewController.shouldFinishProcessingLoad(loadObject, error: &errorObject!) {
|
||||||
let navigation = UINavigationController(rootViewController: viewController)
|
let navigation = UINavigationController(rootViewController: viewController)
|
||||||
viewController.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(close))
|
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {
|
||||||
|
viewController.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(self.close))
|
||||||
|
}
|
||||||
|
let gr = UILongPressGestureRecognizer(target: self, action: #selector(DetailViewController.close))
|
||||||
|
viewController.view.addGestureRecognizer(gr)
|
||||||
MVMCoreNavigationHandler.shared()?.present(navigation, animated: true)
|
MVMCoreNavigationHandler.shared()?.present(navigation, animated: true)
|
||||||
} else if let errorObject = errorObject {
|
} else if let errorObject = errorObject {
|
||||||
let error = NSError(domain: ErrorDomainNative, code: ErrorCode.initViewController.rawValue, userInfo: [NSLocalizedDescriptionKey: errorObject.messageToLog ?? errorObject.messageToDisplay!])
|
let error = NSError(domain: ErrorDomainNative, code: ErrorCode.initViewController.rawValue, userInfo: [NSLocalizedDescriptionKey: errorObject.messageToLog ?? errorObject.messageToDisplay!])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user