FDFullScreenPopGesture
FDFullScreenPopGesture is a delightful navigation enhancement library for your iOS apps. It allows you to easily enable the full-screen pop gesture that is similar to the one in the iOS Mail app. With this library, you can enhance the user experience of your apps by providing an intuitive way for users to navigate back to the previous screen.
Features:
- Enables full-screen pop gesture in your iOS apps
- Easy integration and configuration
- Supports swipe gestures to navigate back
- Customizable animation and transition style
- Works well with both navigation bars and tab bars
Installation:
- Ensure you have CocoaPods installed on your machine.
- Create a
Podfile
in your project directory, if you don’t have one already. - Add the following line to your
Podfile
:
“`ruby
pod ‘FDFullScreenPopGesture’
“`
- Save the
Podfile
and run the following command:
“`shell
pod install
“`
- Open the newly created
.xcworkspace
file in Xcode. - Add
#import <FDFullScreenPopGesture.h>
to yourAppDelegate.m
file to enable the library in your app.
Configuration:
To customize the behavior of FDFullScreenPopGesture, you can use the following methods:
API methods:
+ (void)setEnabled:(BOOL)enabled;
– Enable or disable the full-screen pop gesture+ (BOOL)isEnabled;
– Check if the full-screen pop gesture is enabled+ (void)setPopGestureDelegate:(id<FDFullScreenPopGestureDelegate>)delegate;
– Set a custom delegate for the pop gesture+ (void)setPopGestureRecognizerAttribute:(SEL)attribute;
– Set a custom attribute for the pop gesture recognizer
Sample code:
To enable the full-screen pop gesture:
“`objective-c
[FDFullScreenPopGesture setEnabled:YES];
“`
To disable the full-screen pop gesture:
“`objective-c
[FDFullScreenPopGesture setEnabled:NO];
“`
Customization:
FDFullScreenPopGesture allows you to customize the animation and transition styles of the full-screen pop gesture. You can use the following properties:
Properties for customization:
@property (nonatomic, assign) CGFloat popMaxAllowedDistanceRatio;
– Defines the maximum ratio between the distance and width of the screen for a valid pop gesture (default is 0.5).@property (nonatomic, assign) NSTimeInterval animationDuration;
– Specifies the duration of the pop animation (default is 0.25 seconds).@property (nonatomic, assign) CGFloat animationDamping;
– Controls the damping ratio for the pop animation (default is 0.85).@property (nonatomic, assign) CGFloat animationVelocity;
– Specifies the velocity used for the initial phase of the pop animation (default is 0.5).
Sample code:
To customize the pop gesture behavior, set the desired values for the properties:
“`objective-c
FDFullScreenPopGesture.popMaxAllowedDistanceRatio = 0.6;
FDFullScreenPopGesture.animationDuration = 0.3;
FDFullScreenPopGesture.animationDamping = 0.7;
FDFullScreenPopGesture.animationVelocity = 0.8;
“`
Requirements:
- iOS 7.0 or later
- Xcode 8.0 or later
- Objective-C or Swift
License:
FDFullScreenPopGesture is available under the MIT license. See the LICENSE file for more info.