0

I'm using SwipeViewController. I asked my question to the developer, but he ignores it. Here is my question.

When I close modal within dismiss method of ImagePicker

imagePicker.dismiss(animated: true, completion: nil)

Navigation bar from SwipeVC is displayed instead of VC1 navigation bar.

Do you have any ideas how to deal with that or what am I doing wrong?

gif problem : enter image description here

Sid Mhatre
  • 3,272
  • 1
  • 19
  • 38
  • do you add the 3 custom elements to your toolbar in the `viewWillAppear(_:)` method? if yes, just don't do that. – holex Mar 05 '18 at 12:59

1 Answers1

0

Your SwipeViewController is a subclass of UINavigationController and in the library they're adding the titleView(Which you say that is displaying) to the navigation Item.

What you can do is edit the source of the Library and move the setSwipeViewController() function into ViewDidLoad.

or

What you can do is take a boolean in SwipeViewController

var isSetupNeeded: Bool = true

and set it to true when you're presenting your imagePickerController. And in ViewWillAppear of SwipeVIewController set a condition that

if self.isSetupNeeded { 
    self.setSwipeViewController()
}
Agent Smith
  • 2,873
  • 17
  • 32
  • Yes, you are absolutely right, but there is a problem when I transfer to viewDidLoad - the boot sequence is this: 1)SwipeViewController viewDidLoad 2)VC: SwipeViewController viewDidLoad. And because of this pageArray in SwipeViewController is empty. And if you call setSwipeViewController () after filling the array in the ViewController, then the application does not crash, but the navigation bar is not drawn – Ruslan Mikailov Mar 05 '18 at 13:58
  • @RuslanMikailov Edited the answer!! – Agent Smith Mar 05 '18 at 14:03
  • @RuslanMikailov Great!! Happy Coding!! – Agent Smith Mar 05 '18 at 14:22