IOS-2063 Improvements IOS-2063
authorAdam Kowalski <ak@pep.security>
Fri, 07 Feb 2020 13:24:40 +0100
branchIOS-2063
changeset 116640ec0407f34ae
parent 11661 cb3c21df9813
child 11676 cc8dc3fc0c9c
IOS-2063 Improvements
pEpForiOS/UI/Compose/ComposeTableViewController.swift
     1.1 --- a/pEpForiOS/UI/Compose/ComposeTableViewController.swift	Fri Feb 07 12:18:20 2020 +0100
     1.2 +++ b/pEpForiOS/UI/Compose/ComposeTableViewController.swift	Fri Feb 07 13:24:40 2020 +0100
     1.3 @@ -139,8 +139,7 @@
     1.4  
     1.5      @objc
     1.6      private func showPepActions(sender: UIBarButtonItem) {
     1.7 -
     1.8 -        guard let vm = viewModel else {
     1.9 +        guard let vm = viewModel, let titleView = navigationItem.titleView else {
    1.10              Log.shared.errorAndCrash("No VM")
    1.11              return
    1.12          }
    1.13 @@ -148,10 +147,9 @@
    1.14          let actionSheetController = UIAlertController.pEpAlertController(preferredStyle: .actionSheet)
    1.15          actionSheetController.addAction(changeSecureStatusAction(pEpProtected: vm.state.pEpProtection))
    1.16          actionSheetController.addAction(disableAlertAction())
    1.17 +        actionSheetController.popoverPresentationController?.sourceView = titleView
    1.18 +        actionSheetController.popoverPresentationController?.sourceRect = titleView.bounds
    1.19  
    1.20 -        if splitViewController != nil, !onlySplitViewMasterIsShown {
    1.21 -            actionSheetController.popoverPresentationController?.barButtonItem = sender
    1.22 -        }
    1.23          present(actionSheetController, animated: true)
    1.24      }
    1.25