TOPasscodeViewControllerAnimatedTransitioning.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // TOPasscodeViewControllerAnimatedTransitioning.h
  3. //
  4. // Copyright 2017 Timothy Oliver. All rights reserved.
  5. //
  6. // Permission is hereby granted, free of charge, to any person obtaining a copy
  7. // of this software and associated documentation files (the "Software"), to
  8. // deal in the Software without restriction, including without limitation the
  9. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  10. // sell copies of the Software, and to permit persons to whom the Software is
  11. // furnished to do so, subject to the following conditions:
  12. //
  13. // The above copyright notice and this permission notice shall be included in
  14. // all copies or substantial portions of the Software.
  15. //
  16. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  20. // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
  21. // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. #import <Foundation/Foundation.h>
  23. #import <UIKit/UIKit.h>
  24. @class TOPasscodeViewController;
  25. NS_ASSUME_NONNULL_BEGIN
  26. /**
  27. An class conforming to `UIViewControllerAnimatedTransitioning` that handles the custom animation
  28. that plays when the passcode view controller is presented on the user's screen.
  29. */
  30. @interface TOPasscodeViewControllerAnimatedTransitioning : NSObject <UIViewControllerAnimatedTransitioning>
  31. /** The parent passcode view controller that this object will be controlling */
  32. @property (nonatomic, weak, readonly) TOPasscodeViewController *passcodeViewController;
  33. /** Whether the controller is being presented or dismissed. The animation is played in reverse when dismissing. */
  34. @property (nonatomic, assign) BOOL dismissing;
  35. /** If the correct passcode was successfully entered, this property can be set to YES. When the view controller
  36. is dismissing, the keypad view will also play a zooming out animation to give added context to the dismissal. */
  37. @property (nonatomic, assign) BOOL success;
  38. /**
  39. Creates a new instanc of `TOPasscodeViewControllerAnimatedTransitioning` that will control the provided passcode
  40. view controller.
  41. @param passcodeViewController The passcode view controller in which this object will coordinate the animation upon.
  42. @param dismissing Whether the animation is played to present the view controller, or dismiss it.
  43. @param success Whether the object needs to play an additional zooming animation denoting the passcode was successfully entered.
  44. */
  45. - (instancetype)initWithPasscodeViewController:(TOPasscodeViewController *)passcodeViewController
  46. dismissing:(BOOL)dismissing
  47. success:(BOOL)success;
  48. @end
  49. NS_ASSUME_NONNULL_END