xmartlabs/XLActionController

Present XLActionController Modally rather than pushing overtop - Youtube

Closed this issue · 1 comments

Xcode Version: 9
iOS Version: 11.2.5
XLAlertController: Latest version on Master

Podfile:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
target '[my app name]' do
  use_frameworks!

   pod 'XLActionController'
   pod 'XLActionController/Youtube'
    # other pods

end

Please see video of the error here. Please note the state of the navigation bar before and after presenting the XLAlertController.

Code is below:

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        if(indexPath.row == profiles.count){
            print("will show add more")
        } else {
            print("will show options")
            let actionController = YoutubeActionController()
            navigationController?.setNavigationBarHidden(true, animated: true)
            actionController.addAction(Action(ActionData(title: "View Code", image: UIImage(named: "baseline_pageview_black_18dp")!), style: .default, handler: { action in
                   self.navigationController?.setNavigationBarHidden(false, animated: true)
             //load modally view controller here. This works, however, when I dismiss the view controller the navigation bar is in the incorrect state.
            }))
           
            //add other actions here

            present(actionController, animated: true)
        }
}

Hi @cdeck95 , please try presenting the actionController from the navigation controller.

self.navigationController.present(actionController, animated: true, completion: nil)

instead of

self.present(actionController, animated: true, completion: nil)