项目作者: flix-tech

项目描述 :
Set of wrappers to perform modal presentations & navigation transitions in a queued manner.
高级语言: Objective-C
项目地址: git://github.com/flix-tech/MFBNavigation.git
创建时间: 2017-02-16T12:22:44Z
项目社区:https://github.com/flix-tech/MFBNavigation

开源协议:MIT License

下载


MFBNavigation

This library provides wrapper classes to perform modal presentation & navigation transitions in a serial manner.

More details are coming soon.

Intergration

CocoaPods

  1. pod 'MFBNavigation', :git => 'https://github.com/flix-tech/MFBNavigation.git'

Carthage

  1. github "flix-tech/MFBNavigation"

Caveats

Popovers

iOS popovers can be dismissed by tapping on a background overlay view. By default iOS invokes -dismissViewControllerAnimated: directly.
That’s not we want since it bypasses the queueing mechanism. We can use popover delegate (UIPopoverPresentationControllerDelegate protocol)
to handle this, though:

  1. - (BOOL)popoverPresentationControllerShouldDismissPopover:(UIPopoverPresentationController *)popoverPresentationController
  2. {
  3. // enqueue dismissal
  4. [modalNavigator dismissModalViewControllerAnimated:YES completion:nil];
  5. // prevent default system behaviour
  6. return NO;
  7. }

In future, it might worth considering to proxy presentation delegates of any modally presented view controller in order to achieve
such behavior automatically.

UIActivityViewController

As popovers, presented UIActivityViewController instances can be dismissed with background overlay tap.

So far I didn’t find any way to prevent this & redirect the dismissal intention to a navigator.

It looks like UIActivityViewController uses similar (or even the same) presentation mechanism as popovers do,
though setting presentation controller delegate seems to have no effect.

Development

The library uses Carthage to fetch test target dependencies.
To bootstrap the project, run the following command:

  1. $ carthage bootstrap --platform ios

Note that podspec might have to be updated upon project changes.