marinofaggiana 4 years ago
parent
commit
b25f6e316d
41 changed files with 12 additions and 6529 deletions
  1. 1 0
      Cartfile
  2. 1 0
      Cartfile.resolved
  3. 0 57
      Libraries external/TOPasscodeViewController/Models/TOPasscodeCircleImage.h
  4. 0 75
      Libraries external/TOPasscodeViewController/Models/TOPasscodeCircleImage.m
  5. 0 97
      Libraries external/TOPasscodeViewController/Models/TOPasscodeViewContentLayout.h
  6. 0 190
      Libraries external/TOPasscodeViewController/Models/TOPasscodeViewContentLayout.m
  7. 0 60
      Libraries external/TOPasscodeViewController/Models/TOPasscodeViewControllerAnimatedTransitioning.h
  8. 0 120
      Libraries external/TOPasscodeViewController/Models/TOPasscodeViewControllerAnimatedTransitioning.m
  9. 0 54
      Libraries external/TOPasscodeViewController/Models/TOSettingsKeypadImage.h
  10. 0 186
      Libraries external/TOPasscodeViewController/Models/TOSettingsKeypadImage.m
  11. 0 71
      Libraries external/TOPasscodeViewController/Supporting/TOPasscodeViewControllerConstants.h
  12. 0 108
      Libraries external/TOPasscodeViewController/TOPasscodeSettingsViewController.h
  13. 0 612
      Libraries external/TOPasscodeViewController/TOPasscodeSettingsViewController.m
  14. 0 164
      Libraries external/TOPasscodeViewController/TOPasscodeViewController.h
  15. 0 688
      Libraries external/TOPasscodeViewController/TOPasscodeViewController.m
  16. 0 81
      Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeCircleButton.h
  17. 0 236
      Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeCircleButton.m
  18. 0 101
      Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeKeypadView.h
  19. 0 432
      Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeKeypadView.m
  20. 0 133
      Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeView.h
  21. 0 636
      Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeView.m
  22. 0 45
      Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadButton.h
  23. 0 103
      Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadButton.m
  24. 0 74
      Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadView.h
  25. 0 395
      Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadView.m
  26. 0 43
      Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsWarningLabel.h
  27. 0 154
      Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsWarningLabel.m
  28. 0 61
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeButtonLabel.h
  29. 0 186
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeButtonLabel.m
  30. 0 46
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeCircleView.h
  31. 0 89
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeCircleView.m
  32. 0 54
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeFixedInputView.h
  33. 0 171
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeFixedInputView.m
  34. 0 111
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeInputField.h
  35. 0 423
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeInputField.m
  36. 0 55
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeVariableInputView.h
  37. 0 254
      Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeVariableInputView.m
  38. 5 160
      Nextcloud.xcodeproj/project.pbxproj
  39. 1 1
      iOSClient/AppDelegate.m
  40. 3 2
      iOSClient/Settings/CCSettings.m
  41. 1 1
      iOSClient/Settings/NCManageEndToEndEncryption.m

+ 1 - 0
Cartfile

@@ -21,3 +21,4 @@ github "ivanbruel/MarkdownKit"
 github "https://github.com/marinofaggiana/AFNetworking" "master"
 github "https://github.com/marinofaggiana/KTVHTTPCache" "2.0.2"
 github "https://github.com/marinofaggiana/XLForm" "master"
+github "https://github.com/marinofaggiana/TOPasscodeViewController" "master"

+ 1 - 0
Cartfile.resolved

@@ -16,6 +16,7 @@ github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.7.1"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
+github "marinofaggiana/TOPasscodeViewController" "35347b0414590f4e5d299d873230da8612256760"
 github "marinofaggiana/XLForm" "eb9381ad8129f60402bf412250fb31b95a628a08"
 github "nextcloud/ios-communication-library" "229049eb830d2a4789d9e31f61b740f9cbe4d505"
 github "realm/realm-cocoa" "v4.4.1"

+ 0 - 57
Libraries external/TOPasscodeViewController/Models/TOPasscodeCircleImage.h

@@ -1,57 +0,0 @@
-//
-//  TOPasscodeCircleImage.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A subclass of `UIImage` that can procedurally generate both hollow and full circle graphics at any size.
- These are used for the 'normal' and 'tapped' states of the passcode circle buttons.
- */
-@interface TOPasscodeCircleImage : UIImage
-
-/**
- Generates and returns a `UIImage` of a filled circle at the specified size.
-
- @param size     The diameter of the final circle image
- @param inset    An inset value that will shrink the size of the circle. This is so it can be overlaid on a hollow circle
-                    without interfering with the anti-aliasing on the outer border.
- @param padding  External padding around the circle to ensure it won't be clipped by the edge of the layer.
-                    Setting this value will increase the dimensions of the final `UIImage`.
- @param antialias Whether the circle boundary will be antialiased (Since antialiasing is unnecessary if this circle will overlay another.)
- */
-+ (UIImage *)circleImageOfSize:(CGFloat)size inset:(CGFloat)inset padding:(CGFloat)padding antialias:(BOOL)antialias;
-
-/**
- Generates and returns a `UIImage` of a hollow circle at the specified size.
-
- @param size        The diameter of the final circle image
- @param strokeWidth The thickness, in points, of the stroke making up the circle image.
- @param padding     External padding around the circle to ensure it won't be clipped by the edge of the layer.
-                      Setting this value will increase the dimensions of the final `UIImage`.
- */
-+ (UIImage *)hollowCircleImageOfSize:(CGFloat)size strokeWidth:(CGFloat)strokeWidth padding:(CGFloat)padding;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 75
Libraries external/TOPasscodeViewController/Models/TOPasscodeCircleImage.m

@@ -1,75 +0,0 @@
-//
-//  TOPasscodeCircleImage.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeCircleImage.h"
-
-@implementation TOPasscodeCircleImage
-
-+ (UIImage *)circleImageOfSize:(CGFloat)size inset:(CGFloat)inset padding:(CGFloat)padding antialias:(BOOL)antialias
-{
-    UIImage *image = nil;
-    CGSize imageSize = (CGSize){size + (padding * 2), size + (padding * 2)};
-
-    UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0f);
-    {
-        CGContextRef context = UIGraphicsGetCurrentContext();
-
-        if (!antialias) {
-            CGContextSetShouldAntialias(context, NO);
-        }
-
-        CGRect rect = (CGRect){padding + inset, padding + inset, size - (inset * 2), size - (inset * 2)};
-        UIBezierPath* ovalPath = [UIBezierPath bezierPathWithOvalInRect:rect];
-        [[UIColor blackColor] setFill];
-        [ovalPath fill];
-
-        image = UIGraphicsGetImageFromCurrentImageContext();
-    }
-    UIGraphicsEndImageContext();
-
-    return [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
-}
-
-+ (UIImage *)hollowCircleImageOfSize:(CGFloat)size strokeWidth:(CGFloat)strokeWidth padding:(CGFloat)padding
-{
-    UIImage *image = nil;
-    CGSize canvasSize = (CGSize){size + (padding * 2), size + (padding * 2)};
-    CGSize circleSize = (CGSize){size, size};
-
-    UIGraphicsBeginImageContextWithOptions(canvasSize, NO, 0.0f);
-    {
-        CGRect circleRect = (CGRect){{padding, padding}, circleSize};
-        circleRect = CGRectInset(circleRect, (strokeWidth * 0.5f), (strokeWidth * 0.5f));
-
-        UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:circleRect];
-        [[UIColor blackColor] setStroke];
-        path.lineWidth = strokeWidth;
-        [path stroke];
-        
-        image = UIGraphicsGetImageFromCurrentImageContext();
-    }
-    UIGraphicsEndImageContext();
-
-    return [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
-}
-
-@end

+ 0 - 97
Libraries external/TOPasscodeViewController/Models/TOPasscodeViewContentLayout.h

@@ -1,97 +0,0 @@
-//
-//  TOPasscodeViewContentLayout.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-
-/**
- Depending on the width of the application window, all of the content views in
- the passcode view need to be resized in order to fit in the available space.
-
- This means that not only does the spacing and sizing of views need to be changed, but
- image assets need to be regenerated and font sizes need to change as well.
-
- This class assumes there will be three major screen sizes, and provides layout
- sizes, spacing, and styles in order to resize the passcode view for each one.
-
- The three screen styles it supports are:
-
- * Small Screens - iPhone 5/ or iPad 9.7" in 1/4 split screen mode
- * Medium Screens - iPhone 6/ or iPad 12.9" in 1/4 split screen mode
- * Large Screens - iPhone 6 Plus and all iPads when not in split screen mode.
-
- */
-@interface TOPasscodeViewContentLayout : NSObject
-
-/* The width of the PIN view in which this layout object is sizing the content to fit. */
-@property (nonatomic, assign) CGFloat viewWidth;
-
-/* Extra padding at the bottom in order to shift the content slightly up */
-@property (nonatomic, assign) CGFloat bottomPadding;
-
-/* The title view at the very top */
-@property (nonatomic, assign) CGFloat titleViewBottomSpacing;   // Space from the bottom of the title view to the title label
-
-/* The Title Label Explaining the Passcode View */
-@property (nonatomic, assign) CGFloat titleLabelBottomSpacing;    // Space from the title label to the input view
-
-@property (nonatomic, strong) UIFont *titleLabelFont;             // The font of the title label
-
-/* Title Label properties when the view is laid out horizontally */
-@property (nonatomic, assign) CGFloat titleHorizontalLayoutWidth;   // When laid out horizontally, the width of the title view
-@property (nonatomic, assign) CGFloat titleHorizontalLayoutSpacing; // The amount of spacing between the title label and the passcode keypad
-@property (nonatomic, assign) CGFloat titleViewHorizontalBottomSpacing; // Space from the bottom of the title view when iPhone is horizontal
-@property (nonatomic, assign) CGFloat titleLabelHorizontalBottomSpacing; // Spacing from the title label to input view in horizontal mode
-
-/* Circle Row Configuration */
-@property (nonatomic, assign) CGFloat circleRowDiameter; // The diameter of each circle representing a PIN number
-@property (nonatomic, assign) CGFloat circleRowSpacing;  // The spacing between each circle
-@property (nonatomic, assign) CGFloat circleRowBottomSpacing; // Space between the view used to indicate input
-
-/* Text Field Configuration */
-@property (nonatomic, assign) CGFloat textFieldBorderThickness; // The thickness of the border stroke
-@property (nonatomic, assign) CGFloat textFieldBorderRadius;    // The corner radius of the border
-@property (nonatomic, assign) CGFloat textFieldCircleDiameter;  // The size of the circles in the passcode field
-@property (nonatomic, assign) CGFloat textFieldCircleSpacing;   // The amount of spacing between each circle
-@property (nonatomic, assign) CGSize textFieldBorderPadding;   // The amount of padding between the circles and the border
-@property (nonatomic, assign) NSInteger textFieldNumericCharacterLength; // The amount of circles to have in this field when set to numeric
-@property (nonatomic, assign) NSInteger textFieldAlphanumericCharacterLength; // The amount of circles to have in this field when set to alphanumeric
-@property (nonatomic, assign) CGFloat submitButtonFontSize;     // The font size of the 'OK' button
-@property (nonatomic, assign) CGFloat submitButtonSpacing;      // The spacing of the 'OK' button from the input
-
-/* Circle Button Shape and Layout */
-@property (nonatomic, assign) CGFloat circleButtonDiameter;     // The size of each PIN button
-@property (nonatomic, assign) CGSize  circleButtonSpacing;      // The vertical/horizontal spacing between buttons
-@property (nonatomic, assign) CGFloat circleButtonStrokeWidth;  // The thickness of the border line
-
-/* Circle Button Label */
-@property (nonatomic, strong) UIFont *circleButtonTitleLabelFont;       // The font used for the '1' number labels
-@property (nonatomic, strong) UIFont *circleButtonLetteringLabelFont;   // The font used for the 'ABC' labels
-@property (nonatomic, assign) CGFloat circleButtonLabelSpacing;         // The vertical spacing between the number and lettering labels
-@property (nonatomic, assign) CGFloat circleButtonLetteringSpacing;     // The spacing between the 'ABC' characters
-
-/* Default layout configurations for the various sizes */
-+ (TOPasscodeViewContentLayout *)defaultScreenContentLayout;       /* Default layout values. Designed for iPhone 6 Plus and above. */
-+ (TOPasscodeViewContentLayout *)mediumScreenContentLayout;        /* For medium screen sizes, like iPhone 6, or 1/4 view on iPad Pro. */
-+ (TOPasscodeViewContentLayout *)smallScreenContentLayout;         /* For the smallest screens, like iPhone SE, and 1/4 on standard size iPads/ */
-
-@end

+ 0 - 190
Libraries external/TOPasscodeViewController/Models/TOPasscodeViewContentLayout.m

@@ -1,190 +0,0 @@
-//
-//  TOPasscodeViewContentLayout.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeViewContentLayout.h"
-
-@implementation TOPasscodeViewContentLayout
-
-+ (TOPasscodeViewContentLayout *)defaultScreenContentLayout
-{
-    TOPasscodeViewContentLayout *contentLayout = [[TOPasscodeViewContentLayout alloc] init];
-
-    /* Width of the PIN View */
-    contentLayout.viewWidth = 414.0f;
-
-    /* Bottom Padding */
-    contentLayout.bottomPadding = 25.0f;
-
-    /* Title View Constraints */
-    contentLayout.titleViewBottomSpacing = 34.0f;
-
-    /* The Title Label Explaining the PIN View */
-    contentLayout.titleLabelBottomSpacing = 34.0f;
-    contentLayout.titleLabelFont = [UIFont systemFontOfSize: 22.0f];
-
-    /* Horizontal title constraints */
-    contentLayout.titleHorizontalLayoutWidth = 250.0f;
-    contentLayout.titleHorizontalLayoutSpacing = 35.0f;
-    contentLayout.titleViewHorizontalBottomSpacing = 20.0f;
-    contentLayout.titleLabelHorizontalBottomSpacing = 20.0f;
-
-    /* Circle Row Configuration */
-    contentLayout.circleRowDiameter = 15.5f;
-    contentLayout.circleRowSpacing = 30.0f;
-    contentLayout.circleRowBottomSpacing = 61.0f;
-
-    /* Text Field Input Configuration */
-    contentLayout.textFieldBorderThickness  = 1.5f;
-    contentLayout.textFieldBorderRadius     = 5.0f;
-    contentLayout.textFieldCircleDiameter   = 10.0f;
-    contentLayout.textFieldCircleSpacing    = 6.0f;
-    contentLayout.textFieldBorderPadding    = (CGSize){10, 10};
-    contentLayout.textFieldNumericCharacterLength  = 10;
-    contentLayout.textFieldAlphanumericCharacterLength = 15;
-    contentLayout.submitButtonFontSize = 17.0f;
-    contentLayout.submitButtonSpacing  = 4.0f;
-
-    /* Circle Button Shape and Layout */
-    contentLayout.circleButtonDiameter = 81.0f;
-    contentLayout.circleButtonSpacing = (CGSize){25.0f, 20.0f};
-    contentLayout.circleButtonStrokeWidth = 1.5f;
-
-    /* Circle Button Label */
-    contentLayout.circleButtonTitleLabelFont = [UIFont systemFontOfSize:37.5f weight:UIFontWeightThin];
-    contentLayout.circleButtonLetteringLabelFont = [UIFont systemFontOfSize:9.0f weight:UIFontWeightThin];
-    contentLayout.circleButtonLabelSpacing = 6.0f;
-    contentLayout.circleButtonLetteringSpacing = 3.0f;
-
-    return contentLayout;
-}
-
-+ (TOPasscodeViewContentLayout *)mediumScreenContentLayout
-{
-    TOPasscodeViewContentLayout *contentLayout = [[TOPasscodeViewContentLayout alloc] init];
-
-    /* Width of the PIN View */
-    contentLayout.viewWidth = 375.0f;
-
-    /* Bottom Padding */
-    contentLayout.bottomPadding = 17.0f;
-
-    /* Title View Constraints */
-    contentLayout.titleViewBottomSpacing = 27.0f;
-
-    /* The Title Label Explaining the PIN View */
-    contentLayout.titleLabelBottomSpacing = 24.0f;
-    contentLayout.titleLabelFont = [UIFont systemFontOfSize: 20.0f];
-
-    /* Horizontal title constraints */
-    contentLayout.titleHorizontalLayoutWidth = 185.0f;
-    contentLayout.titleHorizontalLayoutSpacing = 16.0f;
-    contentLayout.titleViewHorizontalBottomSpacing = 18.0f;
-    contentLayout.titleLabelHorizontalBottomSpacing = 18.0f;
-
-    /* Circle Row Configuration */
-    contentLayout.circleRowDiameter = 13.5f;
-    contentLayout.circleRowSpacing = 26.0f;
-    contentLayout.circleRowBottomSpacing = 53.0f;
-
-    /* Submit Button */
-    contentLayout.submitButtonFontSize = 16.0f;
-    contentLayout.submitButtonSpacing  = 4.0f;
-    
-    /* Circle Button Shape and Layout */
-    contentLayout.circleButtonDiameter = 75.0f;
-    contentLayout.circleButtonSpacing = (CGSize){28.0f, 15.0f};
-    contentLayout.circleButtonStrokeWidth = 1.5f;
-
-    /* Text Field Input Configuration */
-    contentLayout.textFieldBorderThickness  = 1.5f;
-    contentLayout.textFieldBorderRadius     = 5.0f;
-    contentLayout.textFieldCircleDiameter   = 9.0f;
-    contentLayout.textFieldCircleSpacing    = 5.0f;
-    contentLayout.textFieldBorderPadding    = (CGSize){10, 10};
-    contentLayout.textFieldNumericCharacterLength  = 10;
-    contentLayout.textFieldAlphanumericCharacterLength = 15;
-
-    /* Circle Button Label */
-    contentLayout.circleButtonTitleLabelFont = [UIFont systemFontOfSize:36.5f weight:UIFontWeightThin];
-    contentLayout.circleButtonLetteringLabelFont = [UIFont systemFontOfSize:8.5f weight:UIFontWeightThin];
-    contentLayout.circleButtonLabelSpacing = 5.0f;
-    contentLayout.circleButtonLetteringSpacing = 2.5f;
-
-    return contentLayout;
-}
-
-+ (TOPasscodeViewContentLayout *)smallScreenContentLayout
-{
-    TOPasscodeViewContentLayout *contentLayout = [[TOPasscodeViewContentLayout alloc] init];
-
-    /* Width of the PIN View */
-    contentLayout.viewWidth = 320.0f;
-
-    /* Bottom Padding */
-    contentLayout.bottomPadding = 12.0f;
-
-    /* Title View Constraints */
-    contentLayout.titleViewBottomSpacing = 23.0f;
-
-    /* The Title Label Explaining the PIN View */
-    contentLayout.titleLabelBottomSpacing = 23.0f;
-    contentLayout.titleLabelFont = [UIFont systemFontOfSize: 17.0f];
-
-    /* Horizontal title constraints */
-    contentLayout.titleHorizontalLayoutWidth = 185.0f;
-    contentLayout.titleHorizontalLayoutSpacing = 5.0f;
-    contentLayout.titleViewHorizontalBottomSpacing = 18.0f;
-    contentLayout.titleLabelHorizontalBottomSpacing = 18.0f;
-
-    /* Circle Row Configuration */
-    contentLayout.circleRowDiameter = 12.5f;
-    contentLayout.circleRowSpacing = 22.0f;
-    contentLayout.circleRowBottomSpacing = 44.0f;
-
-    /* Text Field Input Configuration */
-    contentLayout.textFieldBorderThickness  = 1.5f;
-    contentLayout.textFieldBorderRadius     = 5.0f;
-    contentLayout.textFieldCircleDiameter   = 8.0f;
-    contentLayout.textFieldCircleSpacing    = 4.0f;
-    contentLayout.textFieldBorderPadding    = (CGSize){8, 8};
-    contentLayout.textFieldNumericCharacterLength  = 10;
-    contentLayout.textFieldAlphanumericCharacterLength = 15;
-
-    /* Submit Button */
-    contentLayout.submitButtonFontSize = 15.0f;
-    contentLayout.submitButtonSpacing  = 3.0f;
-
-    /* Circle Button Shape and Layout */
-    contentLayout.circleButtonDiameter = 76.0f;
-    contentLayout.circleButtonSpacing = (CGSize){20.0f, 12.5f};
-    contentLayout.circleButtonStrokeWidth = 1.5f;
-
-    /* Circle Button Label */
-    contentLayout.circleButtonTitleLabelFont = [UIFont systemFontOfSize:35.0f weight:UIFontWeightThin];
-    contentLayout.circleButtonLetteringLabelFont = [UIFont systemFontOfSize:9.0f weight:UIFontWeightThin];
-    contentLayout.circleButtonLabelSpacing = 4.5f;
-    contentLayout.circleButtonLetteringSpacing = 2.0f;
-
-    return contentLayout;
-}
-
-@end

+ 0 - 60
Libraries external/TOPasscodeViewController/Models/TOPasscodeViewControllerAnimatedTransitioning.h

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

+ 0 - 120
Libraries external/TOPasscodeViewController/Models/TOPasscodeViewControllerAnimatedTransitioning.m

@@ -1,120 +0,0 @@
-//
-//  TOPasscodeViewControllerAnimatedTransitioning.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeViewControllerAnimatedTransitioning.h"
-#import "TOPasscodeViewController.h"
-#import "TOPasscodeView.h"
-
-@interface TOPasscodeViewControllerAnimatedTransitioning ()
-@property (nonatomic, weak) TOPasscodeViewController *passcodeViewController;
-@end
-
-@implementation TOPasscodeViewControllerAnimatedTransitioning
-
-- (instancetype)initWithPasscodeViewController:(TOPasscodeViewController *)passcodeViewController dismissing:(BOOL)dismissing success:(BOOL)success
-{
-    if (self = [super init]) {
-        _passcodeViewController = passcodeViewController;
-        _dismissing = dismissing;
-        _success = success;
-    }
-
-    return self;
-}
-
-- (NSTimeInterval)transitionDuration:(nullable id <UIViewControllerContextTransitioning>)transitionContext
-{
-    return 0.35f;
-}
-
-- (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext
-{
-    BOOL isPhone = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone;
-    UIView *containerView = transitionContext.containerView;
-    UIVisualEffectView *backgroundEffectView = self.passcodeViewController.backgroundEffectView;
-    UIView *backgroundView = self.passcodeViewController.backgroundView;
-    UIVisualEffect *backgroundEffect = backgroundEffectView.effect;
-    TOPasscodeView *passcodeView = self.passcodeViewController.passcodeView;
-
-    // Set the initial properties when presenting
-    if (!self.dismissing) {
-        backgroundEffectView.effect = nil;
-        backgroundView.alpha = 0.0f;
-
-        self.passcodeViewController.view.frame = containerView.bounds;
-        [containerView addSubview:self.passcodeViewController.view];
-    }
-    else {
-        UIViewController *baseController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
-        if (baseController.view.superview == nil) {
-            [containerView insertSubview:baseController.view atIndex:0];
-        }
-    }
-
-    CGFloat alpha = self.dismissing ? 1.0f : 0.0f;
-    passcodeView.contentAlpha = alpha;
-
-    // Animate the accessory views
-    if (isPhone) {
-        self.passcodeViewController.leftAccessoryButton.alpha = alpha;
-        self.passcodeViewController.rightAccessoryButton.alpha = alpha;
-        self.passcodeViewController.cancelButton.alpha = alpha;
-        self.passcodeViewController.biometricButton.alpha  = alpha;
-    }
-
-    id animationBlock = ^{
-        backgroundEffectView.effect = self.dismissing ? nil : backgroundEffect;
-        backgroundView.alpha = self.dismissing ? 0.0f : 1.0f;
-
-        CGFloat toAlpha = self.dismissing ? 0.0f : 1.0f;
-        passcodeView.contentAlpha = toAlpha;
-        if (isPhone) {
-            self.passcodeViewController.leftAccessoryButton.alpha = toAlpha;
-            self.passcodeViewController.rightAccessoryButton.alpha = toAlpha;
-            self.passcodeViewController.cancelButton.alpha = toAlpha;
-            self.passcodeViewController.biometricButton.alpha  = toAlpha;
-        }
-    };
-
-    id completedBlock = ^(BOOL completed) {
-        backgroundEffectView.effect = backgroundEffect;
-        [transitionContext completeTransition:completed];
-    };
-
-    // If we're animating out from a successful passcode, play a zooming out animation
-    // to give some more context
-    if (self.success && self.dismissing) {
-        CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
-        animation.duration = [self transitionDuration:transitionContext];
-        animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.9f, 0.9f, 1)];
-        animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
-        [passcodeView.layer addAnimation:animation forKey:@"transform"];
-    }
-
-    [UIView animateWithDuration:[self transitionDuration:transitionContext]
-                          delay:0.0f
-                        options:UIViewAnimationOptionAllowUserInteraction
-                     animations:animationBlock
-                     completion:completedBlock];
-}
-
-@end

+ 0 - 54
Libraries external/TOPasscodeViewController/Models/TOSettingsKeypadImage.h

@@ -1,54 +0,0 @@
-//
-//  TOSettingsKeypadImage.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A subclass of `UIImage` that procedurally generates images for `TOPasscodeSettingsKeypadView`.
- This includes background images for each keypad button, and a delete icon for the bottom right corner
- of the keypad.
- */
-@interface TOSettingsKeypadImage : UIImage
-
-/**
- Generates and returns an image of button background with a raised border in a pseudo-skeuomorphic style.
-
- @param radius The rounded radius of the button image's corners
- @param foregroundColor The fill color of the primary section of the button
- @param edgeColor The color of the raised border edge along the bottom.
- @param thickness The size of the border running along the bottom
- */
-+ (UIImage *)buttonImageWithCornerRadius:(CGFloat)radius
-                         foregroundColor:(UIColor *)foregroundColor
-                               edgeColor:(UIColor *)edgeColor
-                           edgeThickness:(CGFloat)thickness;
-
-/**
-Generates and returns a tintable delete icon.
- */
-+ (UIImage *)deleteIcon;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 186
Libraries external/TOPasscodeViewController/Models/TOSettingsKeypadImage.m

@@ -1,186 +0,0 @@
-//
-//  TOSettingsKeypadImage.m
-//  TOPasscodeViewControllerExample
-//
-//  Created by Tim Oliver on 6/20/17.
-//  Copyright © 2017 Timothy Oliver. All rights reserved.
-//
-
-#import "TOSettingsKeypadImage.h"
-
-#define TOP_LEFT(X, Y) CGPointMake(rect.origin.x + X * limitedRadius, rect.origin.y + Y * limitedRadius)
-#define TOP_RIGHT(X, Y) CGPointMake(rect.origin.x + rect.size.width - X * limitedRadius, rect.origin.y + Y * limitedRadius)
-#define BOTTOM_RIGHT(X, Y) CGPointMake(rect.origin.x + rect.size.width - X * limitedRadius, rect.origin.y + rect.size.height - Y * limitedRadius)
-#define BOTTOM_LEFT(X, Y) CGPointMake(rect.origin.x + X * limitedRadius, rect.origin.y + rect.size.height - Y * limitedRadius)
-
-@implementation TOSettingsKeypadImage
-
-+ (UIImage *)buttonImageWithCornerRadius:(CGFloat)radius
-                         foregroundColor:(UIColor *)foregroundColor
-                               edgeColor:(UIColor *)edgeColor
-                           edgeThickness:(CGFloat)thickness
-{
-    CGFloat width = (radius * 2.0f) + 1.0f;
-    CGFloat height = width + thickness;
-
-    CGRect frame = (CGRect){CGPointZero, {width, height}};
-
-    UIImage *image = nil;
-    UIGraphicsBeginImageContextWithOptions(frame.size, NO, 0.0f);
-    {
-        CGContextRef context = UIGraphicsGetCurrentContext();
-
-        NSShadow* shadow = [[NSShadow alloc] init];
-        shadow.shadowColor  = edgeColor;
-        shadow.shadowOffset = CGSizeMake(0, thickness);
-        shadow.shadowBlurRadius = 0;
-
-        CGRect buttonFrame = frame;
-        buttonFrame.size.height -= thickness;
-
-        CGContextSaveGState(context);
-        {
-            CGContextSetShadowWithColor(context, shadow.shadowOffset, shadow.shadowBlurRadius, [shadow.shadowColor CGColor]);
-            UIBezierPath *buttonPath = [[self class] bezierPathWithContinuousRoundedRect:buttonFrame cornerRadius:radius];//bezierPathWithRoundedRect:buttonFrame cornerRadius:radius];
-            [foregroundColor setFill];
-            [buttonPath fill];
-        }
-        CGContextRestoreGState(context);
-
-        image = UIGraphicsGetImageFromCurrentImageContext();
-    }
-    UIGraphicsEndImageContext();
-
-    UIEdgeInsets insets = UIEdgeInsetsMake(radius, radius, radius + thickness, radius);
-    image = [image resizableImageWithCapInsets:insets];
-
-    return image;
-}
-
-+ (UIImage *)deleteIcon
-{
-    UIImage *image = nil;
-
-    CGRect frame = CGRectMake(0, 0, 40.0f, 21.0f);
-    UIGraphicsBeginImageContextWithOptions(frame.size, NO, 0.0f);
-    {
-        //// DeleteIcon
-        {
-            //// Border Drawing
-            UIBezierPath* borderPath = [UIBezierPath bezierPath];
-            [borderPath moveToPoint: CGPointMake(25.73, 1.5)];
-            [borderPath addLineToPoint: CGPointMake(25.9, 1.53)];
-            [borderPath addCurveToPoint: CGPointMake(28.34, 3.46) controlPoint1: CGPointMake(27.03, 1.86) controlPoint2: CGPointMake(27.93, 2.56)];
-            [borderPath addCurveToPoint: CGPointMake(28.67, 6.56) controlPoint1: CGPointMake(28.67, 4.28) controlPoint2: CGPointMake(28.67, 5.04)];
-            [borderPath addLineToPoint: CGPointMake(28.64, 14.23)];
-            [borderPath addCurveToPoint: CGPointMake(28.35, 17.05) controlPoint1: CGPointMake(28.64, 15.76) controlPoint2: CGPointMake(28.64, 16.37)];
-            [borderPath addLineToPoint: CGPointMake(28.31, 17.19)];
-            [borderPath addCurveToPoint: CGPointMake(25.86, 19.11) controlPoint1: CGPointMake(27.89, 18.08) controlPoint2: CGPointMake(27, 18.79)];
-            [borderPath addCurveToPoint: CGPointMake(21.4, 19.37) controlPoint1: CGPointMake(24.82, 19.37) controlPoint2: CGPointMake(23.34, 19.37)];
-            [borderPath addLineToPoint: CGPointMake(11.51, 19.37)];
-            [borderPath addCurveToPoint: CGPointMake(9.9, 19.07) controlPoint1: CGPointMake(11.51, 19.37) controlPoint2: CGPointMake(10.41, 19.3)];
-            [borderPath addCurveToPoint: CGPointMake(7.38, 17.06) controlPoint1: CGPointMake(9.09, 18.68) controlPoint2: CGPointMake(8.52, 18.14)];
-            [borderPath addLineToPoint: CGPointMake(3.92, 13.81)];
-            [borderPath addCurveToPoint: CGPointMake(1.87, 11.55) controlPoint1: CGPointMake(2.78, 12.73) controlPoint2: CGPointMake(2.21, 12.19)];
-            [borderPath addLineToPoint: CGPointMake(1.79, 11.43)];
-            [borderPath addCurveToPoint: CGPointMake(1.82, 9.06) controlPoint1: CGPointMake(1.36, 10.57) controlPoint2: CGPointMake(1.4, 9.92)];
-            [borderPath addCurveToPoint: CGPointMake(3.96, 6.68) controlPoint1: CGPointMake(2.25, 8.29) controlPoint2: CGPointMake(2.82, 7.76)];
-            [borderPath addLineToPoint: CGPointMake(7.21, 3.61)];
-            [borderPath addCurveToPoint: CGPointMake(9.61, 1.67) controlPoint1: CGPointMake(8.35, 2.54) controlPoint2: CGPointMake(8.92, 2)];
-            [borderPath addLineToPoint: CGPointMake(9.73, 1.6)];
-            [borderPath addCurveToPoint: CGPointMake(11.41, 1.31) controlPoint1: CGPointMake(10.26, 1.37) controlPoint2: CGPointMake(10.84, 1.27)];
-            [borderPath addLineToPoint: CGPointMake(21.44, 1.27)];
-            [borderPath addCurveToPoint: CGPointMake(25.73, 1.5) controlPoint1: CGPointMake(23.38, 1.27) controlPoint2: CGPointMake(24.85, 1.27)];
-            [borderPath closePath];
-            [UIColor.blackColor setStroke];
-            borderPath.lineWidth = 2.5;
-            [borderPath stroke];
-
-
-            //// Cross Drawing
-            UIBezierPath* crossPath = [UIBezierPath bezierPath];
-            [crossPath moveToPoint: CGPointMake(15.22, 5.9)];
-            [crossPath addCurveToPoint: CGPointMake(15.21, 5.88) controlPoint1: CGPointMake(15.27, 5.95) controlPoint2: CGPointMake(15.21, 5.88)];
-            [crossPath addLineToPoint: CGPointMake(15.22, 5.9)];
-            [crossPath closePath];
-            [crossPath moveToPoint: CGPointMake(16.18, 10.28)];
-            [crossPath addCurveToPoint: CGPointMake(16.19, 10.26) controlPoint1: CGPointMake(16.22, 10.29) controlPoint2: CGPointMake(16.2, 10.28)];
-            [crossPath addLineToPoint: CGPointMake(16.18, 10.28)];
-            [crossPath closePath];
-            [crossPath moveToPoint: CGPointMake(14.52, 5.35)];
-            [crossPath addCurveToPoint: CGPointMake(15.21, 5.88) controlPoint1: CGPointMake(14.75, 5.46) controlPoint2: CGPointMake(14.93, 5.62)];
-            [crossPath addCurveToPoint: CGPointMake(15.38, 6.05) controlPoint1: CGPointMake(15.26, 5.94) controlPoint2: CGPointMake(15.32, 5.99)];
-            [crossPath addCurveToPoint: CGPointMake(15.43, 6.09) controlPoint1: CGPointMake(15.42, 6.09) controlPoint2: CGPointMake(15.43, 6.09)];
-            [crossPath addCurveToPoint: CGPointMake(15.38, 6.05) controlPoint1: CGPointMake(15.21, 5.88) controlPoint2: CGPointMake(15.27, 5.95)];
-            [crossPath addCurveToPoint: CGPointMake(17.97, 8.55) controlPoint1: CGPointMake(15.94, 6.59) controlPoint2: CGPointMake(17.66, 8.25)];
-            [crossPath addCurveToPoint: CGPointMake(17.97, 8.55) controlPoint1: CGPointMake(17.91, 8.61) controlPoint2: CGPointMake(17.94, 8.58)];
-            [crossPath addCurveToPoint: CGPointMake(21.36, 5.39) controlPoint1: CGPointMake(20.95, 5.68) controlPoint2: CGPointMake(21.14, 5.5)];
-            [crossPath addCurveToPoint: CGPointMake(22.67, 5.58) controlPoint1: CGPointMake(21.83, 5.17) controlPoint2: CGPointMake(22.34, 5.26)];
-            [crossPath addCurveToPoint: CGPointMake(22.98, 6.89) controlPoint1: CGPointMake(23.09, 5.99) controlPoint2: CGPointMake(23.18, 6.47)];
-            [crossPath addCurveToPoint: CGPointMake(22.28, 7.68) controlPoint1: CGPointMake(22.84, 7.14) controlPoint2: CGPointMake(22.65, 7.32)];
-            [crossPath addCurveToPoint: CGPointMake(19.68, 10.19) controlPoint1: CGPointMake(22.28, 7.68) controlPoint2: CGPointMake(20.88, 9.03)];
-            [crossPath addCurveToPoint: CGPointMake(22.97, 13.47) controlPoint1: CGPointMake(22.66, 13.06) controlPoint2: CGPointMake(22.85, 13.25)];
-            [crossPath addCurveToPoint: CGPointMake(22.76, 14.79) controlPoint1: CGPointMake(23.21, 13.95) controlPoint2: CGPointMake(23.11, 14.46)];
-            [crossPath addCurveToPoint: CGPointMake(21.35, 15.1) controlPoint1: CGPointMake(22.33, 15.22) controlPoint2: CGPointMake(21.8, 15.31)];
-            [crossPath addCurveToPoint: CGPointMake(20.48, 14.4) controlPoint1: CGPointMake(21.07, 14.97) controlPoint2: CGPointMake(20.87, 14.78)];
-            [crossPath addCurveToPoint: CGPointMake(17.89, 11.91) controlPoint1: CGPointMake(20.48, 14.4) controlPoint2: CGPointMake(19.08, 13.05)];
-            [crossPath addCurveToPoint: CGPointMake(14.5, 15.06) controlPoint1: CGPointMake(14.91, 14.78) controlPoint2: CGPointMake(14.73, 14.95)];
-            [crossPath addCurveToPoint: CGPointMake(13.2, 14.87) controlPoint1: CGPointMake(14.04, 15.28) controlPoint2: CGPointMake(13.53, 15.19)];
-            [crossPath addCurveToPoint: CGPointMake(12.89, 13.57) controlPoint1: CGPointMake(12.78, 14.47) controlPoint2: CGPointMake(12.69, 13.98)];
-            [crossPath addCurveToPoint: CGPointMake(13.42, 12.93) controlPoint1: CGPointMake(13, 13.35) controlPoint2: CGPointMake(13.15, 13.19)];
-            [crossPath addCurveToPoint: CGPointMake(13.59, 12.77) controlPoint1: CGPointMake(13.47, 12.88) controlPoint2: CGPointMake(13.53, 12.83)];
-            [crossPath addCurveToPoint: CGPointMake(16.19, 10.26) controlPoint1: CGPointMake(14.12, 12.25) controlPoint2: CGPointMake(15.78, 10.66)];
-            [crossPath addCurveToPoint: CGPointMake(12.89, 6.98) controlPoint1: CGPointMake(13.21, 7.39) controlPoint2: CGPointMake(13.01, 7.2)];
-            [crossPath addCurveToPoint: CGPointMake(12.77, 6.63) controlPoint1: CGPointMake(12.82, 6.84) controlPoint2: CGPointMake(12.79, 6.73)];
-            [crossPath addCurveToPoint: CGPointMake(13.1, 5.66) controlPoint1: CGPointMake(12.72, 6.28) controlPoint2: CGPointMake(12.83, 5.92)];
-            [crossPath addCurveToPoint: CGPointMake(14.52, 5.35) controlPoint1: CGPointMake(13.54, 5.24) controlPoint2: CGPointMake(14.07, 5.15)];
-            [crossPath closePath];
-            [UIColor.blackColor setFill];
-            [crossPath fill];
-        }
-
-        image = UIGraphicsGetImageFromCurrentImageContext();
-    }
-    UIGraphicsEndImageContext();
-
-    return [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
-}
-
-/**
- Creates a bezier path with the iOS 7 squircle shape.
-
- A HUGE thanks to the folks at PaintCode for open-sourcing this
- https://www.paintcodeapp.com/news/code-for-ios-7-rounded-rectangles
- */
-+ (UIBezierPath *)bezierPathWithContinuousRoundedRect:(CGRect)rect cornerRadius:(CGFloat)radius
-{
-    UIBezierPath* path = UIBezierPath.bezierPath;
-    CGFloat limit = MIN(rect.size.width, rect.size.height) / 2 / 1.52866483;
-    CGFloat limitedRadius = MIN(radius, limit);
-
-    [path moveToPoint: TOP_LEFT(1.52866483, 0.00000000)];
-    [path addLineToPoint: TOP_RIGHT(1.52866471, 0.00000000)];
-    [path addCurveToPoint: TOP_RIGHT(0.66993427, 0.06549600) controlPoint1: TOP_RIGHT(1.08849323, 0.00000000) controlPoint2: TOP_RIGHT(0.86840689, 0.00000000)];
-    [path addLineToPoint: TOP_RIGHT(0.63149399, 0.07491100)];
-    [path addCurveToPoint: TOP_RIGHT(0.07491176, 0.63149399) controlPoint1: TOP_RIGHT(0.37282392, 0.16905899) controlPoint2: TOP_RIGHT(0.16906013, 0.37282401)];
-    [path addCurveToPoint: TOP_RIGHT(0.00000000, 1.52866483) controlPoint1: TOP_RIGHT(0.00000000, 0.86840701) controlPoint2: TOP_RIGHT(0.00000000, 1.08849299)];
-    [path addLineToPoint: BOTTOM_RIGHT(0.00000000, 1.52866471)];
-    [path addCurveToPoint: BOTTOM_RIGHT(0.06549569, 0.66993493) controlPoint1: BOTTOM_RIGHT(0.00000000, 1.08849323) controlPoint2: BOTTOM_RIGHT(0.00000000, 0.86840689)];
-    [path addLineToPoint: BOTTOM_RIGHT(0.07491111, 0.63149399)];
-    [path addCurveToPoint: BOTTOM_RIGHT(0.63149399, 0.07491111) controlPoint1: BOTTOM_RIGHT(0.16905883, 0.37282392) controlPoint2: BOTTOM_RIGHT(0.37282392, 0.16905883)];
-    [path addCurveToPoint: BOTTOM_RIGHT(1.52866471, 0.00000000) controlPoint1: BOTTOM_RIGHT(0.86840689, 0.00000000) controlPoint2: BOTTOM_RIGHT(1.08849323, 0.00000000)];
-    [path addLineToPoint: BOTTOM_LEFT(1.52866483, 0.00000000)];
-    [path addCurveToPoint: BOTTOM_LEFT(0.66993397, 0.06549569) controlPoint1: BOTTOM_LEFT(1.08849299, 0.00000000) controlPoint2: BOTTOM_LEFT(0.86840701, 0.00000000)];
-    [path addLineToPoint: BOTTOM_LEFT(0.63149399, 0.07491111)];
-    [path addCurveToPoint: BOTTOM_LEFT(0.07491100, 0.63149399) controlPoint1: BOTTOM_LEFT(0.37282401, 0.16905883) controlPoint2: BOTTOM_LEFT(0.16906001, 0.37282392)];
-    [path addCurveToPoint: BOTTOM_LEFT(0.00000000, 1.52866471) controlPoint1: BOTTOM_LEFT(0.00000000, 0.86840689) controlPoint2: BOTTOM_LEFT(0.00000000, 1.08849323)];
-    [path addLineToPoint: TOP_LEFT(0.00000000, 1.52866483)];
-    [path addCurveToPoint: TOP_LEFT(0.06549600, 0.66993397) controlPoint1: TOP_LEFT(0.00000000, 1.08849299) controlPoint2: TOP_LEFT(0.00000000, 0.86840701)];
-    [path addLineToPoint: TOP_LEFT(0.07491100, 0.63149399)];
-    [path addCurveToPoint: TOP_LEFT(0.63149399, 0.07491100) controlPoint1: TOP_LEFT(0.16906001, 0.37282401) controlPoint2: TOP_LEFT(0.37282401, 0.16906001)];
-    [path addCurveToPoint: TOP_LEFT(1.52866483, 0.00000000) controlPoint1: TOP_LEFT(0.86840701, 0.00000000) controlPoint2: TOP_LEFT(1.08849299, 0.00000000)];
-    [path closePath];
-    return path;
-}
-
-@end

+ 0 - 71
Libraries external/TOPasscodeViewController/Supporting/TOPasscodeViewControllerConstants.h

@@ -1,71 +0,0 @@
-//
-//  TOPasscodeViewControllerConstants.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-/* The visual style of the asscode view controller */
-typedef NS_ENUM(NSInteger, TOPasscodeViewStyle) {
-    TOPasscodeViewStyleTranslucentDark,
-    TOPasscodeViewStyleTranslucentLight,
-    TOPasscodeViewStyleOpaqueDark,
-    TOPasscodeViewStyleOpaqueLight
-};
-
-/* The visual style of the passcode settings view controller. */
-typedef NS_ENUM(NSInteger, TOPasscodeSettingsViewStyle) {
-    TOPasscodeSettingsViewStyleLight,
-    TOPasscodeSettingsViewStyleDark
-};
-
-/* Depending on the amount of horizontal space, the sizing of the elements */
-typedef NS_ENUM(NSInteger, TOPasscodeViewContentSize) {
-    TOPasscodeViewContentSizeDefault = 414, // Default, 414 points and above (6 Plus, all remaining iPad sizes)
-    TOPasscodeViewContentSizeMedium = 375, // Greater or equal to 375 points: iPhone 6 / iPad Pro 1/4 split mode
-    TOPasscodeViewContentSizeSmall  = 320  // Greater or equal to 320 points: iPhone SE / iPad 1/4 split mode
-};
-
-/* The types of passcodes that may be used. */
-typedef NS_ENUM(NSInteger, TOPasscodeType) {
-    TOPasscodeTypeFourDigits,           // 4 Numbers
-    TOPasscodeTypeSixDigits,            // 6 Numbers
-    TOPasscodeTypeCustomNumeric,        // Any length of numbers
-    TOPasscodeTypeCustomAlphanumeric    // Any length of characters
-};
-
-/* The type of biometrics this controller can handle */
-typedef NS_ENUM(NSInteger, TOPasscodeBiometryType) {
-    TOPasscodeBiometryTypeTouchID,
-    TOPasscodeBiometryTypeFaceID
-};
-
-static inline BOOL TOPasscodeViewStyleIsTranslucent(TOPasscodeViewStyle style) {
-    return style <= TOPasscodeViewStyleTranslucentLight;
-}
-
-static inline BOOL TOPasscodeViewStyleIsDark(TOPasscodeViewStyle style) {
-    return style < TOPasscodeViewStyleTranslucentLight || style == TOPasscodeViewStyleOpaqueDark;
-}
-
-static inline NSString *TOPasscodeBiometryTitleForType(TOPasscodeBiometryType type) {
-    switch (type) {
-        case TOPasscodeBiometryTypeFaceID: return NSLocalizedString(@"Face ID", @"");
-        default: return NSLocalizedString(@"Touch ID", @"");
-    }
-}

+ 0 - 108
Libraries external/TOPasscodeViewController/TOPasscodeSettingsViewController.h

@@ -1,108 +0,0 @@
-//
-//  TOPasscodeSettingsViewController.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-#import "TOPasscodeViewControllerConstants.h"
-
-@class TOPasscodeSettingsViewController;
-
-typedef NS_ENUM(NSInteger, TOPasscodeSettingsViewState) {
-    TOPasscodeSettingsViewStateEnterCurrentPasscode,
-    TOPasscodeSettingsViewStateEnterNewPasscode,
-    TOPasscodeSettingsViewStateConfirmNewPasscode
-};
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A delegate object in charge of validating and recording the passcodes entered by the user.
- */
-@protocol TOPasscodeSettingsViewControllerDelegate <NSObject>
-
-@optional
-
-/** Called when the user was prompted to input their current passcode.
- Return YES if passcode was right and NO otherwise.
-
- Returning NO will cause a warning label to appear
- */
-- (BOOL)passcodeSettingsViewController:(TOPasscodeSettingsViewController *)passcodeSettingsViewController
-             didAttemptCurrentPasscode:(NSString *)passcode;
-
-/** Called when the user has successfully set a new passcode. At this point, you should save over
-    the old passcode with the new one. */
-- (void)passcodeSettingsViewController:(TOPasscodeSettingsViewController *)passcodeSettingsViewController
-                didChangeToNewPasscode:(NSString *)passcode ofType:(TOPasscodeType)type;
-
-@end
-
-// ----------------------------------------------------------------------
-
-/**
- A standard system-styled view controller that users can use to change the passcode
- that they will need to enter for the main passcode view controller.
-
- This controller allows requiring the user to enter their previous passcode in first,
- and has passcode validation by requiring them to enter the new passcode twice.
- */
-
-@interface TOPasscodeSettingsViewController : UIViewController
-
-/** Delegate event for controlling and responding to the behavior of this controller */
-@property (nonatomic, weak, nullable) id<TOPasscodeSettingsViewControllerDelegate> delegate;
-
-/** The current state of the controller (confirming old passcode or creating a new one) */
-@property (nonatomic, assign) TOPasscodeSettingsViewState state;
-
-/** Set the visual style of the view controller (light or dark) */
-@property (nonatomic, assign) TOPasscodeSettingsViewStyle style;
-
-/** The input type of the passcode */
-@property (nonatomic, assign) TOPasscodeType passcodeType;
-
-/** The number of incorrect passcode attempts the user has made. Use this property to decide when to disable input. */
-@property (nonatomic, assign) NSInteger failedPasscodeAttemptCount;
-
-/** Before setting a new passcode, show a UI to validate the existing passcode. (Default is NO) */
-@property (nonatomic, assign) BOOL requireCurrentPasscode;
-
-/** If set, the view controller will disable input until this date time has been reached */
-@property (nonatomic, strong, nullable) NSDate *disabledInputDate;
-
-/*
- Create a new instance with the desird light or dark style
-
- @param style The visual style of the view controller
- */
-- (instancetype)initWithStyle:(TOPasscodeSettingsViewStyle)style;
-
-/*
- Changes the passcode type and animates if required
-
- @param passcodeType Change the type of passcode to enter.
- @param animated Play a crossfade animation.
- */
-- (void)setPasscodeType:(TOPasscodeType)passcodeType animated:(BOOL)animated;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 612
Libraries external/TOPasscodeViewController/TOPasscodeSettingsViewController.m

@@ -1,612 +0,0 @@
-//
-//  TOPasscodeSettingsViewController.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeSettingsViewController.h"
-#import "TOPasscodeInputField.h"
-#import "TOPasscodeSettingsKeypadView.h"
-#import "TOPasscodeSettingsWarningLabel.h"
-
-const CGFloat kTOPasscodeSettingsLabelInputSpacing = 15.0f;
-const CGFloat kTOPasscodeSettingsOptionsButtonOffset = 15.0f;
-const CGFloat kTOPasscodeKeypadMaxSizeRatio = 0.40f;
-const CGFloat kTOPasscodeKeypadMinHeight = 165.0f;
-const CGFloat kTOPasscodeKeypadMaxHeight = 330.0f;
-
-@interface TOPasscodeSettingsViewController ()
-
-@property (nonatomic, copy) NSString *potentialPasscode;
-
-/* Layout Calculations */
-@property (nonatomic, assign) CGFloat verticalMidPoint;
-@property (nonatomic, assign) CGRect keyboardFrame;
-@property (nonatomic, readonly) CGRect contentOverlapFrame; // Either the keypad or the system keyboard
-
-/* Views */
-@property (nonatomic, strong) UIView *containerView;
-@property (nonatomic, strong) UILabel *titleLabel;
-@property (nonatomic, strong) UILabel *errorLabel;
-@property (nonatomic, strong) UIButton *optionsButton;
-@property (nonatomic, strong) TOPasscodeInputField *inputField;
-@property (nonatomic, strong) TOPasscodeSettingsKeypadView *keypadView;
-@property (nonatomic, strong) TOPasscodeSettingsWarningLabel *warningLabel;
-
-/* Bar Items */
-@property (nonatomic, strong) UIBarButtonItem *nextBarButtonItem;
-@property (nonatomic, strong) UIBarButtonItem *doneBarButtonItem;
-
-@end
-
-@implementation TOPasscodeSettingsViewController
-
-#pragma mark - Object Creation -
-
-- (instancetype)initWithStyle:(TOPasscodeSettingsViewStyle)style
-{
-    if (self = [self initWithNibName:nil bundle:nil]) {
-        _style = style;
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
-    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (void)setUp
-{
-    _failedPasscodeAttemptCount = 0;
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
-}
-
-- (void)dealloc
-{
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillChangeFrameNotification object:nil];
-}
-
-#pragma mark - View Set-up -
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-
-    __weak typeof(self) weakSelf = self;
-
-    self.title = NSLocalizedString(@"Enter Passcode", @"");
-
-    // Create container view
-    self.containerView = [[UIView alloc] initWithFrame:CGRectZero];
-    self.containerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin
-                                            | UIViewAutoresizingFlexibleBottomMargin;
-    [self.view addSubview:self.containerView];
-
-    // Create title label
-    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
-    self.titleLabel.font = [UIFont systemFontOfSize:17.0f];
-    self.titleLabel.textAlignment = NSTextAlignmentCenter;
-    self.titleLabel.textColor = [UIColor blackColor];
-    self.titleLabel.text = @"Enter your passcode";
-    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
-    [self.titleLabel sizeToFit];
-    [self.containerView addSubview:self.titleLabel];
-
-    // Create number view
-    self.inputField = [[TOPasscodeInputField alloc] init];
-    self.inputField.tintColor = [UIColor blackColor];
-    self.inputField.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
-    self.inputField.passcodeCompletedHandler = ^(NSString *passcode) { [weakSelf inputViewDidCompletePasscode:passcode]; };
-    [self.inputField sizeToFit];
-    [self.containerView addSubview:self.inputField];
-
-    // Create keypad view
-    self.keypadView = [[TOPasscodeSettingsKeypadView alloc] initWithFrame:CGRectZero];
-    self.keypadView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
-    [self.view addSubview:self.keypadView];
-
-    // Create warning label view
-    self.warningLabel = [[TOPasscodeSettingsWarningLabel alloc] initWithFrame:CGRectZero];
-    self.warningLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
-    self.warningLabel.hidden = YES;
-    [self.warningLabel sizeToFit];
-    [self.containerView addSubview:self.warningLabel];
-
-    // Create error label view
-    self.errorLabel = [[UILabel alloc] initWithFrame:CGRectZero];
-    self.errorLabel.text = NSLocalizedString(@"Passcodes didn't match. Try again.", @"");
-    self.errorLabel.textAlignment = NSTextAlignmentCenter;
-    self.errorLabel.font = [UIFont systemFontOfSize:15.0f];
-    self.errorLabel.numberOfLines = 0;
-    self.errorLabel.hidden = YES;
-    [self.errorLabel sizeToFit];
-    [self.containerView addSubview:self.errorLabel];
-
-    // Create Options button
-    self.optionsButton = [UIButton buttonWithType:UIButtonTypeSystem];
-    [self.optionsButton setTitle:NSLocalizedString(@"Passcode Options", @"") forState:UIControlStateNormal];
-    self.optionsButton.titleLabel.font = [UIFont systemFontOfSize:15.0f];
-    [self.optionsButton sizeToFit];
-    self.optionsButton.hidden = true;
-    [self.optionsButton addTarget:self action:@selector(optionsCodeButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:self.optionsButton];
-
-    // Add callbacks for the keypad view
-    self.keypadView.numberButtonTappedHandler = ^(NSInteger number) {
-        NSString *numberString = [NSString stringWithFormat:@"%ld", (long)number];
-        [weakSelf.inputField appendPasscodeCharacters:numberString animated:NO];
-    };
-
-    self.keypadView.deleteButtonTappedHandler = ^{ [weakSelf.inputField deletePasscodeCharactersOfCount:1 animated:NO]; };
-
-    // Set height of the container view (This will never change)
-    CGRect frame = self.containerView.frame;
-    frame.size.width = self.view.bounds.size.width;
-    frame.size.height = CGRectGetHeight(self.titleLabel.frame) + CGRectGetHeight(self.inputField.frame)
-                            + CGRectGetHeight(self.warningLabel.frame) + (kTOPasscodeSettingsLabelInputSpacing * 2.0f);
-    self.containerView.frame = CGRectIntegral(frame);
-
-    //Work out the vertical offset of the container view assuming the warning label doesn't count
-    self.verticalMidPoint = CGRectGetHeight(self.titleLabel.frame) + CGRectGetHeight(self.inputField.frame)
-                            + kTOPasscodeSettingsLabelInputSpacing;
-    self.verticalMidPoint *= 0.5f;
-
-    // Bar button items
-    self.nextBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Next", @"") style:UIBarButtonItemStylePlain target:self action:@selector(nextButtonTapped:)];
-    self.doneBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneButtonTapped:)];
-
-    // Apply light/dark mode
-    [self applyThemeForStyle:self.style];
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-
-    self.state = self.requireCurrentPasscode ? TOPasscodeSettingsViewStateEnterCurrentPasscode : TOPasscodeSettingsViewStateEnterNewPasscode;
-    [self updateContentForState:self.state type:self.passcodeType animated:NO];
-}
-
-#pragma mark - View Update -
-
-- (void)updateContentForState:(TOPasscodeSettingsViewState)state type:(TOPasscodeType)type animated:(BOOL)animated
-{
-    BOOL variableSizePasscode = (type >= TOPasscodeTypeCustomNumeric);
-
-    // Update the visibility of the options button
-    //self.optionsButton.hidden = !(state == TOPasscodeSettingsViewStateEnterNewPasscode);
-
-    // Clear the input view
-    self.inputField.passcode = nil;
-
-    // Disable the input view
-    self.inputField.enabled = NO;
-
-    //Update the warning label
-    [self updateWarningLabelForState:state];
-
-    // Change the input view if needed
-    if (!variableSizePasscode) {
-        self.inputField.style = TOPasscodeInputFieldStyleFixed;
-        self.inputField.fixedInputView.length = (self.passcodeType == TOPasscodeTypeSixDigits) ? 6 : 4;
-    }
-    else {
-        self.inputField.style = TOPasscodeInputFieldStyleVariable;
-    }
-
-    // Update text depending on state
-    switch (state) {
-        case TOPasscodeSettingsViewStateEnterCurrentPasscode:
-            self.titleLabel.text = NSLocalizedString(@"Enter your passcode", @"");
-            self.navigationItem.rightBarButtonItem = variableSizePasscode ? self.nextBarButtonItem : nil;
-            if (@available(iOS 9.0, *)) {
-                self.inputField.returnKeyType = UIReturnKeyContinue;
-            }
-            else {
-                self.inputField.returnKeyType = UIReturnKeyNext;
-            }
-            break;
-        case TOPasscodeSettingsViewStateEnterNewPasscode:
-            self.titleLabel.text = NSLocalizedString(@"Enter a new passcode", @"");
-            self.navigationItem.rightBarButtonItem = variableSizePasscode ? self.nextBarButtonItem : nil;
-            if (@available(iOS 9.0, *)) {
-                self.inputField.returnKeyType = UIReturnKeyContinue;
-            }
-            else {
-                self.inputField.returnKeyType = UIReturnKeyNext;
-            }
-            break;
-        case TOPasscodeSettingsViewStateConfirmNewPasscode:
-            self.titleLabel.text = NSLocalizedString(@"Confirm new passcode", @"");
-            self.navigationItem.rightBarButtonItem = variableSizePasscode ? self.doneBarButtonItem : nil;
-            self.inputField.returnKeyType = UIReturnKeyDone;
-            break;
-    }
-
-    CGRect frame = CGRectZero;
-
-    // Reload the 'Done' button
-    [self.inputField reloadInputViews];
-
-    // Resize text label to fit new text
-    [self.titleLabel sizeToFit];
-    frame = self.titleLabel.frame;
-    frame.origin.x = (CGRectGetWidth(self.containerView.frame) - CGRectGetWidth(frame)) * 0.5f;
-    self.titleLabel.frame = CGRectIntegral(frame);
-
-    // Resize passcode view
-    [self.inputField sizeToFit];
-    frame = self.inputField.frame;
-    frame.origin.x = (CGRectGetWidth(self.containerView.frame) - CGRectGetWidth(frame)) * 0.5f;
-    self.inputField.frame = CGRectIntegral(frame);
-
-    // If we're the alphanumeric type, present the keyboard
-    if (type == TOPasscodeTypeCustomAlphanumeric) {
-        self.inputField.enabled = YES;
-        [self.inputField becomeFirstResponder];
-    }
-    else {
-        if (self.inputField.isFirstResponder) {
-            [self.inputField resignFirstResponder];
-        }
-    }
-
-    // If not animated, force a blanket re-layout
-    if (!animated) {
-        [self viewDidLayoutSubviews];
-        return;
-    }
-
-    // If animated, perform the animation
-    [UIView animateWithDuration:0.3f animations:^{
-        [self viewDidLayoutSubviews];
-    }];
-}
-
-- (void)updateWarningLabelForState:(TOPasscodeSettingsViewState)state
-{
-    BOOL confirmingPasscode = state == TOPasscodeSettingsViewStateEnterCurrentPasscode;
-
-    // Update the warning label
-    self.warningLabel.hidden = !(confirmingPasscode && self.failedPasscodeAttemptCount > 0);
-    self.warningLabel.numberOfWarnings = self.failedPasscodeAttemptCount;
-
-    CGRect frame = self.warningLabel.frame;
-    frame.origin.x = (CGRectGetWidth(self.view.frame) - frame.size.width) * 0.5f;
-    self.warningLabel.frame = frame;
-}
-
-- (void)transitionToState:(TOPasscodeSettingsViewState)state animated:(BOOL)animated
-{
-    // Preserve the current view state
-    UIView *snapshot = nil;
-
-    BOOL reverseDirection = state < self.state;
-
-    // If animated, take a snapshot of the current container view
-    if (animated) {
-        snapshot = [self.containerView snapshotViewAfterScreenUpdates:NO];
-        snapshot.frame = self.containerView.frame;
-        [self.view addSubview:snapshot];
-    }
-
-    self.errorLabel.hidden = YES;
-
-    // Update the layout for the new state
-    self.state = state;
-
-    // Cancel out now if we're not animating
-    if (!animated) {
-        return;
-    }
-
-    // Place the live container off screen to the right
-    CGFloat multiplier = reverseDirection ? -1.0f : 1.0f;
-    self.containerView.frame = CGRectOffset(self.containerView.frame, self.view.frame.size.width * multiplier, 0.0f);
-
-    // Update the options button alpha depending on transition state
-    //self.optionsButton.hidden = NO;
-    self.optionsButton.alpha = (state == TOPasscodeSettingsViewStateEnterNewPasscode) ? 0.0f : 1.0f;
-
-    // Perform an animation where the snapshot slides off, and the new container slides in
-    id animationBlock = ^{
-        snapshot.frame = CGRectOffset(snapshot.frame, -self.view.frame.size.width * multiplier, 0.0f);
-        self.containerView.frame = CGRectOffset(self.containerView.frame, -self.view.frame.size.width * multiplier, 0.0f);
-        self.optionsButton.alpha = (state == TOPasscodeSettingsViewStateEnterNewPasscode) ? 1.0f : 0.0f;
-    };
-
-    // Clean up by removing the snapshot view
-    id completionBlock = ^(BOOL complete) {
-        [snapshot removeFromSuperview];
-    };
-
-    // Perform the animation
-    [UIView animateWithDuration:0.4f
-                          delay:0.0f
-         usingSpringWithDamping:1.0f
-          initialSpringVelocity:0.7f
-                        options:0
-                     animations:animationBlock
-                     completion:completionBlock];
-}
-
-- (void)viewDidLayoutSubviews
-{
-    [super viewDidLayoutSubviews];
-
-    CGSize viewSize = self.view.bounds.size;
-
-    // Layout the keypad view
-    CGRect frame = self.keypadView.frame;
-    frame.size.height = viewSize.height * kTOPasscodeKeypadMaxSizeRatio;
-    frame.size.height = MAX(frame.size.height, kTOPasscodeKeypadMinHeight);
-    frame.size.height = MIN(frame.size.height, kTOPasscodeKeypadMaxHeight);
-    frame.size.width = viewSize.width;
-    frame.origin.y = viewSize.height;
-    if (self.passcodeType != TOPasscodeTypeCustomAlphanumeric) {
-        frame.origin.y -= frame.size.height;
-    }
-
-    self.keypadView.frame = CGRectIntegral(frame);
-
-    BOOL horizontalLayout = frame.size.height < kTOPasscodeKeypadMinHeight + FLT_EPSILON;
-    BOOL animated = ([self.view.layer animationForKey:@"bounds.size"] != nil);
-    [self.keypadView setButtonLabelHorizontalLayout:horizontalLayout animated:animated];
-
-    CGFloat topContentHeight = self.topLayoutGuide.length;
-
-    // Layout the container view
-    frame = self.containerView.frame;
-    frame.origin.y = (((viewSize.height - (topContentHeight + self.contentOverlapFrame.size.height))) * 0.5f) - self.verticalMidPoint;
-    frame.origin.y += topContentHeight;
-    self.containerView.frame = CGRectIntegral(frame);
-
-    // Layout the passcode options button
-    frame = self.optionsButton.frame;
-    frame.origin.y = CGRectGetMinY(self.contentOverlapFrame) - kTOPasscodeSettingsOptionsButtonOffset - CGRectGetHeight(frame);
-    frame.origin.x = (CGRectGetWidth(self.view.frame) - CGRectGetWidth(frame)) * 0.5f;
-    self.optionsButton.frame = frame;
-
-    // Set frame of title label
-    frame = self.titleLabel.frame;
-    frame.origin.x = (CGRectGetWidth(self.view.frame) - CGRectGetWidth(frame)) * 0.5f;
-    self.titleLabel.frame = CGRectIntegral(frame);
-
-    // Set frame of number pad
-    frame = self.inputField.frame;
-    frame.origin.x = (CGRectGetWidth(self.view.frame) - CGRectGetWidth(frame)) * 0.5f;
-    frame.origin.y = (CGRectGetHeight(self.titleLabel.frame) + kTOPasscodeSettingsLabelInputSpacing);
-    self.inputField.frame = CGRectIntegral(frame);
-
-    // Set the frame for the warning view
-    frame = self.warningLabel.frame;
-    frame.origin.x = (CGRectGetWidth(self.view.frame) - CGRectGetWidth(frame)) * 0.5f;
-    frame.origin.y = CGRectGetMaxY(self.inputField.frame) + kTOPasscodeSettingsLabelInputSpacing;
-    self.warningLabel.frame = CGRectIntegral(frame);
-
-    // Set the frame of the error view
-    frame = self.errorLabel.frame;
-    frame.size = [self.errorLabel sizeThatFits:CGSizeMake(300.0f, CGFLOAT_MAX)];
-    frame.origin.y = CGRectGetMaxY(self.inputField.frame) + kTOPasscodeSettingsLabelInputSpacing;
-    frame.origin.x = (CGRectGetWidth(self.containerView.frame) - CGRectGetWidth(frame)) * 0.5f;
-    self.errorLabel.frame = CGRectIntegral(frame);
-}
-
-- (void)applyThemeForStyle:(TOPasscodeSettingsViewStyle)style
-{
-    BOOL isDark = (style == TOPasscodeSettingsViewStyleDark);
-
-    // Set background color
-    UIColor *backgroundColor;
-    if (isDark) {
-        backgroundColor = [UIColor colorWithWhite:0.15f alpha:1.0f];
-    }
-    else {
-        backgroundColor = [UIColor colorWithRed:235.0f/255.0f green:235.0f/255.0f blue:241.0f/255.0f alpha:1.0f];
-    }
-    self.view.backgroundColor = backgroundColor;
-
-    // Set the style of the keypad view
-    self.keypadView.style = style;
-
-    // Set the color for the input content
-    UIColor *inputColor = isDark ? [UIColor whiteColor] : [UIColor blackColor];
-
-    // Set the label style
-    self.titleLabel.textColor = inputColor;
-
-    // Set the number input tint
-    self.inputField.tintColor = inputColor;
-
-    // Set the tint color of the incorrect warning label
-    UIColor *warningColor = nil;
-    if (isDark) {
-        warningColor = [UIColor colorWithRed:214.0f/255.0f green:63.0f/255.0f blue:63.0f/255.0f alpha:1.0f];
-    }
-    else {
-        warningColor = [UIColor colorWithRed:214.0f/255.0f green:63.0f/255.0f blue:63.0f/255.0f alpha:1.0f];
-    }
-}
-
-#pragma mark - Data Management -
-- (void)inputViewDidCompletePasscode:(NSString *)passcode
-{
-    switch (self.state) {
-        case TOPasscodeSettingsViewStateEnterCurrentPasscode:
-            [self validateCurrentPasscodeAttemptWithPasscode:passcode];
-            break;
-        case TOPasscodeSettingsViewStateEnterNewPasscode:
-            [self didReceiveNewPasscode:passcode];
-            break;
-        case TOPasscodeSettingsViewStateConfirmNewPasscode:
-            [self confirmNewPasscode:passcode];
-            break;
-    }
-}
-
-- (void)validateCurrentPasscodeAttemptWithPasscode:(NSString *)passcode
-{
-    if (![self.delegate respondsToSelector:@selector(passcodeSettingsViewController:didAttemptCurrentPasscode:)]) {
-        return;
-    }
-
-    BOOL correct = [self.delegate passcodeSettingsViewController:self didAttemptCurrentPasscode:passcode];
-    if (!correct) {
-        [self.inputField resetPasscodeAnimated:YES playImpact:YES];
-        self.failedPasscodeAttemptCount++;
-    }
-    else {
-        [self transitionToState:TOPasscodeSettingsViewStateEnterNewPasscode animated:YES];
-    }
-}
-
-- (void)didReceiveNewPasscode:(NSString *)passcode
-{
-    self.potentialPasscode = passcode;
-    [self transitionToState:TOPasscodeSettingsViewStateConfirmNewPasscode animated:YES];
-}
-
-- (void)confirmNewPasscode:(NSString *)passcode
-{
-    if (![passcode isEqualToString:self.potentialPasscode]) {
-        [self transitionToState:TOPasscodeSettingsViewStateEnterNewPasscode animated:YES];
-        self.errorLabel.hidden = NO;
-        return;
-    }
-
-    if (![self.delegate respondsToSelector:@selector(passcodeSettingsViewController:didChangeToNewPasscode:ofType:)]) {
-        return;
-    }
-
-    [self.delegate passcodeSettingsViewController:self didChangeToNewPasscode:self.potentialPasscode ofType:self.passcodeType];
-}
-
-#pragma mark - System Keyboard Handling -
-- (void)keyboardWillChangeFrame:(NSNotification *)notification
-{
-    self.keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
-    [self viewDidLayoutSubviews];
-}
-
-- (CGRect)contentOverlapFrame
-{
-    if (self.passcodeType < TOPasscodeTypeCustomAlphanumeric) {
-        return self.keypadView.frame;
-    }
-
-    // Work out where our view is in relation to the screen
-    UIWindow *window = self.view.window;
-    CGRect viewFrame = [self.view.superview convertRect:self.view.frame toView:window];
-
-    CGFloat overlap = CGRectGetMaxY(viewFrame) - CGRectGetMinY(self.keyboardFrame);
-
-    CGRect overlapFrame = self.keyboardFrame;
-    overlapFrame.origin.y = MIN(viewFrame.size.height - overlap, viewFrame.size.height);
-    overlapFrame.size.height = MAX(overlap, 0.0f);
-    return overlapFrame;
-}
-
-#pragma mark - Button Callbacks -
-
-- (void)optionsCodeButtonTapped:(id)sender
-{
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
-    UIAlertActionStyle style = UIAlertActionStyleDefault;
-
-    __weak typeof(self) weakSelf = self;
-
-    NSArray *types = @[@(TOPasscodeTypeFourDigits),
-                       @(TOPasscodeTypeSixDigits),
-                       @(TOPasscodeTypeCustomNumeric),
-                       @(TOPasscodeTypeCustomAlphanumeric)
-                      ];
-
-
-    NSArray *titles = @[NSLocalizedString(@"4-Digit Numeric Code", @""),
-                        NSLocalizedString(@"6-Digit Numeric Code", @""),
-                        NSLocalizedString(@"Custom Numeric Code", @""),
-                        NSLocalizedString(@"Custom Alphanumeric Code", @"")];
-
-    // Add all the buttons
-    for (NSInteger i = 0; i < types.count; i++) {
-        TOPasscodeType type = [types[i] integerValue];
-        if (type == self.passcodeType) { continue; }
-
-        id handler = ^(UIAlertAction *action) {
-            [weakSelf setPasscodeType:type];
-        };
-        [alertController addAction:[UIAlertAction actionWithTitle:titles[i] style:style handler:handler]];
-    }
-
-    // Cancel button 
-    [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"") style:UIAlertActionStyleCancel handler:nil]];
-
-    alertController.modalPresentationStyle = UIModalPresentationPopover;
-    alertController.popoverPresentationController.sourceView = self.optionsButton;
-    alertController.popoverPresentationController.sourceRect = self.optionsButton.bounds;
-    alertController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionDown | UIPopoverArrowDirectionUp;
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
-- (void)nextButtonTapped:(id)sender
-{
-    [self inputViewDidCompletePasscode:self.inputField.passcode];
-}
-
-- (void)doneButtonTapped:(id)sender
-{
-    [self inputViewDidCompletePasscode:self.inputField.passcode];
-}
-
-#pragma mark - Accessors -
-- (void)setPasscodeType:(TOPasscodeType)passcodeType
-{
-    [self setPasscodeType:passcodeType animated:NO];
-}
-
-- (void)setPasscodeType:(TOPasscodeType)passcodeType animated:(BOOL)animated
-{
-    if (_passcodeType == passcodeType) { return; }
-    _passcodeType = passcodeType;
-
-    [self updateContentForState:self.state type:_passcodeType animated:animated];
-}
-
-- (void)setState:(TOPasscodeSettingsViewState)state
-{
-    if (_state == state) { return; }
-    _state = state;
-
-    [self updateContentForState:_state type:self.passcodeType animated:NO];
-}
-
-- (void)setFailedPasscodeAttemptCount:(NSInteger)failedPasscodeAttemptCount
-{
-    if (_failedPasscodeAttemptCount == failedPasscodeAttemptCount) { return; }
-    _failedPasscodeAttemptCount = failedPasscodeAttemptCount;
-    [self updateWarningLabelForState:self.state];
-}
-
-@end

+ 0 - 164
Libraries external/TOPasscodeViewController/TOPasscodeViewController.h

@@ -1,164 +0,0 @@
-//
-//  TOPasscodeViewController.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-#import "TOPasscodeViewControllerConstants.h"
-#import "TOPasscodeView.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class TOPasscodeViewController;
-
-/**
- A delegate object in charge of validating the passcodes that the user has entered into the passcode
- view controller.
- */
-@protocol TOPasscodeViewControllerDelegate <NSObject>
-
-@optional
-
-/** 
- Return YES if the user entered the expected PIN code. Return NO if it was incorrect.
- (For security reasons, it is safer to fetch the saved PIN code only when this method is called, and
-  then discard it immediately. This is why the view controller does not directly store it.)
-*/
-- (BOOL)passcodeViewController:(TOPasscodeViewController *)passcodeViewController isCorrectCode:(NSString *)code;
-
-/** The user tapped the 'Cancel' button. Any dismissing of confidential content should be done in here. */
-- (void)didTapCancelInPasscodeViewController:(TOPasscodeViewController *)passcodeViewController;
-
-/** The user successfully entered the correct code, as validated by `isCorrectCode:` */
-- (void)didInputCorrectPasscodeInPasscodeViewController:(TOPasscodeViewController *)passcodeViewController;
-
-/** When available, the user tapped the 'Touch ID' button, or the view controller itself automatically initiated
-    the Touch ID request on display. This method is where you should implement your
-    own Touch ID validation logic. For security reasons, this controller does not implement the Touch ID logic itself. */
-
-- (void)didPerformBiometricValidationRequestInPasscodeViewController:(TOPasscodeViewController *)passcodeViewController;
-
-/** Called when the pin view was resized as a result of the view controller being resized.
-    You can use this to resize your custom header view if necessary.
- */
-- (void)passcodeViewController:(TOPasscodeViewController *)passcodeViewController didResizePasscodeViewToWidth:(CGFloat)width;
-
-@end
-
-
-/**
- A view controller that displays an interface for entering a user passcode.
- It may be presented modally over another view controller, requiring the user to enter
- the passcode correctly before they are able to proceed inside the application.
- */
-@interface TOPasscodeViewController : UIViewController
-
-/** A delegate object, in charge of verifying the PIN code entered by the user */
-@property (nonatomic, weak, nullable) id<TOPasscodeViewControllerDelegate> delegate;
-
-/** The base style of the PIN view controller. Can be configured further. */
-@property (nonatomic, assign) TOPasscodeViewStyle style;
-
-/** The type of passcode that is expected to be entered. */
-@property (nonatomic, readonly) TOPasscodeType passcodeType;
-
-/** Will show a 'Touch ID' or 'Face ID' (depending on `biometricType`) button if the user is allowed to log in that way. (Default is NO) */
-@property (nonatomic, assign) BOOL allowBiometricValidation;
-
-/** Will show a default 'Cancel' button if rightAccessoryButton is not set. (Default is YES) */
-@property (nonatomic, assign) BOOL allowCancel;
-
-/** Set the type of biometrics for this device to update the title of the biometrics button properly. */
-@property (nonatomic, assign) TOPasscodeBiometryType biometryType;
-
-/** If biometrics are available, automatically ask for it upon presentation (Default is NO) */
-@property (nonatomic, assign) BOOL automaticallyPromptForBiometricValidation;
-
-/** Optionally change the color of the title text label. */
-@property (nonatomic, strong, nullable) UIColor *titleLabelColor;
-
-/** Optionally change the tint color of the UI element that indicates input progress (eg the row of circles) */
-@property (nonatomic, strong, nullable) UIColor *inputProgressViewTintColor;
-
-/** Optionally enable or disable showing the lettering label of all keypad circle buttons. **/
-@property (nonatomic, assign) BOOL keypadButtonShowLettering;
-
-/** If the style isn't translucent, changes the tint color of the keypad circle button outlines. */
-@property (nonatomic, strong, nullable) UIColor *keypadButtonBackgroundTintColor;
-
-/** The color of the text elements in each keypad button */
-@property (nonatomic, strong, nullable) UIColor *keypadButtonTextColor;
-
-/** Optionally, the text color of the keypad button text when tapped. Animates back to the base color. */
-@property (nonatomic, strong, nullable) UIColor *keypadButtonHighlightedTextColor;
-
-/** The tint button of the accessory button views at the bottom of the keypad (ie 'Cance' etc) */
-@property (nonatomic, strong, nullable) UIColor *accessoryButtonTintColor;
-
-/** Controls the transluceny of the PIN background when the style has been set to translucent. */
-@property (nonatomic, readonly) UIVisualEffectView *backgroundEffectView;
-
-/** Opaque, background view when the style is opaque */
-@property (nonatomic, readonly) UIView *backgroundView;
-
-/** The keypad and accessory views that are displayed in the center of this view */
-@property (nonatomic, readonly) TOPasscodeView *passcodeView;
-
-/** The Touch ID button, visible if biometrics is enabled and `leftAccessoryButton` is nil. */
-@property (nonatomic, readonly) UIButton *biometricButton;
-
-/** The Cancel, visible if `rightAccessoryButton` is nil. */
-@property (nonatomic, readonly) UIButton *cancelButton;
-
-/** The left accessory button. Setting this will override the 'Touch ID' button. */
-@property (nonatomic, strong, nullable) UIButton *leftAccessoryButton;
-
-/** The right accessory button. Setting this will override the 'Cancel' button. */
-@property (nonatomic, strong, nullable) UIButton *rightAccessoryButton;
-
-/** Whether all of the content views are hidden or not, but the background translucent view remains.
-     Useful for obscuring the content while the app is suspended. */
-@property (nonatomic, assign) BOOL contentHidden;
-
-/**
- Create a new instance of this view controller with the preset style and passcode type.
-
- @param style The visual style of the view controller (light/translucent)
- @param type The type of passcode to enter (6-digit/numeric)
- */
-- (instancetype)initWithStyle:(TOPasscodeViewStyle)style passcodeType:(TOPasscodeType)type;
-
-/**
- Hide everything except the background translucency view.
-
- @param hidden Whether the content is hidden or not.
- @param animated The content will play a crossfade animation.
- */
-- (void)setContentHidden:(BOOL)hidden animated:(BOOL)animated;
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-//! Project version number for TOPasscodeViewController.
-FOUNDATION_EXPORT double TOPasscodeViewControllerVersionNumber;
-
-//! Project version string for TOPasscodeViewController.
-FOUNDATION_EXPORT const unsigned char TOPasscodeViewControllerVersionString[];

+ 0 - 688
Libraries external/TOPasscodeViewController/TOPasscodeViewController.m

@@ -1,688 +0,0 @@
-//
-//  TOPasscodeViewController.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeViewController.h"
-#import "TOPasscodeView.h"
-#import "TOPasscodeViewControllerAnimatedTransitioning.h"
-#import "TOPasscodeKeypadView.h"
-#import "TOPasscodeInputField.h"
-
-@interface TOPasscodeViewController () <UIViewControllerTransitioningDelegate>
-
-/* State */
-@property (nonatomic, assign, readwrite) TOPasscodeType passcodeType;
-@property (nonatomic, assign) CGFloat keyboardHeight;
-@property (nonatomic, assign) BOOL passcodeSuccess;
-@property (nonatomic, readonly) UIView *leftButton;
-@property (nonatomic, readonly) UIView *rightButton;
-
-/* Views */
-@property (nonatomic, strong, readwrite) UIVisualEffectView *backgroundEffectView;
-@property (nonatomic, strong, readwrite) UIView *backgroundView;
-@property (nonatomic, strong, readwrite) TOPasscodeView *passcodeView;
-@property (nonatomic, strong, readwrite) UIButton *biometricButton;
-@property (nonatomic, strong, readwrite) UIButton *cancelButton;
-
-
-@end
-
-@implementation TOPasscodeViewController
-
-#pragma mark - Instance Creation -
-
-- (instancetype)initWithStyle:(TOPasscodeViewStyle)style passcodeType:(TOPasscodeType)type
-{
-    if (self = [super initWithNibName:nil bundle:nil]) {
-        _style = style;
-        _passcodeType = type;
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
-    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (void)dealloc
-{
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillChangeFrameNotification object:nil];
-}
-
-#pragma mark - View Setup -
-
-- (void)setUp
-{
-    self.transitioningDelegate = self;
-    self.automaticallyPromptForBiometricValidation = NO;
-    self.allowCancel = YES;
-
-    if (TOPasscodeViewStyleIsTranslucent(self.style)) {
-        self.modalPresentationStyle = UIModalPresentationOverFullScreen;
-    }
-    else {
-        self.modalPresentationStyle = UIModalPresentationFullScreen;
-    }
-
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:)
-                                                     name:UIKeyboardWillChangeFrameNotification object:nil];
-}
-
-- (void)setUpBackgroundEffectViewForStyle:(TOPasscodeViewStyle)style
-{
-    BOOL translucent = TOPasscodeViewStyleIsTranslucent(style);
-
-    // Return if it already exists when it should
-    if (translucent && self.backgroundEffectView) { return; }
-
-    // Return if it doesn't exist when it shouldn't
-    if (!translucent && !self.backgroundEffectView) { return; }
-
-    // Remove it if we're now opaque
-    if (!translucent) {
-        [self.backgroundEffectView removeFromSuperview];
-        self.backgroundEffectView = nil;
-        return;
-    }
-
-    // Create it otherwise
-    UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:[self blurEffectStyleForStyle:style]];
-    self.backgroundEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
-    self.backgroundEffectView.frame = self.view.bounds;
-    self.backgroundEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view insertSubview:self.backgroundEffectView atIndex:0];
-}
-
-- (void)setUpBackgroundViewForStyle:(TOPasscodeViewStyle)style
-{
-    BOOL translucent = TOPasscodeViewStyleIsTranslucent(style);
-
-    if (!translucent && self.backgroundView) { return; }
-
-    if (translucent && !self.backgroundView) { return; }
-
-    if (translucent) {
-        [self.backgroundView removeFromSuperview];
-        self.backgroundView = nil;
-        return;
-    }
-
-    self.backgroundView = [[UIView alloc] initWithFrame:self.view.bounds];
-    self.backgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view insertSubview:self.backgroundView atIndex:0];
-}
-
-- (UIBlurEffectStyle)blurEffectStyleForStyle:(TOPasscodeViewStyle)style
-{
-    switch (self.style) {
-        case TOPasscodeViewStyleTranslucentDark: return UIBlurEffectStyleDark;
-        case TOPasscodeViewStyleTranslucentLight: return UIBlurEffectStyleExtraLight;
-        default: return 0;
-    }
-
-    return 0;
-}
-
-- (void)setUpAccessoryButtons
-{
-    UIFont *buttonFont = [UIFont systemFontOfSize:16.0f];
-    BOOL isPad = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad;
-
-    if (!self.leftAccessoryButton && self.allowBiometricValidation && !self.biometricButton) {
-        self.biometricButton = [UIButton buttonWithType:UIButtonTypeSystem];
-        [self.biometricButton setTitle:TOPasscodeBiometryTitleForType(self.biometryType) forState:UIControlStateNormal];
-        [self.biometricButton addTarget:self action:@selector(accessoryButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-
-        if (isPad) {
-            self.passcodeView.leftButton = self.biometricButton;
-        }
-        else {
-            [self.view addSubview:self.biometricButton];
-        }
-    }
-    else {
-        if (self.leftAccessoryButton) {
-            [self.biometricButton removeFromSuperview];
-            self.biometricButton = nil;
-        }
-    }
-
-    if (!self.rightAccessoryButton && !self.cancelButton) {
-        self.cancelButton = [UIButton buttonWithType:UIButtonTypeSystem];
-        [self.cancelButton setTitle:NSLocalizedString(@"Cancel", @"Cancel") forState:UIControlStateNormal];
-        self.cancelButton.titleLabel.font = buttonFont;
-        [self.cancelButton addTarget:self action:@selector(accessoryButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-        // If cancelling is disabled, we hide the cancel button but we still create it, because it can
-        // transition to backspace after user input.
-        self.cancelButton.hidden = !self.allowCancel;
-        if (isPad) {
-            self.passcodeView.rightButton = self.cancelButton;
-        }
-        else {
-            [self.view addSubview:self.cancelButton];
-        }
-    }
-    else {
-        if (self.rightAccessoryButton) {
-            [self.cancelButton removeFromSuperview];
-            self.cancelButton = nil;
-        }
-    }
-
-    [self updateAccessoryButtonFontsForSize:self.view.bounds.size];
-}
-
-#pragma mark - View Management -
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    self.view.backgroundColor = [UIColor clearColor];
-    self.view.layer.allowsGroupOpacity = NO;
-    [self setUpBackgroundEffectViewForStyle:self.style];
-    [self setUpBackgroundViewForStyle:self.style];
-    [self setUpAccessoryButtons];
-    [self applyThemeForStyle:self.style];
-}
-
-- (void)viewDidAppear:(BOOL)animated
-{
-    [super viewDidAppear:animated];
-
-    // Automatically trigger biometric validation if available
-    if (self.allowBiometricValidation && self.automaticallyPromptForBiometricValidation) {
-        [self accessoryButtonTapped:self.biometricButton];
-    }
-}
-
-- (void)viewDidLayoutSubviews
-{
-    CGSize bounds = self.view.bounds.size;
-    CGSize maxSize = bounds;
-    if (@available(iOS 11.0, *)) {
-        UIEdgeInsets safeAreaInsets = self.view.safeAreaInsets;
-        if (safeAreaInsets.bottom > 0) {
-            maxSize.height -= safeAreaInsets.bottom;
-        }
-        if (safeAreaInsets.left > 0) {
-            maxSize.width -= safeAreaInsets.left;
-        }
-        if (safeAreaInsets.right > 0) {
-            maxSize.width -= safeAreaInsets.right;
-        }
-    }
-    
-    // Resize the pin view to scale to the new size
-    [self.passcodeView sizeToFitSize:maxSize];
-    
-    // Re-center the pin view
-    CGRect frame = self.passcodeView.frame;
-    frame.origin.x = (bounds.width - frame.size.width) * 0.5f;
-    frame.origin.y = ((bounds.height - self.keyboardHeight) - frame.size.height) * 0.5f;
-    self.passcodeView.frame = CGRectIntegral(frame);
-
-    // --------------------------------------------------
-
-    // Update the accessory button sizes
-    [self updateAccessoryButtonFontsForSize:maxSize];
-
-    // Re-layout the accessory buttons
-    [self layoutAccessoryButtonsForSize:maxSize];
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    [self setNeedsStatusBarAppearanceUpdate];
-
-    // Force an initial layout if the view hasn't been presented yet
-    [UIView performWithoutAnimation:^{
-        [self.view setNeedsLayout];
-        [self.view layoutIfNeeded];
-    }];
-
-    // Show the keyboard if we're entering alphanumeric characters
-    if (self.passcodeType == TOPasscodeTypeCustomAlphanumeric) {
-        [self.passcodeView.inputField becomeFirstResponder];
-    }
-}
-
-- (void)viewWillDisappear:(BOOL)animated
-{
-    [super viewWillDisappear:animated];
-
-    // Dismiss the keyboard if it is visible
-    if (self.passcodeView.inputField.isFirstResponder) {
-        [self.passcodeView.inputField resignFirstResponder];
-    }
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle
-{
-    return TOPasscodeViewStyleIsDark(self.style) ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault;
-}
-
-#pragma mark - View Rotations -
-- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
-{
-    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
-
-    // We don't need to do anything special on iPad or if we're using character input
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad || self.passcodeType == TOPasscodeTypeCustomAlphanumeric) { return; }
-
-    // Work out if we need to transition to horizontal
-    BOOL horizontalLayout = size.height < size.width;
-
-    // Perform layout animation
-    [self.passcodeView setHorizontalLayout:horizontalLayout animated:coordinator.animated duration:coordinator.transitionDuration];
-}
-
-#pragma mark - View Styling -
-- (void)applyThemeForStyle:(TOPasscodeViewStyle)style
-{
-    BOOL isDark = TOPasscodeViewStyleIsDark(style);
-
-    // Apply the tint color to the accessory buttons
-    UIColor *accessoryTintColor = self.accessoryButtonTintColor;
-    if (!accessoryTintColor) {
-        accessoryTintColor = isDark ? [UIColor whiteColor] : nil;
-    }
-
-    self.biometricButton.tintColor = accessoryTintColor;
-    self.cancelButton.tintColor = accessoryTintColor;
-    self.leftAccessoryButton.tintColor = accessoryTintColor;
-    self.rightAccessoryButton.tintColor = accessoryTintColor;
-
-    self.backgroundView.backgroundColor = isDark ? [UIColor colorWithWhite:0.1f alpha:1.0f] : [UIColor whiteColor];
-}
-
-- (void)updateAccessoryButtonFontsForSize:(CGSize)size
-{
-    CGFloat width = size.width;
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
-        width = MIN(size.width, size.height);
-    }
-
-    CGFloat pointSize = 17.0f;
-    if (width < TOPasscodeViewContentSizeMedium) {
-        pointSize = 14.0f;
-    }
-    else if (width < TOPasscodeViewContentSizeDefault) {
-        pointSize = 16.0f;
-    }
-
-    UIFont *accessoryFont = [UIFont systemFontOfSize:pointSize];
-
-    self.biometricButton.titleLabel.font = accessoryFont;
-    self.cancelButton.titleLabel.font = accessoryFont;
-    self.leftAccessoryButton.titleLabel.font = accessoryFont;
-    self.rightAccessoryButton.titleLabel.font = accessoryFont;
-}
-
-- (void)verticalLayoutAccessoryButtonsForSize:(CGSize)size
-{
-    CGFloat width = MIN(size.width, size.height);
-
-    CGFloat verticalInset = 54.0f;
-    if (width < TOPasscodeViewContentSizeMedium) {
-        verticalInset = 37.0f;
-    }
-    else if (width < TOPasscodeViewContentSizeDefault) {
-        verticalInset = 43.0f;
-    }
-
-    CGFloat inset = self.passcodeView.keypadButtonInset;
-    CGPoint point = (CGPoint){0.0f, (self.view.bounds.size.height - self.keyboardHeight) - verticalInset};
-    if (@available(iOS 11.0, *)) {
-        UIEdgeInsets safeAreaInsets = self.view.safeAreaInsets;
-        if (safeAreaInsets.bottom > 0) {
-            point.y -= safeAreaInsets.bottom;
-        }
-    }
-
-    if (self.leftButton) {
-        [self.leftButton sizeToFit];
-        point.x = self.passcodeView.frame.origin.x + inset;
-        self.leftButton.center = point;
-    }
-
-    if (self.rightButton) {
-        [self.rightButton sizeToFit];
-        point.x = CGRectGetMaxX(self.passcodeView.frame) - inset;
-        self.rightButton.center = point;
-    }
-}
-
-- (void)horizontalLayoutAccessoryButtonsForSize:(CGSize)size
-{
-    CGRect passcodeViewFrame = self.passcodeView.frame;
-    CGFloat buttonInset = self.passcodeView.keypadButtonInset;
-    CGFloat width = MIN(size.width, size.height);
-    CGFloat verticalInset = 35.0f;
-    if (width < TOPasscodeViewContentSizeMedium) {
-        verticalInset = 30.0f;
-    }
-    else if (width < TOPasscodeViewContentSizeDefault) {
-        verticalInset = 35.0f;
-    }
-
-    if (self.leftButton) {
-        [self.leftButton sizeToFit];
-        CGRect frame = self.leftButton.frame;
-        frame.origin.y = (self.view.bounds.size.height - verticalInset) - (frame.size.height * 0.5f);
-        frame.origin.x = (CGRectGetMaxX(passcodeViewFrame) - buttonInset) - (frame.size.width * 0.5f);
-        self.leftButton.frame = CGRectIntegral(frame);
-    }
-
-    if (self.rightButton) {
-        [self.rightButton sizeToFit];
-        CGRect frame = self.rightButton.frame;
-        frame.origin.y = verticalInset - (frame.size.height * 0.5f);
-        frame.origin.x = (CGRectGetMaxX(passcodeViewFrame) - buttonInset) - (frame.size.width * 0.5f);
-        self.rightButton.frame = CGRectIntegral(frame);
-    }
-
-    [self.view bringSubviewToFront:self.rightButton];
-    [self.view bringSubviewToFront:self.leftButton];
-}
-
-- (void)layoutAccessoryButtonsForSize:(CGSize)size
-{
-    // The buttons are always embedded in the keypad view on iPad
-    if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone) { return; }
-
-    if (self.passcodeView.horizontalLayout && self.passcodeType != TOPasscodeTypeCustomAlphanumeric) {
-        [self horizontalLayoutAccessoryButtonsForSize:size];
-    }
-    else {
-        [self verticalLayoutAccessoryButtonsForSize:size];
-    }
-}
-
-#pragma mark - Interactions -
-- (void)accessoryButtonTapped:(id)sender
-{
-    if (sender == self.cancelButton) {
-        // When entering keyboard input, just leave the button as 'cancel'
-        if (self.passcodeType != TOPasscodeTypeCustomAlphanumeric && self.passcodeView.passcode.length > 0) {
-            [self.passcodeView deleteLastPasscodeCharacterAnimated:YES];
-            [self keypadButtonTapped];
-            return;
-        }
-
-        if ([self.delegate respondsToSelector:@selector(didTapCancelInPasscodeViewController:)]) {
-            [self.delegate didTapCancelInPasscodeViewController:self];
-        }
-    }
-    else if (sender == self.biometricButton) {
-        if ([self.delegate respondsToSelector:@selector(didPerformBiometricValidationRequestInPasscodeViewController:)]) {
-            [self.delegate didPerformBiometricValidationRequestInPasscodeViewController:self];
-        }
-    }
-}
-
-- (void)keypadButtonTapped
-{
-    NSString *title = nil;
-    if (self.passcodeView.passcode.length > 0) {
-        title = NSLocalizedString(@"Delete", @"Delete");
-    } else if (self.allowCancel) {
-        title = NSLocalizedString(@"Cancel", @"Cancel");
-    }
-    [UIView performWithoutAnimation:^{
-        if (title != nil) {
-            [self.cancelButton setTitle:title forState:UIControlStateNormal];
-            [self.cancelButton layoutIfNeeded];
-        }
-        self.cancelButton.hidden = (title == nil);
-    }];
-}
-
-- (void)didCompleteEnteringPasscode:(NSString *)passcode
-{
-    if (![self.delegate respondsToSelector:@selector(passcodeViewController:isCorrectCode:)]) {
-        return;
-    }
-
-    // Validate the code
-    BOOL isCorrect = [self.delegate passcodeViewController:self isCorrectCode:passcode];
-    if (!isCorrect) {
-        [self.passcodeView resetPasscodeAnimated:YES playImpact:YES];
-        return;
-    }
-
-    // Hang onto the fact the passcode was successful to play a nicer dismissal animation
-    self.passcodeSuccess = YES;
-
-    // Perform handler if correctly entered
-    if ([self.delegate respondsToSelector:@selector(didInputCorrectPasscodeInPasscodeViewController:)]) {
-        [self.delegate didInputCorrectPasscodeInPasscodeViewController:self];
-    }
-    else {
-        [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
-    }
-}
-
-#pragma mark - Keyboard Handling -
-- (void)keyboardWillChangeFrame:(NSNotification *)notification
-{
-    // Extract the keyboard information we need from the notification
-    CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
-    CGFloat animationDuration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
-    UIViewAnimationOptions animationCurve = [notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue];
-
-    // Work out the on-screen height of the keyboard
-    self.keyboardHeight = self.view.bounds.size.height - keyboardFrame.origin.y;
-    self.keyboardHeight = MAX(self.keyboardHeight, 0.0f);
-
-    // Set that the view needs to be laid out
-    [self.view setNeedsLayout];
-
-    if (animationDuration < FLT_EPSILON) {
-        return;
-    }
-
-    // Animate the content sliding up and down with the keyboard
-    [UIView animateWithDuration:animationDuration
-                          delay:0.0f
-                        options:animationCurve
-                     animations:^{ [self.view layoutIfNeeded]; }
-                     completion:nil];
-}
-
-#pragma mark - Transitioning Delegate -
-- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented
-                                                                            presentingController:(UIViewController *)presenting
-                                                                                sourceController:(UIViewController *)source
-{
-    return [[TOPasscodeViewControllerAnimatedTransitioning alloc] initWithPasscodeViewController:self dismissing:NO success:NO];
-}
-
-- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed
-{
-    return [[TOPasscodeViewControllerAnimatedTransitioning alloc] initWithPasscodeViewController:self dismissing:YES success:self.passcodeSuccess];
-}
-
-#pragma mark - Convenience Accessors -
-- (UIView *)leftButton
-{
-    return self.leftAccessoryButton ? self.leftAccessoryButton : self.biometricButton;
-}
-
-- (UIView *)rightButton
-{
-    return self.rightAccessoryButton ? self.rightAccessoryButton : self.cancelButton;
-}
-
-#pragma mark - Public Accessors -
-- (TOPasscodeView *)passcodeView
-{
-    if (_passcodeView) { return _passcodeView; }
-
-    _passcodeView = [[TOPasscodeView alloc] initWithStyle:self.style passcodeType:self.passcodeType];
-    _passcodeView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin |
-                                    UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
-    [_passcodeView sizeToFit];
-    _passcodeView.center = self.view.center;
-    [self.view addSubview:_passcodeView];
-
-    __weak typeof(self) weakSelf = self;
-    _passcodeView.passcodeCompletedHandler = ^(NSString *passcode) {
-        [weakSelf didCompleteEnteringPasscode:passcode];
-    };
-
-    _passcodeView.passcodeDigitEnteredHandler = ^{
-        [weakSelf keypadButtonTapped];
-    };
-
-    // Set initial layout to horizontal if we're rotated on an iPhone
-    if (self.passcodeType != TOPasscodeTypeCustomAlphanumeric && UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
-        CGSize boundsSize = self.view.bounds.size;
-        _passcodeView.horizontalLayout = boundsSize.width > boundsSize.height;
-    }
-
-    return _passcodeView;
-}
-
-- (void)setStyle:(TOPasscodeViewStyle)style
-{
-    if (style == _style) { return; }
-    _style = style;
-
-    self.passcodeView.style = style;
-    [self setUpBackgroundEffectViewForStyle:style];
-}
-
-- (void)setAllowBiometricValidation:(BOOL)allowBiometricValidation
-{
-    if (_allowBiometricValidation == allowBiometricValidation) {
-        return;
-    }
-
-    _allowBiometricValidation = allowBiometricValidation;
-    [self setUpAccessoryButtons];
-    [self applyThemeForStyle:self.style];
-}
-
-- (void)setTitleLabelColor:(UIColor *)titleLabelColor
-{
-    self.passcodeView.titleLabelColor = titleLabelColor;
-}
-
-- (UIColor *)titleLabelColor { return self.passcodeView.titleLabelColor; }
-
-- (void)setInputProgressViewTintColor:(UIColor *)inputProgressViewTintColor
-{
-    self.passcodeView.inputProgressViewTintColor = inputProgressViewTintColor;
-}
-
-- (UIColor *)inputProgressViewTintColor { return self.passcodeView.inputProgressViewTintColor; }
-
-- (void)setKeypadButtonBackgroundTintColor:(UIColor *)keypadButtonBackgroundTintColor
-{
-    self.passcodeView.keypadButtonBackgroundColor = keypadButtonBackgroundTintColor;
-}
-
-- (void)setKeypadButtonShowLettering:(BOOL)keypadButtonShowLettering
-{
-    self.passcodeView.keypadView.showLettering = keypadButtonShowLettering;
-}
-
-- (UIColor *)keypadButtonBackgroundTintColor { return self.passcodeView.keypadButtonBackgroundColor; }
-
-- (void)setKeypadButtonTextColor:(UIColor *)keypadButtonTextColor
-{
-    self.passcodeView.keypadButtonTextColor = keypadButtonTextColor;
-}
-
-- (UIColor *)keypadButtonTextColor { return self.passcodeView.keypadButtonTextColor; }
-
-- (void)setKeypadButtonHighlightedTextColor:(UIColor *)keypadButtonHighlightedTextColor
-{
-    self.passcodeView.keypadButtonHighlightedTextColor = keypadButtonHighlightedTextColor;
-}
-
-- (UIColor *)keypadButtonHighlightedTextColor { return self.passcodeView.keypadButtonHighlightedTextColor; }
-
-- (void)setAccessoryButtonTintColor:(UIColor *)accessoryButtonTintColor
-{
-    if (accessoryButtonTintColor == _accessoryButtonTintColor) { return; }
-    _accessoryButtonTintColor = accessoryButtonTintColor;
-    [self applyThemeForStyle:self.style];
-}
-
-- (void)setBiometryType:(TOPasscodeBiometryType)biometryType
-{
-    if (_biometryType == biometryType) { return; }
-    
-    _biometryType = biometryType;
-    
-    if (self.biometricButton) {
-        [self.biometricButton setTitle:TOPasscodeBiometryTitleForType(_biometryType) forState:UIControlStateNormal];
-    }
-}
-
-- (void)setContentHidden:(BOOL)contentHidden
-{
-    [self setContentHidden:contentHidden animated:NO];
-}
-
-- (void)setContentHidden:(BOOL)hidden animated:(BOOL)animated
-{
-    if (hidden == _contentHidden) { return; }
-    _contentHidden = hidden;
-
-    void (^setViewsHiddenBlock)(BOOL) = ^(BOOL hidden) {
-        self.passcodeView.hidden = hidden;
-        self.leftButton.hidden = hidden;
-        self.rightButton.hidden = hidden;
-    };
-
-    void (^completionBlock)(BOOL) = ^(BOOL complete) {
-        setViewsHiddenBlock(hidden);
-    };
-
-    if (!animated) {
-        completionBlock(YES);
-        return;
-    }
-
-    // Make sure the views are visible before the animation
-    setViewsHiddenBlock(NO);
-
-    void (^animationBlock)(void) = ^{
-        CGFloat alpha = hidden ? 0.0f : 1.0f;
-        self.passcodeView.contentAlpha = alpha;
-        self.leftButton.alpha = alpha;
-        self.rightButton.alpha = alpha;
-    };
-
-    // Animate
-    [UIView animateWithDuration:0.4f animations:animationBlock completion:completionBlock];
-}
-
-@end

+ 0 - 81
Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeCircleButton.h

@@ -1,81 +0,0 @@
-//
-//  TOPasscodeCircleButton.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-@class TOPasscodeCircleView;
-@class TOPasscodeButtonLabel;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A UI control representing a single PIN code button for the keypad,
- including the number, lettering (eg 'ABC'), and circle border.
- */
-@interface TOPasscodeCircleButton : UIControl
-
-// Alpha value that properly controls the necessary subviews
-@property (nonatomic, assign) CGFloat contentAlpha;
-
-// Required to be set before this view can be properly rendered
-@property (nonatomic, strong) UIImage *backgroundImage;
-@property (nonatomic, strong) UIImage *hightlightedBackgroundImage;
-@property (nonatomic, strong) UIVibrancyEffect *vibrancyEffect;
-
-// Properties with default values
-@property (nonatomic, strong) UIColor *textColor;
-@property (nonatomic, strong, nullable) UIColor *highlightedTextColor;
-@property (nonatomic, strong) UIFont *numberFont;
-@property (nonatomic, strong) UIFont *letteringFont;
-@property (nonatomic, assign) CGFloat letteringCharacterSpacing;
-@property (nonatomic, assign) CGFloat letteringVerticalSpacing;
-
-@property (nonatomic, readonly) NSString *numberString;
-@property (nonatomic, readonly) NSString *letteringString;
-
-// The internal views
-@property (nonatomic, readonly) TOPasscodeButtonLabel *buttonLabel;
-@property (nonatomic, readonly) TOPasscodeCircleView *circleView;
-@property (nonatomic, readonly) UIVisualEffectView *vibrancyView;
-
-// Callback handler
-@property (nonatomic, copy) void (^buttonTappedHandler)(void);
-
-/**
- Create a new instance of the class with the supplied number and lettering string
-
- @param numberString The string of the number to display in this button (eg '1').
- @param letteringString The string of the lettering to display underneath.
- */
-- (instancetype)initWithNumberString:(NSString *)numberString letteringString:(NSString *)letteringString;
-
-/**
- Set the background of the button to be the filled circle instead of hollow.
-
- @param highlighted When YES, the circle is full, when NO, it is hollow.
- @param animated When animated, the transition is a crossfade.
- */
-- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 236
Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeCircleButton.m

@@ -1,236 +0,0 @@
-//
-//  TOPasscodeCircleButton.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeCircleButton.h"
-#import "TOPasscodeCircleView.h"
-#import "TOPasscodeButtonLabel.h"
-
-@interface TOPasscodeCircleButton ()
-
-@property (nonatomic, strong, readwrite) TOPasscodeButtonLabel *buttonLabel;
-@property (nonatomic, strong, readwrite) TOPasscodeCircleView *circleView;
-@property (nonatomic, strong, readwrite) UIVisualEffectView *vibrancyView;
-
-@property (nonatomic, readwrite, copy) NSString *numberString;
-@property (nonatomic, readwrite, copy) NSString *letteringString;
-
-@end
-
-@implementation TOPasscodeCircleButton
-
-- (instancetype)initWithNumberString:(NSString *)numberString letteringString:(NSString *)letteringString
-{
-    if (self = [super init]) {
-        _numberString = numberString;
-        _letteringString = letteringString;
-        _contentAlpha = 1.0f;
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (void)setUp
-{
-    self.userInteractionEnabled = YES;
-    
-    _textColor = [UIColor whiteColor];
-
-    [self setUpSubviews];
-    [self setUpViewInteraction];
-}
-
-- (void)setUpSubviews
-{
-    if (!self.circleView) {
-        self.circleView = [[TOPasscodeCircleView alloc] initWithFrame:self.bounds];
-        [self addSubview:self.circleView];
-    }
-
-    if (!self.buttonLabel) {
-        self.buttonLabel = [[TOPasscodeButtonLabel alloc] initWithFrame:self.bounds];
-        self.buttonLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        self.buttonLabel.userInteractionEnabled = NO;
-        self.buttonLabel.textColor = self.textColor;
-        self.buttonLabel.numberString = self.numberString;
-        self.buttonLabel.letteringString = self.letteringString;
-        [self addSubview:self.buttonLabel];
-    }
-
-    if (!self.vibrancyView) {
-        self.vibrancyView = [[UIVisualEffectView alloc] initWithEffect:nil];
-        self.vibrancyView.userInteractionEnabled = NO;
-        [self.vibrancyView.contentView addSubview:self.circleView];
-        [self addSubview:self.vibrancyView];
-    }
-}
-
-- (void)setUpViewInteraction
-{
-    if (self.allTargets.count) { return; }
-
-    [self addTarget:self action:@selector(buttonDidTouchDown:) forControlEvents:UIControlEventTouchDown];
-    [self addTarget:self action:@selector(buttonDidTouchUpInside:) forControlEvents:UIControlEventTouchUpInside];
-    [self addTarget:self action:@selector(buttonDidDragInside:) forControlEvents:UIControlEventTouchDragEnter];
-    [self addTarget:self action:@selector(buttonDidDragOutside:) forControlEvents:UIControlEventTouchDragExit];
-}
-
-- (void)layoutSubviews
-{
-    [super layoutSubviews];
-
-    self.vibrancyView.frame = self.bounds;
-    self.circleView.frame = self.vibrancyView ? self.vibrancyView.bounds : self.bounds;
-    self.buttonLabel.frame = self.bounds;
-    [self bringSubviewToFront:self.buttonLabel];
-}
-
-#pragma mark - User Interaction -
-
-- (void)buttonDidTouchDown:(id)sender
-{
-    if (self.buttonTappedHandler) { self.buttonTappedHandler(); }
-    [self setHighlighted:YES animated:NO];
-}
-
-- (void)buttonDidTouchUpInside:(id)sender { [self setHighlighted:NO animated:YES]; }
-- (void)buttonDidDragInside:(id)sender    { [self setHighlighted:YES animated:NO]; }
-- (void)buttonDidDragOutside:(id)sender   { [self setHighlighted:NO animated:YES]; }
-
-#pragma mark - Animated Accessors -
-
-- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
-{
-    [self.circleView setHighlighted:highlighted animated:animated];
-
-    if (!self.highlightedTextColor) { return; }
-
-    void (^textFadeBlock)(void) = ^{
-        self.buttonLabel.textColor = highlighted ? self.highlightedTextColor : self.textColor;
-    };
-
-    if (!animated) {
-        textFadeBlock();
-        return;
-    }
-
-    [UIView transitionWithView:self.buttonLabel
-                      duration:0.6f
-                       options:UIViewAnimationOptionTransitionCrossDissolve
-                    animations:textFadeBlock
-                    completion:nil];
-}
-
-#pragma mark - Accessors -
-
-- (void)setBackgroundImage:(UIImage *)backgroundImage
-{
-    self.circleView.circleImage = backgroundImage;
-    CGRect frame = self.frame;
-    frame.size = backgroundImage.size;
-    self.frame = CGRectIntegral(frame);
-}
-
-- (UIImage *)backgroundImage { return self.circleView.circleImage; }
-
-/***********************************************************/
-
-- (void)setVibrancyEffect:(UIVibrancyEffect *)vibrancyEffect
-{
-    if (_vibrancyEffect == vibrancyEffect) { return; }
-    _vibrancyEffect = vibrancyEffect;
-    self.vibrancyView.effect = _vibrancyEffect;
-}
-
-/***********************************************************/
-
-- (void)setHightlightedBackgroundImage:(UIImage *)hightlightedBackgroundImage
-{
-    self.circleView.highlightedCircleImage = hightlightedBackgroundImage;
-}
-
-- (UIImage *)hightlightedBackgroundImage { return self.circleView.highlightedCircleImage; }
-
-/***********************************************************/
-
-- (void)setNumberFont:(UIFont *)numberFont
-{
-    self.buttonLabel.numberLabelFont = numberFont;
-    [self setNeedsLayout];
-}
-
-- (UIFont *)numberFont { return self.buttonLabel.numberLabelFont; }
-
-/***********************************************************/
-
-- (void)setLetteringFont:(UIFont *)letteringFont
-{
-    self.buttonLabel.letteringLabelFont = letteringFont;
-    [self setNeedsLayout];
-}
-
-- (UIFont *)letteringFont { return self.buttonLabel.letteringLabelFont; }
-
-/***********************************************************/
-
-- (void)setLetteringVerticalSpacing:(CGFloat)letteringVerticalSpacing
-{
-    self.buttonLabel.letteringVerticalSpacing = letteringVerticalSpacing;
-    [self.buttonLabel setNeedsLayout];
-}
-
-- (CGFloat)letteringVerticalSpacing { return self.buttonLabel.letteringVerticalSpacing; }
-
-/***********************************************************/
-
-- (void)setLetteringCharacterSpacing:(CGFloat)letteringCharacterSpacing
-{
-    self.buttonLabel.letteringCharacterSpacing = letteringCharacterSpacing;
-}
-
-- (CGFloat)letteringCharacterSpacing { return self.buttonLabel.letteringCharacterSpacing; }
-
-/***********************************************************/
-
-- (void)setTextColor:(UIColor *)textColor
-{
-    if (textColor == _textColor) { return; }
-    _textColor = textColor;
-
-    self.buttonLabel.textColor = _textColor;
-}
-
-/***********************************************************/
-
-- (void)setContentAlpha:(CGFloat)contentAlpha
-{
-    if (_contentAlpha == contentAlpha) {
-        return;
-    }
-
-    _contentAlpha = contentAlpha;
-
-    self.buttonLabel.alpha = contentAlpha;
-    self.circleView.alpha = contentAlpha;
-}
-
-@end

+ 0 - 101
Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeKeypadView.h

@@ -1,101 +0,0 @@
-//
-//  TOPasscodeKeypadView.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class TOPasscodeCircleButton;
-
-/**
- A view encompassing 9 circle buttons, making up a keypad view for entering PIN numbers.
- Can be laid out vertically or horizontally.
- */
-@interface TOPasscodeKeypadView : UIView <UIInputViewAudioFeedback>
-
-/** The type of layout for the buttons (Default is vertical) */
-@property (nonatomic, assign) BOOL horizontalLayout;
-
-/** The vibrancy effect to be applied to each button background */
-@property (nonatomic, strong, nullable) UIVibrancyEffect *vibrancyEffect;
-
-/** The size of each input button */
-@property (nonatomic, assign) CGFloat buttonDiameter;
-
-/** The stroke width of the buttons */
-@property (nonatomic, assign) CGFloat buttonStrokeWidth;
-
-/** The spacing between the buttons. Default is (CGSize){25,15} */
-@property (nonatomic, assign) CGSize buttonSpacing;
-
-/** The font of the number in each button */
-@property (nonatomic, strong) UIFont *buttonNumberFont;
-
-/** The font of the lettering label */
-@property (nonatomic, strong) UIFont *buttonLetteringFont;
-
-/** The spacing between the lettering and the number label */
-@property (nonatomic, assign) CGFloat buttonLabelSpacing;
-
-/** The spacing between the letters in the lettering label */
-@property (nonatomic, assign) CGFloat buttonLetteringSpacing;
-
-/** Show the 'ABC' lettering under the numbers */
-@property (nonatomic, assign) BOOL showLettering;
-
-/** The spacing in points between the letters */
-@property (nonatomic, assign) CGFloat letteringSpacing;
-
-/** The tint color of the button backgrounds */
-@property (nonatomic, strong) UIColor *buttonBackgroundColor;
-
-/** The color of the text elements in each button */
-@property (nonatomic, strong) UIColor *buttonTextColor;
-
-/** Optionally the color of text when it's tapped. */
-@property (nonatomic, strong, nullable) UIColor *buttonHighlightedTextColor;
-
-/** The alpha value of all non-translucent views */
-@property (nonatomic, assign) CGFloat contentAlpha;
-
-/** Accessory views placed on either side of the '0' button */
-@property (nonatomic, strong, nullable) UIView *leftAccessoryView;
-@property (nonatomic, strong, nullable) UIView *rightAccessoryView;
-
-/** The controls making up each of the button views */
-@property (nonatomic, readonly) NSArray<TOPasscodeCircleButton *> *keypadButtons;
-
-/** The block that is triggered whenever a user taps one of the buttons */
-@property (nonatomic, copy) void (^buttonTappedHandler)(NSInteger buttonNumber);
-
-/*
- Perform an animation to transition to a new layout.
-
- @param horizontalLayout The content is laid out horizontally.
- @param animated Whether the transition is animated
- @param duration The animation length of the transition.
- */
-- (void)setHorizontalLayout:(BOOL)horizontalLayout animated:(BOOL)animated duration:(CGFloat)duration;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 432
Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeKeypadView.m

@@ -1,432 +0,0 @@
-//
-//  TOPasscodeKeypadView.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeKeypadView.h"
-#import "TOPasscodeCircleImage.h"
-#import "TOPasscodeCircleButton.h"
-#import "TOPasscodeCircleView.h"
-#import "TOPasscodeButtonLabel.h"
-
-@interface TOPasscodeKeypadView()
-
-/* Passcode buttons */
-@property (nonatomic, strong, readwrite) NSArray<TOPasscodeCircleButton *> *keypadButtons;
-
-/* The '0' button for the different layouts */
-@property (nonatomic, strong) TOPasscodeCircleButton *verticalZeroButton;
-@property (nonatomic, strong) TOPasscodeCircleButton *horizontalZeroButton;
-
-/* Images */
-@property (nonatomic, strong) UIImage *buttonImage;
-@property (nonatomic, strong) UIImage *tappedButtonImage;
-
-@end
-
-@implementation TOPasscodeKeypadView
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        self.userInteractionEnabled = YES;
-        _buttonDiameter = 81.0f;
-        _buttonSpacing = (CGSize){25,15};
-        _buttonStrokeWidth = 1.5f;
-        _showLettering = YES;
-        _buttonNumberFont = nil;
-        _buttonLetteringFont = nil;
-        _buttonLabelSpacing = FLT_MIN;
-        _buttonLetteringSpacing = FLT_MIN;
-        [self sizeToFit];
-    }
-
-    return self;
-}
-
-- (TOPasscodeCircleButton *)makeCircleButtonWithNumber:(NSInteger)number letteringString:(NSString *)letteringString
-{
-    NSString *numberString = [NSString stringWithFormat:@"%ld", (long)number];
-
-    TOPasscodeCircleButton *circleButton = [[TOPasscodeCircleButton alloc] initWithNumberString:numberString letteringString:letteringString];
-    circleButton.backgroundImage = self.buttonImage;
-    circleButton.hightlightedBackgroundImage = self.tappedButtonImage;
-    circleButton.vibrancyEffect = self.vibrancyEffect;
-
-    // Add handler for when button is tapped
-    __weak typeof(self) weakSelf = self;
-    circleButton.buttonTappedHandler = ^{
-        if (weakSelf.buttonTappedHandler) {
-            weakSelf.buttonTappedHandler(number);
-        }
-    };
-
-    return circleButton;
-}
-
-- (void)setUpButtons
-{
-    NSMutableArray *buttons = [NSMutableArray array];
-
-    NSInteger numberOfButtons = 11; // 1-9 are normal, 10 is the vertical '0', 11 is the horizontal '0'
-    NSArray *letteredTitles = @[@"ABC", @"DEF", @"GHI", @"JKL",
-                                @"MNO", @"PQRS", @"TUV", @"WXYZ"];
-
-    for (NSInteger i = 0; i < numberOfButtons; i++) {
-        // Work out the button number text
-        NSInteger buttonNumber = i + 1;
-        if (buttonNumber == 10 || buttonNumber == 11) { buttonNumber = 0; }
-
-        // Work out the lettering text
-        NSString *letteringString = nil;
-        if (self.showLettering && i > 0 && i-1 < letteredTitles.count) { // (Skip 1 and 0)
-            letteringString = letteredTitles[i-1];
-        }
-
-        // Create a new button and add it to this view
-        TOPasscodeCircleButton *circleButton = [self makeCircleButtonWithNumber:buttonNumber letteringString:letteringString];
-        [self addSubview:circleButton];
-        [buttons addObject:circleButton];
-        
-        if (!self.showLettering) {
-            circleButton.buttonLabel.verticallyCenterNumberLabel = YES; // Center the digit in the middle
-        }
-
-        // Hang onto the 0 button if it's the vertical one
-        // And center the text
-        if (i == 9) {
-            self.verticalZeroButton = circleButton;
-
-            // Hide the button if it's not vertically laid out
-            if (self.horizontalLayout) {
-                self.verticalZeroButton.contentAlpha = 0.0f;
-                self.verticalZeroButton.hidden = YES;
-            }
-        }
-        else if (i == 10) {
-            self.horizontalZeroButton = circleButton;
-
-            // Hide the button if it's not horizontally laid out
-            if (!self.horizontalLayout) {
-                self.horizontalZeroButton.contentAlpha = 0.0f;
-                self.horizontalZeroButton.hidden = YES;
-            }
-        }
-    }
-
-    _keypadButtons = [NSArray arrayWithArray:buttons];
-}
-
-- (void)sizeToFit
-{
-    CGFloat padding = 2.0f;
-
-    CGRect frame = self.frame;
-    if (self.horizontalLayout) {
-        frame.size.width  = ((self.buttonDiameter + padding) * 4) + (self.buttonSpacing.width * 3);
-        frame.size.height = ((self.buttonDiameter + padding) * 3) + (self.buttonSpacing.height * 2);
-    }
-    else {
-        frame.size.width  = ((self.buttonDiameter + padding) * 3) + (self.buttonSpacing.width * 2);
-        frame.size.height = ((self.buttonDiameter + padding) * 4) + (self.buttonSpacing.height * 3);
-    }
-    self.frame = CGRectIntegral(frame);
-}
-
-- (void)layoutSubviews
-{
-    [super layoutSubviews];
-
-    NSInteger i = 0;
-    CGPoint origin = CGPointZero;
-    for (TOPasscodeCircleButton *button in self.keypadButtons) {
-        // Set the button frame
-        CGRect frame = button.frame;
-        frame.origin = origin;
-        button.frame = frame;
-
-        // Work out the next offset
-        CGFloat horizontalOffset = frame.size.width + self.buttonSpacing.width;
-        origin.x += horizontalOffset;
-
-        i++;
-
-        // If we're at the end of the row, move to the next one
-        if (i % 3 == 0) {
-            origin.x = 0.0f;
-            origin.y = origin.y + frame.size.height + self.buttonSpacing.height;
-        }
-    }
-
-    // Lay out the vertical button
-    CGRect frame = self.verticalZeroButton.frame;
-    frame.origin.x += (frame.size.width + self.buttonSpacing.width);
-    self.verticalZeroButton.frame = frame;
-
-    // Lay out the horizontal button
-    frame = self.horizontalZeroButton.frame;
-    frame.origin.x = (frame.size.width + self.buttonSpacing.width) * 3.0f;
-    frame.origin.y = frame.size.height + self.buttonSpacing.height;
-    self.horizontalZeroButton.frame = frame;
-
-    // Layout the accessory buttons
-    CGFloat midPointY = CGRectGetMidY(self.verticalZeroButton.frame);
-
-    if (self.leftAccessoryView) {
-        CGRect leftButtonFrame = self.keypadButtons.firstObject.frame;
-        CGFloat midPointX = CGRectGetMidX(leftButtonFrame);
-
-        [self.leftAccessoryView sizeToFit];
-        self.leftAccessoryView.center = (CGPoint){midPointX, midPointY};
-    }
-
-    if (self.rightAccessoryView) {
-        CGRect rightButtonFrame = self.keypadButtons[2].frame;
-        CGFloat midPointX = CGRectGetMidX(rightButtonFrame);
-
-        [self.rightAccessoryView sizeToFit];
-        self.rightAccessoryView.center = (CGPoint){midPointX, midPointY};
-    }
-}
-
-#pragma mark - Style Accessors -
-- (void)setVibrancyEffect:(UIVibrancyEffect *)vibrancyEffect
-{
-    if (vibrancyEffect == _vibrancyEffect) { return; }
-    _vibrancyEffect = vibrancyEffect;
-
-    for (TOPasscodeCircleButton *button in self.keypadButtons) {
-        button.vibrancyEffect = _vibrancyEffect;
-    }
-}
-
-#pragma mark - Lazy Getters -
-- (UIImage *)buttonImage
-{
-    if (!_buttonImage) {
-        _buttonImage = [TOPasscodeCircleImage hollowCircleImageOfSize:self.buttonDiameter strokeWidth:self.buttonStrokeWidth padding:1.0f];
-    }
-
-    return _buttonImage;
-}
-
-- (UIImage *)tappedButtonImage
-{
-    if (!_tappedButtonImage) {
-        _tappedButtonImage = [TOPasscodeCircleImage circleImageOfSize:self.buttonDiameter inset:self.buttonStrokeWidth * 0.5f padding:1.0f antialias:YES];
-    }
-
-    return _tappedButtonImage;
-}
-
-- (NSArray<TOPasscodeCircleButton *> *)keypadButtons
-{
-    if (_keypadButtons) { return _keypadButtons; }
-    [self setUpButtons];
-    return _keypadButtons;
-}
-
-#pragma mark - Audio Delegate Protocol -
-- (BOOL)enableInputClicksWhenVisible
-{
-    return YES;
-}
-
-#pragma mark - Public Layout Setters -
-
-- (void)setHorizontalLayout:(BOOL)horizontalLayout
-{
-    [self setHorizontalLayout:horizontalLayout animated:NO duration:0.0f];
-}
-
-- (void)setHorizontalLayout:(BOOL)horizontalLayout animated:(BOOL)animated duration:(CGFloat)duration
-{
-    if (horizontalLayout== _horizontalLayout) {
-        return;
-    }
-
-    _horizontalLayout = horizontalLayout;
-
-    // Resize itself now so the frame value is up to date externally
-    [self sizeToFit];
-
-    // Set initial animation state
-    self.verticalZeroButton.hidden = NO;
-    self.horizontalZeroButton.hidden = NO;
-
-    self.verticalZeroButton.contentAlpha = _horizontalLayout ? 1.0f : 0.0f;
-    self.horizontalZeroButton.contentAlpha = _horizontalLayout ? 0.0f : 1.0f;
-
-    void (^animationBlock)(void) = ^{
-        self.verticalZeroButton.contentAlpha = self.horizontalLayout ? 0.0f : 1.0f;
-        self.horizontalZeroButton.contentAlpha = self.horizontalLayout ? 1.0f : 0.0f;
-    };
-
-    void (^completionBlock)(BOOL) = ^(BOOL complete) {
-        self.verticalZeroButton.hidden = self.horizontalLayout;
-        self.horizontalZeroButton.hidden = self.horizontalLayout;
-    };
-
-    // Don't animate if not needed
-    if (!animated) {
-        animationBlock();
-        completionBlock(YES);
-        return;
-    }
-
-    // Perform animation
-    [UIView animateWithDuration:duration animations:animationBlock completion:completionBlock];
-}
-
-- (void)updateButtonsForCurrentState
-{
-    for (TOPasscodeCircleButton *circleButton in self.keypadButtons) {
-        circleButton.backgroundImage = self.buttonImage;
-        circleButton.hightlightedBackgroundImage = self.tappedButtonImage;
-        circleButton.numberFont = self.buttonNumberFont;
-        circleButton.letteringFont = self.buttonLetteringFont;
-        circleButton.letteringVerticalSpacing = self.buttonLabelSpacing;
-        circleButton.letteringCharacterSpacing = self.buttonLetteringSpacing;
-        circleButton.tintColor = self.buttonBackgroundColor;
-        circleButton.textColor = self.buttonTextColor;
-        circleButton.highlightedTextColor = self.buttonHighlightedTextColor;
-        if (!_showLettering) {
-            circleButton.buttonLabel.letteringLabel.text = nil;
-            circleButton.buttonLabel.verticallyCenterNumberLabel = YES;
-        }
-    }
-
-    [self setNeedsLayout];
-}
-
-- (void)setButtonDiameter:(CGFloat)buttonDiameter
-{
-    if (_buttonDiameter == buttonDiameter) { return; }
-    _buttonDiameter = buttonDiameter;
-    _tappedButtonImage = nil;
-    _buttonImage = nil;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonSpacing:(CGSize)buttonSpacing
-{
-    if (CGSizeEqualToSize(_buttonSpacing, buttonSpacing)) { return; }
-    _buttonSpacing = buttonSpacing;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonStrokeWidth:(CGFloat)buttonStrokeWidth
-{
-    if (_buttonStrokeWidth== buttonStrokeWidth) { return; }
-    _buttonStrokeWidth = buttonStrokeWidth;
-    _tappedButtonImage = nil;
-    _buttonImage = nil;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setShowLettering:(BOOL)showLettering
-{
-    if (_showLettering == showLettering) { return; }
-    _showLettering = showLettering;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonNumberFont:(UIFont *)buttonNumberFont
-{
-    if (_buttonNumberFont == buttonNumberFont) { return; }
-    _buttonNumberFont = buttonNumberFont;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonLetteringFont:(UIFont *)buttonLetteringFont
-{
-    if (buttonLetteringFont == _buttonLetteringFont) { return; }
-    _buttonLetteringFont = buttonLetteringFont;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonLabelSpacing:(CGFloat)buttonLabelSpacing
-{
-    if (buttonLabelSpacing == _buttonLabelSpacing) { return; }
-    _buttonLabelSpacing = buttonLabelSpacing;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonLetteringSpacing:(CGFloat)buttonLetteringSpacing
-{
-    if (buttonLetteringSpacing == _buttonLetteringSpacing) { return; }
-    _buttonLetteringSpacing = buttonLetteringSpacing;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonBackgroundColor:(UIColor *)buttonBackgroundColor
-{
-    if (buttonBackgroundColor == _buttonBackgroundColor) { return; }
-    _buttonBackgroundColor = buttonBackgroundColor;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonTextColor:(UIColor *)buttonTextColor
-{
-    if (buttonTextColor == _buttonTextColor) { return; }
-    _buttonTextColor = buttonTextColor;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setButtonHighlightedTextColor:(UIColor *)buttonHighlightedTextColor
-{
-    if (buttonHighlightedTextColor == _buttonHighlightedTextColor) { return; }
-    _buttonHighlightedTextColor = buttonHighlightedTextColor;
-    [self updateButtonsForCurrentState];
-}
-
-- (void)setLeftAccessoryView:(UIView *)leftAccessoryView
-{
-    if (_leftAccessoryView == leftAccessoryView) { return; }
-    _leftAccessoryView = leftAccessoryView;
-    [self addSubview:_leftAccessoryView];
-    [self setNeedsLayout];
-}
-
-- (void)setRightAccessoryView:(UIView *)rightAccessoryView
-{
-    if (_rightAccessoryView == rightAccessoryView) { return; }
-    _rightAccessoryView = rightAccessoryView;
-    [self addSubview:_rightAccessoryView];
-    [self setNeedsLayout];
-}
-
-- (void)setContentAlpha:(CGFloat)contentAlpha
-{
-    _contentAlpha = contentAlpha;
-
-    for (TOPasscodeCircleButton *button in self.keypadButtons) {
-        // Skip whichever '0' button is not presently being used
-        if ((self.horizontalLayout && button == self.verticalZeroButton) ||
-            (!self.horizontalLayout && button == self.horizontalZeroButton))
-        {
-            continue;
-        }
-
-        button.contentAlpha = contentAlpha;
-    }
-}
-
-@end

+ 0 - 133
Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeView.h

@@ -1,133 +0,0 @@
-//
-//  TOPasscodeView.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-#import "TOPasscodeViewControllerConstants.h"
-#import "TOPasscodeKeypadView.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class TOPasscodeCircleButton;
-@class TOPasscodeInputField;
-@class TOPasscodeKeypadView;
-@class TOPasscodeViewContentLayout;
-
-/**
- The passcode view is the primary content view for the passcode view controller.
- On iPad, every view except the background view is a subview of this view.
- On iPhone, the auxiliary buttons ('Touch ID', 'Cancel') are managed by the view controller.
- */
-@interface TOPasscodeView : UIView
-
-/* The visual style of the view */
-@property (nonatomic, assign) TOPasscodeViewStyle style;
-
-/* The type of passcode being managed by it */
-@property (nonatomic, readonly) TOPasscodeType passcodeType;
-
-/* Whether the content is laid out vertically or horizontally (iPhone only) */
-@property (nonatomic, assign) BOOL horizontalLayout;
-
-/* The text in the title view (Default is 'Enter Passcode') */
-@property (nonatomic, copy) NSString *titleText;
-
-/* Customizable Accessory Views */
-@property (nonatomic, strong, nullable) UIView   *titleView;
-@property (nonatomic, strong, nullable) UIButton *leftButton;
-@property (nonatomic, strong, nullable) UIButton *rightButton;
-
-/* The default views always shown in this view */
-@property (nonatomic, readonly) UILabel *titleLabel;
-@property (nonatomic, readonly) TOPasscodeInputField *inputField;
-@property (nonatomic, readonly) TOPasscodeKeypadView *keypadView;
-
-/* Overrides for theming the various elements. */
-@property (nonatomic, strong, nullable) UIColor *titleLabelColor;
-@property (nonatomic, strong, nullable) UIColor *inputProgressViewTintColor;
-@property (nonatomic, strong, nullable) UIColor *keypadButtonBackgroundColor;
-@property (nonatomic, strong, nullable) UIColor *keypadButtonTextColor;
-@property (nonatomic, strong, nullable) UIColor *keypadButtonHighlightedTextColor;
-
-/* Horizontal inset from edge of keypad view to button center */
-@property (nonatomic, readonly) CGFloat keypadButtonInset;
-
-/* An animatable property for animating the non-translucent subviews */
-@property (nonatomic, assign) CGFloat contentAlpha;
-
-/* The passcode currently entered into this view */
-@property (nonatomic, copy, nullable) NSString *passcode;
-
-/* The default layout object controlling the
- sizing and placement of all this view's child elements. */
-@property (nonatomic, strong, null_resettable) TOPasscodeViewContentLayout *defaultContentLayout;
-
-/* As needed, additional layout objects that will be checked and used in priority over the default content layout. */
-@property (nonatomic, strong, nullable) NSArray<TOPasscodeViewContentLayout *> *contentLayouts;
-
-/* Callback triggered each time the user taps a key */
-@property (nonatomic, copy, nullable) void (^passcodeDigitEnteredHandler)(void);
-
-/* Callback triggered when the user has finished entering the passcode */
-@property (nonatomic, copy, nullable) void (^passcodeCompletedHandler)(NSString *passcode);
-
-/*
- Create a new instance with one of the style types
-
- @param style The visual style of the passcode view.
- @param type The type of passcode to accept.
- */
-- (instancetype)initWithStyle:(TOPasscodeViewStyle)style passcodeType:(TOPasscodeType)type;
-
-/*
- Resize the view and all subviews for the optimum size to fit a super view of the suplied width.
-
- @param size The size of the view to which this view.
- */
-- (void)sizeToFitSize:(CGSize)size;
-
-/*
- Reset the passcode to nil and optionally play animation / vibration to match
-
- @param animated Play a shaking animation to reset the passcode.
- @param impact On supported devices, play a small reset vibration as well.
- */
-- (void)resetPasscodeAnimated:(BOOL)animated playImpact:(BOOL)impact;
-
-/*
- Delete the last character from the passcode
-
- @param animated Whether the delete operation is animated or not.
- */
-- (void)deleteLastPasscodeCharacterAnimated:(BOOL)animated;
-
-/*
- Animate the transition between horizontal and vertical layouts
-
- @param horizontalLayout Whether to lay out the content vertically or horizontally.
- @param animated Whether the transition is animated or not.
- @param duration The duration of the animation
- */
-- (void)setHorizontalLayout:(BOOL)horizontalLayout animated:(BOOL)animated duration:(CGFloat)duration;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 636
Libraries external/TOPasscodeViewController/Views/Main/TOPasscodeView.m

@@ -1,636 +0,0 @@
-//
-//  TOPasscodeView.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeView.h"
-#import "TOPasscodeViewContentLayout.h"
-#import "TOPasscodeCircleButton.h"
-#import "TOPasscodeInputField.h"
-#import "TOPasscodeKeypadView.h"
-
-@interface TOPasscodeView ()
-
-/* The current layout object used to configure this view */
-@property (nonatomic, weak) TOPasscodeViewContentLayout *currentLayout;
-
-/* The main views */
-@property (nonatomic, strong, readwrite) UILabel *titleLabel;
-@property (nonatomic, strong, readwrite) TOPasscodeInputField *inputField;
-@property (nonatomic, strong, readwrite) TOPasscodeKeypadView *keypadView;
-
-/* The type of passcode we're displaying */
-@property (nonatomic, assign, readwrite) TOPasscodeType passcodeType;
-
-@end
-
-@implementation TOPasscodeView
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (instancetype)initWithStyle:(TOPasscodeViewStyle)style passcodeType:(TOPasscodeType)type
-{
-    if (self = [super initWithFrame:CGRectMake(0,0,320,393)]) {
-        _style = style;
-        _passcodeType = type;
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder
-{
-    if (self = [super initWithCoder:aDecoder]) {
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (void)setUp
-{
-    // Set up default properties
-    self.userInteractionEnabled = YES;
-    _defaultContentLayout = [TOPasscodeViewContentLayout defaultScreenContentLayout];
-    _currentLayout = _defaultContentLayout;
-    _contentLayouts = @[[TOPasscodeViewContentLayout mediumScreenContentLayout],
-                        [TOPasscodeViewContentLayout smallScreenContentLayout]];
-    _titleText = NSLocalizedString(@"Enter Passcode", @"");
-
-    // Start configuring views
-    [self setUpViewForType:self.passcodeType];
-
-    // Set the default layout for the views
-    [self updateSubviewsForContentLayout:_defaultContentLayout];
-
-    // Configure the theme of all of the views
-    [self applyThemeForStyle:_style];
-}
-
-#pragma mark - View Layout -
-- (void)verticallyLayoutSubviews
-{
-    CGSize viewSize = self.frame.size;
-    CGSize midViewSize = (CGSize){self.frame.size.width * 0.5f, self.frame.size.height * 0.5f};
-
-    CGRect frame = CGRectZero;
-    CGFloat y = 0.0f;
-
-    // Title View
-    if (self.titleView) {
-        frame = self.titleView.frame;
-        frame.origin.y = y;
-        frame.origin.x = midViewSize.width - (CGRectGetWidth(frame) * 0.5f);
-        self.titleView.frame = CGRectIntegral(frame);
-
-        y = CGRectGetMaxY(frame) + self.currentLayout.titleViewBottomSpacing;
-    }
-
-    // Title Label
-    frame = self.titleLabel.frame;
-    frame.origin.y = y;
-    frame.origin.x = midViewSize.width - (CGRectGetWidth(frame) * 0.5f);
-    self.titleLabel.frame = CGRectIntegral(frame);
-
-    y = CGRectGetMaxY(frame) + self.currentLayout.titleLabelBottomSpacing;
-
-    // Circle Row View
-    [self.inputField sizeToFit];
-    frame = self.inputField.frame;
-    frame.origin.y = y;
-    frame.origin.x = midViewSize.width - (CGRectGetWidth(frame) * 0.5f);
-    self.inputField.frame = CGRectIntegral(frame);
-
-    y = CGRectGetMaxY(frame) + self.currentLayout.circleRowBottomSpacing;
-
-    // PIN Pad View
-    if (self.keypadView) {
-        frame = self.keypadView.frame;
-        frame.origin.y = y;
-        frame.origin.x = midViewSize.width - (CGRectGetWidth(frame) * 0.5f);
-        self.keypadView.frame = CGRectIntegral(frame);
-    }
-
-    // If the keypad view is hidden, lay out the left button manually
-    if (!self.keypadView && self.leftButton) {
-        frame = self.leftButton.frame;
-        frame.origin.x = 0.0f;
-        frame.origin.y = y;
-        self.leftButton.frame = frame;
-    }
-
-    // If the keypad view is hidden, lay out the right button manually
-    if (!self.keypadView && self.rightButton) {
-        frame = self.rightButton.frame;
-        frame.origin.x = viewSize.width - frame.size.width;
-        frame.origin.y = y;
-        self.rightButton.frame = frame;
-    }
-}
-
-- (void)horizontallyLayoutSubviews
-{
-    CGSize midViewSize = (CGSize){self.frame.size.width * 0.5f, self.frame.size.height * 0.5f};
-    CGRect frame = CGRectZero;
-
-    // Work out the y offset, assuming the input field is in the middle
-    frame.origin.y = midViewSize.height - (self.inputField.frame.size.height * 0.5f);
-    frame.origin.y -= (self.titleLabel.frame.size.height + self.currentLayout.titleLabelHorizontalBottomSpacing);
-
-    // Include offset for title view if present
-    if (self.titleView) {
-        frame.origin.y -= (self.titleView.frame.size.height + self.currentLayout.titleViewHorizontalBottomSpacing);
-    }
-
-    // Set initial Y offset
-    frame.origin.y = MAX(frame.origin.y, 0.0f);
-
-    // Set frame of title view
-    if (self.titleView) {
-        frame.size = self.titleView.frame.size;
-        frame.origin.x = (self.currentLayout.titleHorizontalLayoutWidth - frame.size.width) * 0.5f;
-        self.titleView.frame = CGRectIntegral(frame);
-
-        frame.origin.y += (frame.size.height + self.currentLayout.titleViewHorizontalBottomSpacing);
-    }
-
-    // Set frame of title label
-    frame.size = self.titleLabel.frame.size;
-    frame.origin.x = (self.currentLayout.titleHorizontalLayoutWidth - frame.size.width) * 0.5f;
-    self.titleLabel.frame = CGRectIntegral(frame);
-
-    frame.origin.y += (frame.size.height + self.currentLayout.titleLabelHorizontalBottomSpacing);
-
-    // Set frame of the input field
-    frame.size = self.inputField.frame.size;
-    frame.origin.x = (self.currentLayout.titleHorizontalLayoutWidth - frame.size.width) * 0.5f;
-    self.inputField.frame = CGRectIntegral(frame);
-
-    // Set the frame of the keypad view
-    frame.size = self.keypadView.frame.size;
-    frame.origin.y = 0.0f;
-    frame.origin.x = self.currentLayout.titleHorizontalLayoutWidth + self.currentLayout.titleHorizontalLayoutSpacing;
-    self.keypadView.frame = CGRectIntegral(frame);
-}
-
-- (void)layoutSubviews
-{
-    if (self.horizontalLayout) {
-        [self horizontallyLayoutSubviews];
-    }
-    else {
-        [self verticallyLayoutSubviews];
-    }
-}
-
-- (void)sizeToFitSize:(CGSize)size
-{
-    CGFloat width = size.width;
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
-        width = MIN(size.width, size.height);
-    }
-
-    NSMutableArray *layouts = [NSMutableArray array];
-    [layouts addObject:self.defaultContentLayout];
-    [layouts addObjectsFromArray:self.contentLayouts];
-
-    // Loop through each layout (in ascending order) and pick the best one to fit this view
-    TOPasscodeViewContentLayout *contentLayout = self.defaultContentLayout;
-    for (TOPasscodeViewContentLayout *layout in layouts) {
-        if (width >= layout.viewWidth) {
-            contentLayout = layout;
-            break;
-        }
-    }
-
-    // Set the new layout
-    self.currentLayout = contentLayout;
-
-    // Resize the views to fit
-    [self sizeToFit];
-}
-
-- (void)verticalSizeToFit
-{
-    CGRect frame = self.frame;
-    frame.size.width = 0.0f;
-    frame.size.height = 0.0f;
-
-    [self.keypadView sizeToFit];
-    [self.inputField sizeToFit];
-
-    if (self.keypadView) {
-        frame.size.width = self.keypadView.frame.size.width;
-    }
-    else {
-        frame.size.width = self.inputField.frame.size.width;
-    }
-
-    // Add height for the title view
-    if (self.titleView) {
-        frame.size.height += self.titleView.frame.size.height;
-        frame.size.height += self.currentLayout.titleViewBottomSpacing;
-    }
-
-    // Add height for the title label
-    CGRect titleFrame = self.titleLabel.frame;
-    titleFrame.size = [self.titleLabel sizeThatFits:(CGSize){frame.size.width, CGFLOAT_MAX}];
-    self.titleLabel.frame = titleFrame;
-
-    frame.size.height += titleFrame.size.height;
-    frame.size.height += self.currentLayout.titleLabelBottomSpacing;
-
-    // Add height for the circle rows
-    frame.size.height += self.inputField.frame.size.height;
-    frame.size.height += self.currentLayout.circleRowBottomSpacing;
-
-    // Add height for the keypad
-    if (self.keypadView) {
-        frame.size.height += self.keypadView.frame.size.height;
-    }
-    else { // If no keypad, just factor in the accessory buttons
-        [self.leftButton sizeToFit];
-        [self.rightButton sizeToFit];
-
-        CGFloat maxHeight = 0.0f;
-        maxHeight = MAX(self.leftButton.frame.size.height, 0.0f);
-        maxHeight = MAX(self.rightButton.frame.size.height, maxHeight);
-
-        frame.size.height += maxHeight;
-    }
-
-    // Add extra padding at the bottom
-    frame.size.height += self.currentLayout.bottomPadding;
-
-    // Set the frame back
-    self.frame = CGRectIntegral(frame);
-}
-
-- (void)horizontalSizeToFit
-{
-    CGRect frame = self.frame;
-
-    [self.keypadView sizeToFit];
-    [self.inputField sizeToFit];
-
-    frame.size.width = self.currentLayout.titleHorizontalLayoutWidth;
-    frame.size.width += self.currentLayout.titleHorizontalLayoutSpacing;
-    frame.size.width += self.keypadView.frame.size.width;
-
-    frame.size.height = self.keypadView.frame.size.height;
-
-    self.frame = CGRectIntegral(frame);
-}
-
-- (void)sizeToFit
-{
-    if (self.horizontalLayout && self.passcodeType != TOPasscodeTypeCustomAlphanumeric) {
-        [self horizontalSizeToFit];
-    }
-    else {
-        [self verticalSizeToFit];
-    }
-}
-
-#pragma mark - View Setup -
-- (void)setUpViewForType:(TOPasscodeType)type
-{
-    __weak typeof(self) weakSelf = self;
-
-    self.backgroundColor = [UIColor clearColor];
-
-    // Set up title label
-    if (self.titleLabel == nil) {
-        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
-    }
-    self.titleLabel.text = self.titleText;
-    self.titleLabel.textAlignment = NSTextAlignmentCenter;
-    self.titleLabel.numberOfLines = 0;
-    [self.titleLabel sizeToFit];
-    [self addSubview:self.titleLabel];
-
-    // Set up the passcode style
-    TOPasscodeInputFieldStyle style = TOPasscodeInputFieldStyleFixed;
-    if (type >= TOPasscodeTypeCustomNumeric) {
-        style = TOPasscodeInputFieldStyleVariable;
-    }
-
-    // Set up input field
-    if (self.inputField == nil) {
-        self.inputField = [[TOPasscodeInputField alloc] initWithStyle:style];
-    }
-    self.inputField.passcodeCompletedHandler = ^(NSString *passcode) {
-        if (weakSelf.passcodeCompletedHandler) {
-            weakSelf.passcodeCompletedHandler(passcode);
-        }
-    };
-
-    // Configure the input field based on the exact passcode type
-    if (style == TOPasscodeInputFieldStyleFixed) {
-        self.inputField.fixedInputView.length = (self.passcodeType == TOPasscodeTypeSixDigits) ? 6 : 4;
-    }
-    else {
-        self.inputField.showSubmitButton = (self.passcodeType == TOPasscodeTypeCustomNumeric);
-        self.inputField.enabled = (self.passcodeType == TOPasscodeTypeCustomAlphanumeric);
-    }
-
-    [self addSubview:self.inputField];
-
-    // Set up pad row
-    if (type != TOPasscodeTypeCustomAlphanumeric) {
-        if (self.keypadView == nil) {
-            self.keypadView = [[TOPasscodeKeypadView alloc] init];
-        }
-        self.keypadView.buttonTappedHandler = ^(NSInteger button) {
-            NSString *numberString = [NSString stringWithFormat:@"%ld", (long)button];
-            [weakSelf.inputField appendPasscodeCharacters:numberString animated:NO];
-
-            if (weakSelf.passcodeDigitEnteredHandler) {
-                weakSelf.passcodeDigitEnteredHandler();
-            }
-        };
-        [self addSubview:self.keypadView];
-    }
-    else {
-        [self.keypadView removeFromSuperview];
-        self.keypadView = nil;
-    }
-}
-
-- (void)updateSubviewsForContentLayout:(TOPasscodeViewContentLayout *)contentLayout
-{
-    // Title View
-    self.titleLabel.font = contentLayout.titleLabelFont;
-
-    // Circle Row View
-    self.inputField.fixedInputView.circleDiameter = contentLayout.circleRowDiameter;
-    self.inputField.fixedInputView.circleSpacing = contentLayout.circleRowSpacing;
-
-    // Text Field Input Row
-    NSInteger maximumInputLength = (self.passcodeType == TOPasscodeTypeCustomAlphanumeric) ?
-                                            contentLayout.textFieldAlphanumericCharacterLength :
-                                            contentLayout.textFieldNumericCharacterLength;
-
-    self.inputField.variableInputView.outlineThickness = contentLayout.textFieldBorderThickness;
-    self.inputField.variableInputView.outlineCornerRadius = contentLayout.textFieldBorderRadius;
-    self.inputField.variableInputView.circleDiameter = contentLayout.textFieldCircleDiameter;
-    self.inputField.variableInputView.circleSpacing = contentLayout.textFieldCircleSpacing;
-    self.inputField.variableInputView.outlinePadding = contentLayout.textFieldBorderPadding;
-    self.inputField.variableInputView.maximumVisibleLength = maximumInputLength;
-
-    // Submit button
-    self.inputField.submitButtonSpacing = contentLayout.submitButtonSpacing;
-    self.inputField.submitButtonFontSize = contentLayout.submitButtonFontSize;
-
-    // Keypad
-    self.keypadView.buttonNumberFont = contentLayout.circleButtonTitleLabelFont;
-    self.keypadView.buttonLetteringFont = contentLayout.circleButtonLetteringLabelFont;
-    self.keypadView.buttonLetteringSpacing = contentLayout.circleButtonLetteringSpacing;
-    self.keypadView.buttonLabelSpacing = contentLayout.circleButtonLabelSpacing;
-    self.keypadView.buttonSpacing = contentLayout.circleButtonSpacing;
-    self.keypadView.buttonDiameter = contentLayout.circleButtonDiameter;
-}
-
-- (void)applyThemeForStyle:(TOPasscodeViewStyle)style
-{
-    BOOL isTranslucent = TOPasscodeViewStyleIsTranslucent(style);
-    BOOL isDark = TOPasscodeViewStyleIsDark(style);
-
-    // Set title label color
-    UIColor *titleLabelColor = self.titleLabelColor;
-    if (titleLabelColor == nil) {
-        titleLabelColor = isDark ? [UIColor whiteColor] : [UIColor blackColor];
-    }
-    self.titleLabel.textColor = titleLabelColor;
-
-    // Add/remove the translucency effect to the buttons
-    if (isTranslucent) {
-        UIBlurEffect *blurEffect = [self blurEffectForStyle:style];
-        UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect:blurEffect];
-        self.inputField.visualEffectView.effect = vibrancyEffect;
-        self.keypadView.vibrancyEffect = vibrancyEffect;
-    }
-    else {
-        self.inputField.visualEffectView.effect = nil;
-        self.keypadView.vibrancyEffect = nil;
-    }
-
-    // Set keyboard style of the input field
-    self.inputField.keyboardAppearance = isDark ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault;
-
-    UIColor *defaultTintColor = isDark ? [UIColor colorWithWhite:0.85 alpha:1.0f] : [UIColor colorWithWhite:0.3 alpha:1.0f];
-    
-    // Set the tint color of the circle row view
-    UIColor *circleRowColor = self.inputProgressViewTintColor;
-    if (circleRowColor == nil) {
-        circleRowColor = defaultTintColor;
-    }
-    self.inputField.tintColor = defaultTintColor;
-
-    // Set the tint color of the keypad buttons
-    UIColor *keypadButtonBackgroundColor = self.keypadButtonBackgroundColor;
-    if (keypadButtonBackgroundColor == nil) {
-        keypadButtonBackgroundColor = defaultTintColor;
-    }
-    self.keypadView.buttonBackgroundColor = keypadButtonBackgroundColor;
-
-    // Set the color of the keypad button labels
-    UIColor *buttonTextColor = self.keypadButtonTextColor;
-    if (buttonTextColor == nil) {
-        buttonTextColor = isDark ? [UIColor whiteColor] : [UIColor blackColor];
-    }
-    self.keypadView.buttonTextColor = buttonTextColor;
-
-    // Set the highlight color of the keypad button
-    UIColor *buttonHighlightedTextColor = self.keypadButtonHighlightedTextColor;
-    if (buttonHighlightedTextColor == nil) {
-        if (isTranslucent) {
-            buttonHighlightedTextColor = isDark ? nil : [UIColor whiteColor];
-        }
-        else {
-            buttonHighlightedTextColor = isDark ? [UIColor blackColor] : [UIColor whiteColor];
-        }
-    }
-    self.keypadView.buttonHighlightedTextColor = buttonHighlightedTextColor;
-}
-
-#pragma mark - Passcode Management -
-- (void)resetPasscodeAnimated:(BOOL)animated playImpact:(BOOL)impact
-{
-    [self.inputField resetPasscodeAnimated:animated playImpact:impact];
-}
-
-- (void)deleteLastPasscodeCharacterAnimated:(BOOL)animated
-{
-    [self.inputField deletePasscodeCharactersOfCount:1 animated:animated];
-}
-
-#pragma mark - Internal Style Management -
-- (UIBlurEffect *)blurEffectForStyle:(TOPasscodeViewStyle)style
-{
-    switch (style) {
-        case TOPasscodeViewStyleTranslucentDark:
-            return [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
-        case TOPasscodeViewStyleTranslucentLight:
-            return [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];
-        default: return nil;
-    }
-
-    return nil;
-}
-
-#pragma mark - Accessors -
-- (void)setHorizontalLayout:(BOOL)horizontalLayout
-{
-    [self setHorizontalLayout:horizontalLayout animated:NO duration:0.0f];
-}
-
-- (void)setHorizontalLayout:(BOOL)horizontalLayout animated:(BOOL)animated duration:(CGFloat)duration
-{
-    if (horizontalLayout == _horizontalLayout) { return; }
-    _horizontalLayout = horizontalLayout;
-    [self.keypadView setHorizontalLayout:horizontalLayout animated:animated duration:duration];
-    [self.inputField setHorizontalLayout:horizontalLayout animated:animated duration:duration];
-}
-
-- (void)setDefaultContentLayout:(TOPasscodeViewContentLayout *)defaultContentLayout
-{
-    if (defaultContentLayout == _defaultContentLayout) { return; }
-    _defaultContentLayout = defaultContentLayout;
-
-    if (!_defaultContentLayout) {
-        _defaultContentLayout = [TOPasscodeViewContentLayout defaultScreenContentLayout];
-    }
-}
-
-- (void)setCurrentLayout:(TOPasscodeViewContentLayout *)currentLayout
-{
-    if (_currentLayout == currentLayout) { return; }
-    _currentLayout = currentLayout;
-
-    // Update the views
-    [self updateSubviewsForContentLayout:currentLayout];
-}
-
-- (void)setStyle:(TOPasscodeViewStyle)style
-{
-    if (style == _style) { return; }
-    _style = style;
-    [self applyThemeForStyle:style];
-}
-
-- (void)setTitleLabelColor:(UIColor *)titleLabelColor
-{
-    if (titleLabelColor == _titleLabelColor) { return; }
-    _titleLabelColor = titleLabelColor;
-    self.titleLabel.textColor = titleLabelColor;
-}
-
-- (void)setInputProgressViewTintColor:(UIColor *)inputProgressViewTintColor
-{
-    if (inputProgressViewTintColor == _inputProgressViewTintColor) { return; }
-    _inputProgressViewTintColor = inputProgressViewTintColor;
-    self.inputField.tintColor = inputProgressViewTintColor;
-}
-
-- (void)setKeypadButtonBackgroundColor:(UIColor *)keypadButtonBackgroundColor
-{
-    if (keypadButtonBackgroundColor == _keypadButtonBackgroundColor) { return; }
-    _keypadButtonBackgroundColor = keypadButtonBackgroundColor;
-    self.keypadView.buttonBackgroundColor = keypadButtonBackgroundColor;
-}
-
-- (void)setKeypadButtonTextColor:(UIColor *)keypadButtonTextColor
-{
-    if (keypadButtonTextColor == _keypadButtonTextColor) { return; }
-    _keypadButtonTextColor = keypadButtonTextColor;
-    self.keypadView.buttonTextColor = keypadButtonTextColor;
-}
-
-- (void)setKeypadButtonHighlightedTextColor:(UIColor *)keypadButtonHighlightedTextColor
-{
-    if (keypadButtonHighlightedTextColor == _keypadButtonHighlightedTextColor) { return; }
-    _keypadButtonHighlightedTextColor = keypadButtonHighlightedTextColor;
-    self.keypadView.buttonHighlightedTextColor = keypadButtonHighlightedTextColor;
-}
-
-- (void)setLeftButton:(UIButton *)leftButton
-{
-    if (leftButton == _leftButton) { return; }
-    _leftButton = leftButton;
-
-    if (self.keypadView) {
-        self.keypadView.leftAccessoryView = leftButton;
-    }
-    else {
-        [self addSubview:_leftButton];
-    }
-}
-
-- (void)setRightButton:(UIButton *)rightButton
-{
-    if (rightButton == _rightButton) { return; }
-    _rightButton = rightButton;
-
-    if (self.keypadView) {
-        self.keypadView.rightAccessoryView = rightButton;
-    }
-    else {
-        [self addSubview:_rightButton];
-    }
-}
-
-- (CGFloat)keypadButtonInset
-{
-    UIView *button = self.keypadView.keypadButtons.firstObject;
-    return CGRectGetMidX(button.frame);
-}
-
-- (void)setContentAlpha:(CGFloat)contentAlpha
-{
-    _contentAlpha = contentAlpha;
-
-    self.titleView.alpha = contentAlpha;
-    self.titleLabel.alpha = contentAlpha;
-    self.inputField.contentAlpha = contentAlpha;
-    self.keypadView.contentAlpha = contentAlpha;
-    self.leftButton.alpha = contentAlpha;
-    self.rightButton.alpha = contentAlpha;
-}
-
-- (void)setPasscode:(NSString *)passcode
-{
-    [self.inputField setPasscode:passcode];
-}
-
-- (NSString *)passcode
-{
-    return self.inputField.passcode;
-}
-
-@end

+ 0 - 45
Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadButton.h

@@ -1,45 +0,0 @@
-//
-//  TOPasscodeSettingsKeypadButton.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-@class TOPasscodeButtonLabel;
-
-/**
- A single button view that is used in a number keypad views styled in
- a pseudo-skeuomorphic style.
- */
-@interface TOPasscodeSettingsKeypadButton : UIButton
-
-/** Background Images */
-@property (nonatomic, strong) UIImage *buttonBackgroundImage;
-@property (nonatomic, strong) UIImage *buttonTappedBackgroundImage;
-
-/* Inset of the label view from the bottom to account for the bevel */
-@property (nonatomic, assign) CGFloat bottomInset;
-
-/* The button label containing the number and lettering */
-@property (nonatomic, readonly) TOPasscodeButtonLabel *buttonLabel;
-
-+ (TOPasscodeSettingsKeypadButton *)button;
-
-@end

+ 0 - 103
Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadButton.m

@@ -1,103 +0,0 @@
-//
-//  TOPasscodeSettingsKeypadButton.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeSettingsKeypadButton.h"
-#import "TOPasscodeButtonLabel.h"
-
-@interface TOPasscodeSettingsKeypadButton ()
-
-@property (nonatomic, strong, readwrite) TOPasscodeButtonLabel *buttonLabel;
-
-@end
-
-@implementation TOPasscodeSettingsKeypadButton
-
-+ (TOPasscodeSettingsKeypadButton *)button
-{
-    TOPasscodeSettingsKeypadButton *button = [TOPasscodeSettingsKeypadButton buttonWithType:UIButtonTypeCustom];
-    button.frame = CGRectMake(0,0,100,60);
-    return button;
-}
-
-#pragma mark - Lazy Accessor -
-- (TOPasscodeButtonLabel *)buttonLabel
-{
-    if (_buttonLabel) { return _buttonLabel; }
-
-    CGRect frame = self.bounds;
-    frame.size.height -= self.bottomInset;
-
-    _buttonLabel = [[TOPasscodeButtonLabel alloc] initWithFrame:frame];
-    _buttonLabel.userInteractionEnabled = NO;
-    _buttonLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self addSubview:_buttonLabel];
-
-    return _buttonLabel;
-}
-
-#pragma mark - Layout Accessor -
-- (void)setBottomInset:(CGFloat)bottomInset
-{
-    _bottomInset = bottomInset;
-
-    CGRect frame = self.bounds;
-    frame.size.height -= _bottomInset;
-    self.buttonLabel.frame = frame;
-    [self setNeedsLayout];
-}
-
-#pragma mark - Control Accessor -
-- (void)setEnabled:(BOOL)enabled
-{
-    [super setEnabled:enabled];
-    self.buttonLabel.alpha = enabled ? 1.0f : 0.5f;
-}
-
-#pragma mark - Background Image Accessor -
-
-- (void)setHighlighted:(BOOL)highlighted {
-    [self.layer removeAllAnimations];
-    [UIView transitionWithView:self
-                      duration:0.25
-                       options:UIViewAnimationOptionTransitionCrossDissolve |
-                                 UIViewAnimationOptionAllowAnimatedContent |
-                                 UIViewAnimationOptionAllowUserInteraction
-                    animations:^{
-        [super setHighlighted:highlighted];
-    } completion:nil];
-}
-
-- (void)setButtonBackgroundImage:(UIImage *)buttonBackgroundImage
-{
-    [self setBackgroundImage:buttonBackgroundImage forState:UIControlStateNormal];
-}
-
-- (UIImage *)buttonBackgroundImage { return [self backgroundImageForState:UIControlStateNormal]; }
-
-- (void)setButtonTappedBackgroundImage:(UIImage *)buttonTappedBackgroundImage
-{
-    [self setBackgroundImage:buttonTappedBackgroundImage forState:UIControlStateHighlighted];
-}
-
-- (UIImage *)buttonTappedBackgroundImage { return [self backgroundImageForState:UIControlStateHighlighted]; }
-
-@end

+ 0 - 74
Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadView.h

@@ -1,74 +0,0 @@
-//
-//  TOPasscodeSettingsKeypadView.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-#import "TOPasscodeViewControllerConstants.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A keypad view of 9 buttons that allow numerical input on both iPad and iPhone.
- Designed to match the base system, with a pseudo-skeuomorphical styling.
- */
-@interface TOPasscodeSettingsKeypadView : UIView
-
-/* Whether the control is allowing input */
-@property (nonatomic, assign) BOOL enabled;
-
-/* Whether the view is currently light mode or dark. */
-@property (nonatomic, assign) TOPasscodeSettingsViewStyle style;
-
-/* The color of the separator line */
-@property (nonatomic, strong) UIColor *separatorLineColor;
-
-/* Labels in the buttons are laid out horizontally */
-@property (nonatomic, assign) BOOL buttonLabelHorizontalLayout;
-
-/* If overridden, the foreground color of the buttons */
-@property (nonatomic, assign) CGFloat keypadButtonBorderThickness;
-
-/* Untapped background images */
-@property (nonatomic, strong, null_resettable) UIColor *keypadButtonForegroundColor;
-@property (nonatomic, strong, null_resettable) UIColor *keypadButtonBorderColor;
-
-/* Tapped background images */
-@property (nonatomic, strong, null_resettable) UIColor *keypadButtonTappedForegroundColor;
-@property (nonatomic, strong, nullable) UIColor *keypadButtonTappedBorderColor;
-
-/* Button label styling */
-@property (nonatomic, strong) UIFont *keypadButtonNumberFont;
-@property (nonatomic, strong) UIFont *keypadButtonLetteringFont;
-@property (nonatomic, strong) UIColor *keypadButtonLabelTextColor;
-@property (nonatomic, assign) CGFloat keypadButtonVerticalSpacing;
-@property (nonatomic, assign) CGFloat keypadButtonHorizontalSpacing;
-@property (nonatomic, assign) CGFloat keypadButtonLetteringSpacing;
-
-/* Callback handlers */
-@property (nonatomic, copy) void (^numberButtonTappedHandler)(NSInteger number);
-@property (nonatomic, copy) void (^deleteButtonTappedHandler)(void);
-
-/* In really small sizes, set the keypad labels to horizontal */
-- (void)setButtonLabelHorizontalLayout:(BOOL)horizontal animated:(BOOL)animated;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 395
Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadView.m

@@ -1,395 +0,0 @@
-//
-//  TOPasscodeSettingsKeypadView.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeSettingsKeypadView.h"
-#import "TOPasscodeSettingsKeypadButton.h"
-#import "TOPasscodeButtonLabel.h"
-#import "TOSettingsKeypadImage.h"
-
-const CGFloat kTOPasscodeSettingsKeypadButtonInnerSpacing = 7.0f;
-const CGFloat kTOPasscodeSettingsKeypadButtonOuterSpacing = 7.0f;
-const CGFloat kTOPasscodeSettingsKeypadCornderRadius = 12.0f;
-
-@interface TOPasscodeSettingsKeypadView ()
-
-@property (nonatomic, strong) UIView *separatorView;
-@property (nonatomic, strong) NSArray<TOPasscodeSettingsKeypadButton *> *keypadButtons;
-@property (nonatomic, strong) UIButton *deleteButton;
-
-@property (nonatomic, strong) UIImage *buttonBackgroundImage;
-@property (nonatomic, strong) UIImage *buttonTappedBackgroundImage;
-
-@end
-
-@implementation TOPasscodeSettingsKeypadView
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (void)setUp
-{
-    /* Button label styling */
-    _keypadButtonNumberFont = [UIFont systemFontOfSize:32.0f weight:UIFontWeightRegular];
-    _keypadButtonLetteringFont = [UIFont systemFontOfSize:11.0f weight:UIFontWeightRegular];
-    _keypadButtonVerticalSpacing = 2.0f;
-    _keypadButtonHorizontalSpacing = 3.0f;
-    _keypadButtonLetteringSpacing = 2.0f;
-
-    CGSize viewSize = self.frame.size;
-    CGFloat height = 1.0f / [[UIScreen mainScreen] scale];
-    self.separatorView = [[UIView alloc] initWithFrame:(CGRect){CGPointZero,{viewSize.width, height}}];
-    self.separatorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self addSubview:self.separatorView];
-
-    [self setUpKeypadButtons];
-    [self setUpDeleteButton];
-
-    [self setUpDefaultValuesForStye:_style];
-    [self applyTheme];
-}
-
-- (void)setUpKeypadButtons
-{
-    NSInteger numberOfButtons = 10;
-    NSArray *letteredTitles = @[@"ABC", @"DEF", @"GHI", @"JKL",
-                                @"MNO", @"PQRS", @"TUV", @"WXYZ"];
-
-    NSMutableArray *buttons = [NSMutableArray arrayWithCapacity:10];
-    for (NSInteger i = 0; i < numberOfButtons; i++) {
-        NSInteger number = (i+1) % 10; // Wrap around 0 at the end
-        TOPasscodeSettingsKeypadButton *button = [TOPasscodeSettingsKeypadButton button];
-        button.buttonLabel.numberString = [NSString stringWithFormat:@"%ld", (long)number];
-        button.bottomInset = 2.0f;
-        button.tag = number;
-
-        if (i > 0) {
-            NSInteger j = i - 1;
-            if (j < letteredTitles.count) {
-                button.buttonLabel.letteringString = letteredTitles[j];
-            }
-        }
-
-        [button addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchDown];
-
-        [self addSubview:button];
-        [buttons addObject:button];
-    }
-
-    self.keypadButtons = [NSArray arrayWithArray:buttons];
-}
-
-- (void)setUpDeleteButton
-{
-    UIImage *deleteIcon = [TOSettingsKeypadImage deleteIcon];
-    self.deleteButton = [UIButton buttonWithType:UIButtonTypeSystem];
-    [self.deleteButton setImage:deleteIcon forState:UIControlStateNormal];
-    self.deleteButton.contentMode = UIViewContentModeCenter;
-    self.deleteButton.frame = (CGRect){CGPointZero, deleteIcon.size};
-    self.deleteButton.tintColor = [UIColor blackColor];
-    [self.deleteButton addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside];
-    [self addSubview:self.deleteButton];
-}
-
-- (void)setUpDefaultValuesForStye:(TOPasscodeSettingsViewStyle)style
-{
-    BOOL isDark = style == TOPasscodeSettingsViewStyleDark;
-
-    // Keypad label
-    self.keypadButtonLabelTextColor = isDark ? [UIColor whiteColor] : [UIColor blackColor];
-
-    self.keypadButtonForegroundColor = isDark ? [UIColor colorWithWhite:0.35f alpha:1.0f] : [UIColor whiteColor];
-    self.keypadButtonTappedForegroundColor = isDark ? [UIColor colorWithWhite:0.45f alpha:1.0f] : [UIColor colorWithWhite:0.85f alpha:1.0f];
-
-    // Button border color
-    UIColor *borderColor = nil;
-    if (isDark) {
-        borderColor = [UIColor colorWithWhite:0.15f alpha:1.0f];
-    }
-    else {
-        borderColor = [UIColor colorWithRed:166.0f/255.0f green:174.0f/255.0f blue:186.0f/255.0f alpha:1.0f];
-    }
-    self.keypadButtonBorderColor = borderColor;
-
-    // Background Color
-    UIColor *backgroundColor = nil;
-    if (isDark) {
-        backgroundColor = [UIColor colorWithWhite:0.18f alpha:1.0f];
-    }
-    else {
-        backgroundColor = [UIColor colorWithRed:220.0f/255.0f green:225.0f/255.0f blue:232.0f/255.0f alpha:1.0f];
-    }
-    self.backgroundColor = backgroundColor;
-
-    // Separator lines
-    UIColor *separatorColor = nil;
-    if (isDark) {
-        separatorColor = [UIColor colorWithWhite:0.25f alpha:1.0f];
-    }
-    else {
-        separatorColor = [UIColor colorWithWhite:0.7f alpha:1.0f];
-    }
-    self.separatorView.backgroundColor = separatorColor;
-
-    self.deleteButton.tintColor = isDark ? [UIColor whiteColor] : [UIColor blackColor];
-}
-
-- (void)setUpImagesIfNeeded
-{
-    if (self.buttonBackgroundImage && self.buttonTappedBackgroundImage) {
-        return;
-    }
-
-    if (self.buttonBackgroundImage == nil) {
-        self.buttonBackgroundImage = [TOSettingsKeypadImage buttonImageWithCornerRadius:kTOPasscodeSettingsKeypadCornderRadius
-                                                                              foregroundColor:self.keypadButtonForegroundColor
-                                                                                    edgeColor:self.keypadButtonBorderColor
-                                                                                edgeThickness:2.0f];
-    }
-
-    if (self.buttonTappedBackgroundImage == nil) {
-        self.buttonTappedBackgroundImage = [TOSettingsKeypadImage buttonImageWithCornerRadius:kTOPasscodeSettingsKeypadCornderRadius
-                                                                              foregroundColor:self.keypadButtonTappedForegroundColor
-                                                                                    edgeColor:self.keypadButtonBorderColor
-                                                                                edgeThickness:2.0f];
-    }
-
-    for (TOPasscodeSettingsKeypadButton *button in self.keypadButtons) {
-        button.buttonBackgroundImage = self.buttonBackgroundImage;
-        button.buttonTappedBackgroundImage = self.buttonTappedBackgroundImage;
-    }
-}
-
-- (void)applyTheme
-{
-    for (TOPasscodeSettingsKeypadButton *button in self.keypadButtons) {
-        button.buttonLabel.textColor = self.keypadButtonLabelTextColor;
-        button.buttonLabel.letteringCharacterSpacing = self.keypadButtonLetteringSpacing;
-        button.buttonLabel.letteringVerticalSpacing = self.keypadButtonVerticalSpacing;
-        button.buttonLabel.letteringHorizontalSpacing = self.keypadButtonHorizontalSpacing;
-        button.buttonLabel.numberLabelFont = self.keypadButtonNumberFont;
-        button.buttonLabel.letteringLabelFont = self.keypadButtonLetteringFont;
-    }
-}
-
-- (void)layoutSubviews
-{
-    [super layoutSubviews];
-    [self setUpImagesIfNeeded];
-
-    CGFloat outerSpacing = kTOPasscodeSettingsKeypadButtonOuterSpacing;
-    CGFloat innerSpacing = kTOPasscodeSettingsKeypadButtonInnerSpacing;
-
-    CGSize viewSize = self.bounds.size;
-    CGSize buttonSize = CGSizeZero;
-
-    viewSize.width -= (outerSpacing * 2.0f);
-    viewSize.height -= (outerSpacing * 2.0f);
-    
-    // Pull the buttons up to avoid overlapping the home indicator on iPhone X
-    if (@available(iOS 11.0, *)) {
-        viewSize.height -= self.safeAreaInsets.bottom;
-    }
-
-    // Four rows of three buttons
-    buttonSize.width = floorf((viewSize.width - (innerSpacing * 2.0f)) / 3.0f);
-    buttonSize.height = floorf((viewSize.height - (innerSpacing * 3.0f)) / 4.0f);
-
-    CGPoint point = CGPointMake(outerSpacing, outerSpacing);
-    CGRect buttonFrame = (CGRect){point, buttonSize};
-
-    NSInteger i = 0;
-    for (TOPasscodeSettingsKeypadButton *button in self.keypadButtons) {
-        button.frame = buttonFrame;
-        buttonFrame.origin.x += buttonFrame.size.width + innerSpacing;
-
-        if (++i % 3 == 0) {
-            buttonFrame.origin.x = outerSpacing;
-            buttonFrame.origin.y += buttonFrame.size.height + innerSpacing;
-        }
-
-        if (button == self.keypadButtons.lastObject) {
-            button.frame = buttonFrame;
-        }
-    }
-
-    //Layout delete button
-    CGSize boundsSize = self.bounds.size;
-    
-    // Adjust for home indicator on iPhone X
-    if (@available(iOS 11.0, *)) {
-        boundsSize.height -= self.safeAreaInsets.bottom;
-    }
-    
-    CGRect frame = self.deleteButton.frame;
-    frame.size = buttonSize;
-    frame.origin.x = boundsSize.width - (outerSpacing + buttonSize.width * 0.5f);
-    frame.origin.x -= (CGRectGetWidth(frame) * 0.5f);
-    frame.origin.y = boundsSize.height - (outerSpacing + buttonSize.height * 0.5f);
-    frame.origin.y -= (CGRectGetHeight(frame) * 0.5f);
-    self.deleteButton.frame = frame;
-}
-
-#pragma mark - Interaction -
-- (void)buttonTapped:(id)sender
-{
-    // Handler for the delete button
-    if (sender == self.deleteButton) {
-        if (self.deleteButtonTappedHandler) {
-            self.deleteButtonTappedHandler();
-        }
-        return;
-    }
-
-    // Handler for the keypad buttons
-    UIButton *button = (UIButton *)sender;
-    NSInteger number = button.tag;
-
-    [[UIDevice currentDevice] playInputClick];
-
-    if (self.numberButtonTappedHandler) {
-        self.numberButtonTappedHandler(number);
-    }
-}
-
-#pragma mark - Accessors -
-
-- (void)setStyle:(TOPasscodeSettingsViewStyle)style
-{
-    if (style == _style) {
-        return;
-    }
-
-    _style = style;
-    [self setUpDefaultValuesForStye:_style];
-    [self applyTheme];
-}
-
-#pragma mark - Label Layout -
-- (void)setButtonLabelHorizontalLayout:(BOOL)buttonLabelHorizontalLayout
-{
-    [self setButtonLabelHorizontalLayout:buttonLabelHorizontalLayout animated:NO];
-}
-
-- (void)setButtonLabelHorizontalLayout:(BOOL)horizontal animated:(BOOL)animated
-{
-    if (horizontal == _buttonLabelHorizontalLayout) { return; }
-
-    _buttonLabelHorizontalLayout = horizontal;
-
-    for (TOPasscodeSettingsKeypadButton *button in self.keypadButtons) {
-        if (!animated) {
-            button.buttonLabel.horizontalLayout = horizontal;
-            continue;
-        }
-
-        UIView *snapshotView = [button.buttonLabel snapshotViewAfterScreenUpdates:NO];
-        snapshotView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
-        [button addSubview:snapshotView];
-
-        button.buttonLabel.horizontalLayout = horizontal;
-        [button.buttonLabel setNeedsLayout];
-        [button.buttonLabel layoutIfNeeded];
-
-        [button.buttonLabel.layer removeAllAnimations];
-        for (CALayer *sublayer in button.buttonLabel.layer.sublayers) {
-            [sublayer removeAllAnimations];
-        }
-
-        button.buttonLabel.alpha = 0.0f;
-        [UIView animateWithDuration:0.4f animations:^{
-            button.buttonLabel.alpha = 1.0f;
-            snapshotView.alpha = 0.0f;
-            snapshotView.center = button.buttonLabel.center;
-        } completion:^(BOOL complete) {
-            [snapshotView removeFromSuperview];
-        }];
-    }
-}
-
-#pragma mark - Null Resettable Accessors -
-- (void)setKeypadButtonForegroundColor:(nullable UIColor *)keypadButtonForegroundColor
-{
-    if (keypadButtonForegroundColor == _keypadButtonForegroundColor) { return; }
-    _keypadButtonForegroundColor = keypadButtonForegroundColor;
-
-    if (_keypadButtonForegroundColor == nil) {
-        BOOL isDark = self.style == TOPasscodeSettingsViewStyleDark;
-        _keypadButtonForegroundColor = isDark ? [UIColor colorWithWhite:0.3f alpha:1.0f] : [UIColor whiteColor];
-    }
-
-    self.buttonBackgroundImage = nil;
-    [self setNeedsLayout];
-}
-
-- (void)setKeypadButtonBorderColor:(nullable UIColor *)keypadButtonBorderColor
-{
-    if (keypadButtonBorderColor == _keypadButtonBorderColor) { return; }
-    _keypadButtonBorderColor = keypadButtonBorderColor;
-
-    if (_keypadButtonBorderColor == nil) {
-        BOOL isDark = self.style == TOPasscodeSettingsViewStyleDark;
-        UIColor *borderColor = nil;
-        if (isDark) {
-            borderColor = [UIColor colorWithWhite:0.2 alpha:1.0f];
-        }
-        else {
-            borderColor = [UIColor colorWithRed:166.0f/255.0f green:174.0f/255.0f blue:186.0f/255.0f alpha:1.0f];
-        }
-        _keypadButtonBorderColor = borderColor;
-    }
-
-    self.buttonBackgroundImage = nil;
-    [self setNeedsLayout];
-}
-
-- (void)setKeypadButtonTappedForegroundColor:(nullable UIColor *)keypadButtonTappedForegroundColor
-{
-    if (keypadButtonTappedForegroundColor == _keypadButtonTappedForegroundColor) { return; }
-    _keypadButtonTappedForegroundColor = keypadButtonTappedForegroundColor;
-
-    if (_keypadButtonTappedForegroundColor == nil) {
-        BOOL isDark = self.style == TOPasscodeSettingsViewStyleDark;
-        _keypadButtonTappedForegroundColor = isDark ? [UIColor colorWithWhite:0.4f alpha:1.0f] : [UIColor colorWithWhite:0.85f alpha:1.0f];
-    }
-
-    self.buttonTappedBackgroundImage = nil;
-    [self setNeedsLayout];
-}
-
-- (void)setEnabled:(BOOL)enabled
-{
-    _enabled = enabled;
-
-    for (TOPasscodeSettingsKeypadButton *button in self.keypadButtons) {
-        button.enabled = enabled;
-    }
-
-    self.deleteButton.enabled = enabled;
-}
-
-@end

+ 0 - 43
Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsWarningLabel.h

@@ -1,43 +0,0 @@
-//
-//  TOPasscodeSettingsWarningLabel.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-/**
- When a user enters an incorrect passcode in the settings interface,
- this view is displayed to show the number of failed attempts.
- */
-@interface TOPasscodeSettingsWarningLabel : UIImageView
-
-/** The number of incorrect passcode attempts to display */
-@property (nonatomic, assign) NSInteger numberOfWarnings;
-
-/** The font of the text */
-@property (nonatomic, strong) UIFont *textFont;
-
-/** The background color of the view */
-@property (nonatomic, strong) UIColor *backgroundColor;
-
-/** Set the padding around the label */
-@property (nonatomic, assign) CGSize textPadding;
-
-@end

+ 0 - 154
Libraries external/TOPasscodeViewController/Views/Settings/TOPasscodeSettingsWarningLabel.m

@@ -1,154 +0,0 @@
-//
-//  TOPasscodeSettingsWarningLabel.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeSettingsWarningLabel.h"
-
-@interface TOPasscodeSettingsWarningLabel ()
-@property (nonatomic, strong) UILabel *label;
-@end
-
-@implementation TOPasscodeSettingsWarningLabel
-
-@synthesize backgroundColor = __backgroundColor;
-
-#pragma mark - View Setup -
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        [self setUp];
-    }
-
-    return self;
-}
-
-- (void)setUp
-{
-    _numberOfWarnings = 0;
-    _textPadding = CGSizeMake(14.0f, 6.0f);
-
-    self.tintColor = [UIColor colorWithRed:214.0f/255.0f green:63.0f/255.0f blue:63.0f/255.0f alpha:1.0f];
-
-    self.label = [[UILabel alloc] initWithFrame:CGRectZero];
-    self.label.backgroundColor = [UIColor clearColor];
-    self.label.textAlignment = NSTextAlignmentCenter;
-    self.label.textColor = [UIColor whiteColor];
-    self.label.font = [UIFont systemFontOfSize:15.0f];
-    [self setTextForCount:0];
-    [self.label sizeToFit];
-    [self addSubview:self.label];
-}
-
-- (void)didMoveToSuperview
-{
-    [super didMoveToSuperview];
-    [self setBackgroundImageIfNeeded];
-}
-
-#pragma mark - View Layout -
-
-- (void)sizeToFit
-{
-    [super sizeToFit];
-    [self.label sizeToFit];
-
-    CGRect labelFrame = self.label.frame;
-    CGRect frame = self.frame;
-
-    labelFrame = CGRectInset(labelFrame, -self.textPadding.width, -self.textPadding.height);
-    frame.size = labelFrame.size;
-    self.frame = CGRectIntegral(frame);
-}
-
-- (void)layoutSubviews
-{
-    CGRect frame = self.frame;
-    CGRect labelFrame = self.label.frame;
-
-    labelFrame.origin.x = (CGRectGetWidth(frame) - CGRectGetWidth(labelFrame)) * 0.5f;
-    labelFrame.origin.y = (CGRectGetHeight(frame) - CGRectGetHeight(labelFrame)) * 0.5f;
-    self.label.frame = labelFrame;
-}
-
-#pragma mark - View State Handling -
-
-- (void)setTextForCount:(NSInteger)count
-{
-    NSString *text = nil;
-    if (count == 1) {
-        text = NSLocalizedString(@"1 Failed Passcode Attempt", @"");
-    }
-    else {
-        text = [NSString stringWithFormat:NSLocalizedString(@"%d Failed Passcode Attempts", @""), count];
-    }
-    self.label.text = text;
-
-    [self sizeToFit];
-}
-
-#pragma mark - Background Image Managements -
-
-- (void)setBackgroundImageIfNeeded
-{
-    // Don't bother if we're not in a view
-    if (self.superview == nil) { return; }
-
-    // Compare the view height and don't proceed if
-    if (lround(self.image.size.height) == lround(self.frame.size.height)) { return; }
-
-    // Create the image
-    self.image = [[self class] roundedBackgroundImageWithHeight:self.frame.size.height];
-}
-
-+ (UIImage *)roundedBackgroundImageWithHeight:(CGFloat)height
-{
-    UIImage *image = nil;
-    CGRect frame = CGRectZero;
-    frame.size.width = height + 1.0;
-    frame.size.height = height;
-
-    UIGraphicsBeginImageContextWithOptions(frame.size, NO, 0.0f);
-    {
-        UIBezierPath* path = [UIBezierPath bezierPathWithRoundedRect:frame cornerRadius:height * 0.5f];
-        [[UIColor blackColor] setFill];
-        [path fill];
-
-        image = UIGraphicsGetImageFromCurrentImageContext();
-    }
-    UIGraphicsEndImageContext();
-
-    CGFloat halfHeight = height * 0.5f;
-    UIEdgeInsets insets = UIEdgeInsetsMake(halfHeight, halfHeight, halfHeight, halfHeight);
-    image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
-    image = [image resizableImageWithCapInsets:insets];
-    return image;
-}
-
-#pragma mark - Accessors -
-
-- (void)setNumberOfWarnings:(NSInteger)numberOfWarnings
-{
-    _numberOfWarnings = numberOfWarnings;
-    [self setTextForCount:_numberOfWarnings];
-}
-
-@end

+ 0 - 61
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeButtonLabel.h

@@ -1,61 +0,0 @@
-//
-//  TOPasscodeButtonLabel.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A view that manages two label subviews: a larger label showing a single number
- and a smaller label showing lettering as well.
- */
-@interface TOPasscodeButtonLabel : UIView
-
-// Draws the lettering label to the side
-@property (nonatomic, assign) BOOL horizontalLayout;
-
-// The strings of both labels
-@property (nonatomic, copy) NSString *numberString;
-@property (nonatomic, copy, nullable) NSString *letteringString;
-
-// The color of both labels
-@property (nonatomic, strong) UIColor *textColor;
-
-// The label views
-@property (nonatomic, readonly) UILabel *numberLabel;
-@property (nonatomic, readonly) UILabel *letteringLabel;
-
-// The fonts for each label (In case they are nil)
-@property (nonatomic, strong) UIFont *numberLabelFont;
-@property (nonatomic, strong) UIFont *letteringLabelFont;
-
-// Has initial default values   
-@property (nonatomic, assign) CGFloat letteringCharacterSpacing;
-@property (nonatomic, assign) CGFloat letteringVerticalSpacing;
-@property (nonatomic, assign) CGFloat letteringHorizontalSpacing;
-
-// Whether the number label is centered vertically or not (NO by default)
-@property (nonatomic, assign) BOOL verticallyCenterNumberLabel;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 186
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeButtonLabel.m

@@ -1,186 +0,0 @@
-//
-//  TOPasscodeButtonLabel.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeButtonLabel.h"
-
-@interface TOPasscodeButtonLabel ()
-
-@property (nonatomic, strong, readwrite) UILabel *numberLabel;
-@property (nonatomic, strong, readwrite) UILabel *letteringLabel;
-
-@end
-
-@implementation TOPasscodeButtonLabel
-
-#pragma mark - View Setup -
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        _letteringVerticalSpacing = 6.0f;
-        _letteringCharacterSpacing = 3.0f;
-        _letteringHorizontalSpacing = 5.0f;
-        _numberLabelFont = [UIFont systemFontOfSize:37.5f weight:UIFontWeightThin];
-        _letteringLabelFont = [UIFont systemFontOfSize:9.0f weight:UIFontWeightThin];
-        [self setUpViews];
-    }
-
-    return self;
-}
-
-- (void)setUpViews
-{
-    if (!self.numberLabel) {
-        self.numberLabel = [[UILabel alloc] initWithFrame:CGRectZero];
-        self.numberLabel.text = self.numberString;
-        self.numberLabel.textColor = self.textColor;
-        self.numberLabel.font = self.numberLabelFont;
-        [self.numberLabel sizeToFit];
-        [self addSubview:self.numberLabel];
-    }
-
-    // Create the lettering string only if we have a lettering value for it
-    if (!self.letteringLabel && self.letteringString.length > 0) {
-        self.letteringLabel = [[UILabel alloc] initWithFrame:CGRectZero];
-        self.letteringLabel.textColor = self.textColor;
-        self.letteringLabel.font = self.letteringLabelFont;
-        [self.letteringLabel sizeToFit];
-        [self addSubview:self.letteringLabel];
-        [self updateLetteringLabelText];
-    }
-}
-
-#pragma mark - View Layout -
-
-- (void)updateLetteringLabelText
-{
-    if (self.letteringString.length == 0) {
-        return;
-    }
-
-    NSMutableAttributedString* attrStr = [[NSMutableAttributedString alloc] initWithString:self.letteringString];
-    [attrStr addAttribute:NSKernAttributeName value:@(_letteringCharacterSpacing) range:NSMakeRange(0, attrStr.length-1)];
-    self.letteringLabel.attributedText = attrStr;
-}
-
-- (void)layoutSubviews
-{
-    [super layoutSubviews];
-
-    CGSize viewSize = self.bounds.size;
-
-    [self.numberLabel sizeToFit];
-    [self.letteringLabel sizeToFit];
-
-    CGFloat numberVerticalHeight = self.numberLabelFont.capHeight;
-    CGFloat letteringVerticalHeight = self.letteringLabelFont.capHeight;
-    CGFloat textTotalHeight = (numberVerticalHeight+2.0f) + self.letteringVerticalSpacing + (letteringVerticalHeight+2.0f);
-
-    CGRect frame = self.numberLabel.frame;
-    frame.size.height = ceil(numberVerticalHeight) + 2.0f;
-    frame.origin.x = ceilf((viewSize.width - frame.size.width) * 0.5f);
-
-    if (!self.horizontalLayout && !self.verticallyCenterNumberLabel) {
-        frame.origin.y = floorf((viewSize.height - textTotalHeight) * 0.5f);
-    }
-    else {
-        frame.origin.y = floorf((viewSize.height - frame.size.height) * 0.5f);
-    }
-    self.numberLabel.frame = CGRectIntegral(frame);
-
-    if (self.letteringLabel) {
-        CGFloat y = CGRectGetMaxY(frame);
-        y += self.letteringVerticalSpacing;
-
-        frame = self.letteringLabel.frame;
-        frame.size.height = ceil(letteringVerticalHeight) + 2.0f;
-
-        if (!self.horizontalLayout) {
-            frame.origin.y = floorf(y);
-            frame.origin.x = (viewSize.width - frame.size.width) * 0.5f;
-        }
-        else {
-            frame.origin.y = floorf((viewSize.height - frame.size.height) * 0.5f);
-            frame.origin.x = CGRectGetMaxX(self.numberLabel.frame) + self.letteringHorizontalSpacing;
-        }
-
-        self.letteringLabel.frame = CGRectIntegral(frame);
-    }
-}
-
-#pragma mark - Accessors -
-
-- (void)setTextColor:(UIColor *)textColor
-{
-    if (textColor == _textColor) { return; }
-    _textColor = textColor;
-
-    self.numberLabel.textColor = _textColor;
-    self.letteringLabel.textColor = _textColor;
-}
-/***********************************************************/
-
-- (void)setNumberString:(NSString *)numberString
-{
-    self.numberLabel.text = numberString;
-    [self setNeedsLayout];
-}
-
-- (NSString *)numberString { return self.numberLabel.text; }
-
-/***********************************************************/
-
-- (void)setLetteringString:(NSString *)letteringString
-{
-    _letteringString = [letteringString copy];
-    [self setUpViews];
-    [self updateLetteringLabelText];
-    [self setNeedsLayout];
-}
-
-/***********************************************************/
-
-- (void)setLetteringCharacterSpacing:(CGFloat)letteringCharacterSpacing
-{
-    _letteringCharacterSpacing = letteringCharacterSpacing;
-    [self updateLetteringLabelText];
-}
-
-/***********************************************************/
-
-- (void)setNumberLabelFont:(UIFont *)numberLabelFont
-{
-    if (_numberLabelFont == numberLabelFont) { return; }
-    _numberLabelFont = numberLabelFont;
-    self.numberLabel.font = _numberLabelFont;
-}
-
-/***********************************************************/
-
-- (void)setLetteringLabelFont:(UIFont *)letteringLabelFont
-{
-    if (_letteringLabelFont == letteringLabelFont) { return; }
-    _letteringLabelFont = letteringLabelFont;
-    self.letteringLabel.font = letteringLabelFont;
-}
-
-@end

+ 0 - 46
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeCircleView.h

@@ -1,46 +0,0 @@
-//
-//  TOPasscodeCircleView.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A view containing two circle image views that can animate
- between filled and hollow, whilst maintaining compatibility
- with translucency views.
- */
-@interface TOPasscodeCircleView : UIView
-
-/* The circle patterns used for neutral and highlighted states. */
-@property (nonatomic, strong) UIImage *circleImage;
-@property (nonatomic, strong) UIImage *highlightedCircleImage;
-
-/* Whether the highlighted view is visible. */
-@property (nonatomic, assign) BOOL isHighlighted;
-
-/* Animate the circle to be highlighted */
-- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 89
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeCircleView.m

@@ -1,89 +0,0 @@
-//
-//  TOPasscodeCircleView.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeCircleView.h"
-
-@interface TOPasscodeCircleView ()
-@property (nonatomic, strong) UIImageView *bottomView;
-@property (nonatomic, strong) UIImageView *topView;
-@end
-
-@implementation TOPasscodeCircleView
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        self.userInteractionEnabled = NO;
-
-        self.bottomView = [[UIImageView alloc] initWithFrame:self.bounds];
-        self.bottomView.userInteractionEnabled = NO;
-        self.bottomView.contentMode = UIViewContentModeCenter;
-        self.bottomView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        [self addSubview:self.bottomView];
-
-        self.topView = [[UIImageView alloc] initWithFrame:self.bounds];
-        self.topView.userInteractionEnabled = NO;
-        self.topView.contentMode = UIViewContentModeCenter;
-        self.topView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        self.topView.alpha = 0.0f;
-        [self addSubview:self.topView];
-    }
-
-    return self;
-}
-
-- (void)setIsHighlighted:(BOOL)isHighlighted
-{
-    [self setHighlighted:isHighlighted animated:NO];
-}
-
-- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
-{
-    if (highlighted == self.isHighlighted) { return; }
-
-    _isHighlighted = highlighted;
-
-    void (^animationBlock)(void) = ^{
-        self.topView.alpha = highlighted ? 1.0f : 0.0f;
-    };
-
-    if (!animated) {
-        animationBlock();
-        return;
-    }
-
-    [UIView animateWithDuration:0.45f animations:animationBlock];
-}
-
-- (void)setCircleImage:(UIImage *)circleImage
-{
-    _circleImage = circleImage;
-    self.bottomView.image = circleImage;
-}
-
-- (void)setHighlightedCircleImage:(UIImage *)highlightedCircleImage
-{
-    _highlightedCircleImage = highlightedCircleImage;
-    self.topView.image = highlightedCircleImage;
-}
-
-@end

+ 0 - 54
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeFixedInputView.h

@@ -1,54 +0,0 @@
-//
-//  TOPasscodeFixedInputView.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-@class TOPasscodeCircleView;
-
-/**
- A basic content view showing a row of circles that can be used to represent
- a fixed size passcode.
- */
-@interface TOPasscodeFixedInputView : UIView
-
-/* The size of each circle in this view (Default is 16) */
-@property (nonatomic, assign) CGFloat circleDiameter;
-
-/* The spacing between each circle (Default is 25.0f) */
-@property (nonatomic, assign) CGFloat circleSpacing;
-
-/* The number of circles in this view (Default is 4) */
-@property (nonatomic, assign) NSInteger length;
-
-/* The number of highlighted circles */
-@property (nonatomic, assign) NSInteger highlightedLength;
-
-/* The circle views managed by this view */
-@property (nonatomic, strong, readonly) NSArray<TOPasscodeCircleView *> *circleViews;
-
-/* Init with a set number of circles */
-- (instancetype)initWithLength:(NSInteger)length;
-
-/* Set the number of highlighted circles */
-- (void)setHighlightedLength:(NSInteger)highlightedLength animated:(BOOL)animated;
-
-@end

+ 0 - 171
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeFixedInputView.m

@@ -1,171 +0,0 @@
-//
-//  TOPasscodeFixedInputView.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeFixedInputView.h"
-#import "TOPasscodeCircleView.h"
-#import "TOPasscodeCircleImage.h"
-
-@interface TOPasscodeFixedInputView ()
-
-@property (nonatomic, strong, readwrite) NSArray<TOPasscodeCircleView *> *circleViews;
-@property (nonatomic, strong) UIImage *circleImage;
-@property (nonatomic, strong) UIImage *highlightedCircleImage;
-
-@end
-
-@implementation TOPasscodeFixedInputView
-
-#pragma mark - Object Creation -
-
-- (instancetype)initWithLength:(NSInteger)length
-{
-    if (self = [self initWithFrame:CGRectZero]) {
-        _length = length;
-    }
-
-    return self;
-}
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        _circleSpacing = 25.0f;
-        _circleDiameter = 16.0f;
-        _length = 4;
-    }
-
-    return self;
-}
-
-#pragma mark - View Configuration -
-
-- (void)sizeToFit
-{
-    // Resize the view to encompass the circles
-    CGRect frame = self.frame;
-    frame.size.width = (_circleDiameter * _length) + (_circleSpacing * (_length - 1)) + 2.0f;
-    frame.size.height = _circleDiameter + 2.0f;
-    self.frame = CGRectIntegral(frame);
-}
-
-- (void)layoutSubviews
-{
-    CGRect frame = CGRectZero;
-    frame.size = (CGSize){self.circleDiameter + 2.0f, self.circleDiameter + 2.0f};
-
-    for (TOPasscodeCircleView *circleView in self.circleViews) {
-        circleView.frame = frame;
-        frame.origin.x += self.circleDiameter + self.circleSpacing;
-    }
-}
-
-#pragma mark - State Configuration -
-
-- (void)setHighlightedLength:(NSInteger)highlightedLength animated:(BOOL)animated
-{
-    NSInteger i = 0;
-    for (TOPasscodeCircleView *circleView in self.circleViews) {
-        [circleView setHighlighted:(i < highlightedLength) animated:animated];
-        i++;
-    }
-}
-
-#pragma mark - Circle View Configuration -
-
-- (void)setCircleViewsForLength:(NSInteger)length
-{
-    NSMutableArray *circleViews = [NSMutableArray array];
-    if (self.circleViews) {
-        [circleViews addObjectsFromArray:self.circleViews];
-    }
-
-    [UIView performWithoutAnimation:^{
-        while (circleViews.count != length) {
-            // Remove any extra circle views
-            if (circleViews.count > length) {
-                TOPasscodeCircleView *lastCircle = circleViews.lastObject;
-                [lastCircle removeFromSuperview];
-                [circleViews removeLastObject];
-                continue;
-            }
-
-            // Add any new circle views
-            TOPasscodeCircleView *newCircleView = [[TOPasscodeCircleView alloc] init];
-            [self setImagesOfCircleView:newCircleView];
-            [self addSubview:newCircleView];
-            [circleViews addObject:newCircleView];
-        }
-
-        self.circleViews = [NSArray arrayWithArray:circleViews];
-        [self setNeedsLayout];
-        [self layoutIfNeeded];
-    }];
-}
-
-- (void)setCircleImagesForDiameter:(CGFloat)diameter
-{
-    self.circleImage = [TOPasscodeCircleImage hollowCircleImageOfSize:diameter strokeWidth:1.2f padding:1.0f];
-    self.highlightedCircleImage = [TOPasscodeCircleImage circleImageOfSize:diameter inset:0.5f padding:1.0f antialias:YES];
-
-    for (TOPasscodeCircleView *circleView in self.circleViews) {
-        [self setImagesOfCircleView:circleView];
-    }
-}
-
-- (void)setImagesOfCircleView:(TOPasscodeCircleView *)circleView
-{
-    circleView.circleImage = self.circleImage;
-    circleView.highlightedCircleImage = self.highlightedCircleImage;
-}
-
-#pragma mark - Accessors -
-
-- (NSArray<TOPasscodeCircleView *> *)circleViews
-{
-    if (_circleViews) { return _circleViews; }
-    _circleViews = [NSArray array];
-    [self setCircleViewsForLength:self.length];
-    [self setCircleImagesForDiameter:self.circleDiameter];
-    return _circleViews;
-}
-
-- (void)setCircleDiameter:(CGFloat)circleDiameter
-{
-    if (circleDiameter == _circleDiameter) { return; }
-    _circleDiameter = circleDiameter;
-    [self setCircleImagesForDiameter:_circleDiameter];
-    [self sizeToFit];
-}
-
-- (void)setLength:(NSInteger)length
-{
-    if (_length == length) { return; }
-    _length = length;
-    [self setCircleViewsForLength:length];
-}
-
-- (void)setHighlightedLength:(NSInteger)highlightedLength
-{
-    [self setHighlightedLength:highlightedLength animated:NO];
-}
-
-@end

+ 0 - 111
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeInputField.h

@@ -1,111 +0,0 @@
-//
-//  TOPasscodeInputField.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-#import "TOPasscodeFixedInputView.h"
-#import "TOPasscodeVariableInputView.h"
-
-
-NS_ASSUME_NONNULL_BEGIN
-
-typedef NS_ENUM(NSInteger, TOPasscodeInputFieldStyle) {
-    TOPasscodeInputFieldStyleFixed,    // The passcode explicitly requires a specific number of characters (Shows hollow circles)
-    TOPasscodeInputFieldStyleVariable  // The passcode can be any arbitrary number of characters (Shows an empty rectangle)
-};
-
-/**
- An abstract input view capable of receiving different types of passcodes.
- When a fixed character passcode is specified, the view shows a row of circles.
- When a variable passcode is specified, a rounded rectangle is shown.
- */
-@interface TOPasscodeInputField : UIView <UIKeyInput>
-
-/* The visual effects view used to control the vibrancy of the input field */
-@property (nonatomic, strong, readonly) UIVisualEffectView *visualEffectView;
-
-/* The input style of this control */
-@property (nonatomic, assign) TOPasscodeInputFieldStyle style;
-
-/* A row of hollow circles at a preset length. Valid only when `style` is set to `fixed` */
-@property (nonatomic, readonly, nullable) TOPasscodeFixedInputView *fixedInputView;
-
-/* A rounded rectangle representing a passcode of arbitrary length. Valid only when `style` is set to `variable`. */
-@property (nonatomic, readonly, nullable) TOPasscodeVariableInputView *variableInputView;
-
-/* The 'submit' button shown when `showSubmitButton` is true. */
-@property (nonatomic, readonly, nullable) UIButton *submitButton;
-
-/* Shows an 'OK' button next to the view when characters have been added. */
-@property (nonatomic, assign) BOOL showSubmitButton;
-
-/* The amount of spacing between the 'OK' button and the passcode field */
-@property (nonatomic, assign) CGFloat submitButtonSpacing;
-
-/* The amount of spacing between the 'OK' button and the passcode field */
-@property (nonatomic, assign) CGFloat submitButtonVerticalSpacing;
-
-/* The font size of the submit button */
-@property (nonatomic, assign) CGFloat submitButtonFontSize;
-
-/* The current passcode entered into this view */
-@property (nonatomic, copy, nullable) NSString *passcode;
-
-/* If this view is directly receiving input, this can change the `UIKeyboard` appearance. */
-@property (nonatomic, assign) UIKeyboardAppearance keyboardAppearance;
-
-/* The type of button used for the 'Done' button in the keyboard */
-@property(nonatomic, assign) UIReturnKeyType returnKeyType;
-
-/* The alpha value of the views in this view (For tranclucent styling) */
-@property (nonatomic, assign) CGFloat contentAlpha;
-
-/* Whether the view may be tapped to enable character input (Default is NO) */
-@property (nonatomic, assign) BOOL enabled;
-
-/** Called when the number of digits has been entered, or the user tapped 'Done' on the keyboard */
-@property (nonatomic, copy) void (^passcodeCompletedHandler)(NSString *code);
-
-/** Horizontal layout. The 'OK' button will be placed under the text field */
-@property (nonatomic, assign) BOOL horizontalLayout;
-
-/* Init with the target length needed for this passcode */
-- (instancetype)initWithStyle:(TOPasscodeInputFieldStyle)style;
-
-/* Replace the passcode with this one, and animate the transition. */
-- (void)setPasscode:(nullable NSString *)passcode animated:(BOOL)animated;
-
-/* Add additional characters to the end of the passcode, and animate if desired. */
-- (void)appendPasscodeCharacters:(NSString *)characters animated:(BOOL)animated;
-
-/* Delete a number of characters from the end, animated if desired. */
-- (void)deletePasscodeCharactersOfCount:(NSInteger)deleteCount animated:(BOOL)animated;
-
-/* Plays a shaking animation and resets the passcode back to empty */
-- (void)resetPasscodeAnimated:(BOOL)animated playImpact:(BOOL)impact;
-
-/* Animates the OK button changing location. */
-- (void)setHorizontalLayout:(BOOL)horizontalLayout animated:(BOOL)animated duration:(CGFloat)duration;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 423
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeInputField.m

@@ -1,423 +0,0 @@
-//
-//  TOPasscodeInputField.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeInputField.h"
-
-#import "TOPasscodeVariableInputView.h"
-#import "TOPasscodeFixedInputView.h"
-
-#import <AudioToolbox/AudioToolbox.h>
-
-@interface TOPasscodeInputField ()
-
-// Convenience getters
-@property (nonatomic, readonly) UIView *inputField; // Returns whichever input field is currently visible
-@property (nonatomic, readonly) NSInteger maximumPasscodeLength; // The mamximum number of characters allowed (0 if uncapped)
-
-@property (nonatomic, strong, readwrite) TOPasscodeFixedInputView *fixedInputView;
-@property (nonatomic, strong, readwrite) TOPasscodeVariableInputView *variableInputView;
-@property (nonatomic, strong, readwrite) UIButton *submitButton;
-@property (nonatomic, strong, readwrite) UIVisualEffectView *visualEffectView;
-
-@end
-
-@implementation TOPasscodeInputField
-
-#pragma mark - View Set-up -
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        [self setUp];
-        [self setUpForStyle:TOPasscodeInputFieldStyleFixed];
-    }
-
-    return self;
-}
-
-- (instancetype)initWithStyle:(TOPasscodeInputFieldStyle)style
-{
-    if (self = [self initWithFrame:CGRectZero]) {
-        _style = style;
-        [self setUp];
-        [self setUpForStyle:style];
-    }
-
-    return self;
-}
-
-- (void)setUp
-{
-    self.backgroundColor = [UIColor clearColor];
-    _submitButtonSpacing = 4.0f;
-    _submitButtonVerticalSpacing = 5.0f;
-
-    _visualEffectView = [[UIVisualEffectView alloc] initWithEffect:nil];
-    [self addSubview:_visualEffectView];
-}
-
-- (void)setUpForStyle:(TOPasscodeInputFieldStyle)style
-{
-    if (self.inputField) {
-        [self.inputField removeFromSuperview];
-        self.variableInputView = nil;
-        self.fixedInputView = nil;
-    }
-
-    if (style == TOPasscodeInputFieldStyleVariable) {
-        self.variableInputView = [[TOPasscodeVariableInputView alloc] init];
-        [self.visualEffectView.contentView addSubview:self.variableInputView];
-    }
-    else {
-        self.fixedInputView = [[TOPasscodeFixedInputView alloc] init];
-        [self.visualEffectView.contentView addSubview:self.fixedInputView];
-    }
-
-    // Set the frame for the currently visible input view
-    [self.inputField sizeToFit];
-
-    // Size this view to match
-    [self sizeToFit];
-}
-
-#pragma mark - View Layout -
-- (void)sizeToFit
-{
-    // Resize the view to encompass the current input view
-    CGRect frame = self.frame;
-    [self.inputField sizeToFit];
-    frame.size = self.inputField.frame.size;
-    if (self.horizontalLayout) {
-        frame.size.height += self.submitButtonVerticalSpacing + CGRectGetHeight(self.submitButton.frame);
-    }
-    self.frame = CGRectIntegral(frame);
-}
-
-- (void)layoutSubviews
-{
-    [super layoutSubviews];
-
-    self.visualEffectView.frame = self.inputField.bounds;
-
-    if (!self.submitButton) { return; }
-
-    [self.submitButton sizeToFit];
-    [self bringSubviewToFront:self.submitButton];
-
-    CGRect frame = self.submitButton.frame;
-    if (!self.horizontalLayout) {
-        frame.origin.x = CGRectGetMaxX(self.bounds) + self.submitButtonSpacing;
-        frame.origin.y = (CGRectGetHeight(self.bounds) - CGRectGetHeight(frame)) * 0.5f;
-    }
-    else {
-        frame.origin.x = (CGRectGetWidth(self.frame) - frame.size.width) * 0.5f;
-        frame.origin.y = CGRectGetMaxY(self.inputField.frame) + self.submitButtonVerticalSpacing;
-    }
-    self.submitButton.frame = CGRectIntegral(frame);
-}
-
-#pragma mark - Interaction -
-- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
-{
-    [super touchesBegan:touches withEvent:event];
-    if (!self.enabled) { return; }
-    self.contentAlpha = 0.5f;
-}
-
-- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
-{
-    [super touchesCancelled:touches withEvent:event];
-    if (!self.enabled) { return; }
-    [UIView animateWithDuration:0.3f animations:^{
-        self.contentAlpha = 1.0f;
-    }];
-    [self becomeFirstResponder];
-}
-
-- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
-{
-    CGRect frame = self.bounds;
-    frame.size.width += self.submitButton.frame.size.width + (self.submitButtonSpacing * 2.0f);
-    frame.size.height += self.submitButtonVerticalSpacing;
-
-    if (CGRectContainsPoint(frame, point)) {
-        return YES;
-    }
-    return NO;
-}
-
-- (id)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
-
-    if ([[super hitTest:point withEvent:event] isEqual:self.submitButton]) {
-        if (CGRectContainsPoint(self.submitButton.frame, point)) {
-            return self.submitButton;
-        } else {
-            return self;
-        }
-    }
-
-    return [super hitTest:point withEvent:event];
-}
-
-#pragma mark - Text Input Protocol -
-- (BOOL)canBecomeFirstResponder { return self.enabled; }
-
-- (BOOL)hasText { return self.passcode.length > 0; }
-
-- (void)insertText:(NSString *)text
-{
-    if ([text isEqualToString:@"\n"]) {
-        if (self.passcodeCompletedHandler) { self.passcodeCompletedHandler(self.passcode); }
-        return;
-    }
-
-    [self appendPasscodeCharacters:text animated:NO];
-}
-- (void)deleteBackward
-{
-    [self deletePasscodeCharactersOfCount:1 animated:YES];
-}
-
-- (UIKeyboardType)keyboardType { return UIKeyboardTypeASCIICapable; }
-
-- (UITextAutocorrectionType)autocorrectionType { return UITextAutocorrectionTypeNo; }
-
-- (UIReturnKeyType)returnKeyType { return UIReturnKeyGo; }
-
-- (BOOL)enablesReturnKeyAutomatically { return YES; }
-
-#pragma mark - Text Input -
-- (void)setPasscode:(NSString *)passcode animated:(BOOL)animated
-{
-    if (passcode == self.passcode) { return; }
-    _passcode = passcode;
-
-    BOOL passcodeIsComplete = NO;
-    if (self.fixedInputView) {
-        [self.fixedInputView setHighlightedLength:_passcode.length animated:animated];
-        passcodeIsComplete = _passcode.length >= self.maximumPasscodeLength;
-    }
-    else {
-        [self.variableInputView setLength:_passcode.length animated:animated];
-    }
-
-    if (self.submitButton) {
-        self.submitButton.hidden = (_passcode.length == 0);
-        [self bringSubviewToFront:self.submitButton];
-    }
-
-    if (passcodeIsComplete && self.passcodeCompletedHandler) {
-        self.passcodeCompletedHandler(_passcode);
-    }
-
-    [self reloadInputViews];
-}
-
-- (void)appendPasscodeCharacters:(NSString *)characters animated:(BOOL)animated
-{
-    if (characters == nil) { return; }
-    if (self.maximumPasscodeLength > 0 && self.passcode.length >= self.maximumPasscodeLength) { return; }
-
-    if (_passcode == nil) { _passcode = @""; }
-    [self setPasscode:[_passcode stringByAppendingString:characters] animated:animated];
-}
-
-- (void)deletePasscodeCharactersOfCount:(NSInteger)deleteCount animated:(BOOL)animated
-{
-    if (deleteCount <= 0 || self.passcode.length <= 0) { return; }
-    [self setPasscode:[self.passcode substringToIndex:(self.passcode.length - 1)] animated:animated];
-}
-
-- (void)resetPasscodeAnimated:(BOOL)animated playImpact:(BOOL)impact
-{
-    [self setPasscode:nil animated:animated];
-
-    // Play a negative impact effect
-    if (@available(iOS 9.0, *)) {
-        // https://stackoverflow.com/questions/41444274/how-to-check-if-haptic-engine-uifeedbackgenerator-is-supported
-        if (impact) { AudioServicesPlaySystemSoundWithCompletion(1521, nil); }
-    }
-
-    if (!animated) { return; }
-
-    CGPoint center = self.center;
-    CGPoint offset = center;
-    offset.x -= self.frame.size.width * 0.3f;
-
-    // Play the view sliding out and then springing back in
-    id completionBlock = ^(BOOL finished) {
-        [UIView animateWithDuration:1.0f
-                              delay:0.0f
-             usingSpringWithDamping:0.15f
-              initialSpringVelocity:10.0f
-                            options:0 animations:^{
-                                self.center = center;
-                            }completion:nil];
-    };
-
-    [UIView animateWithDuration:0.05f animations:^{
-        self.center = offset;
-    }completion:completionBlock];
-
-    if (!self.submitButton) { return; }
-
-    [UIView animateWithDuration:0.7f animations:^{
-        self.submitButton.alpha = 0.0f;
-    } completion:^(BOOL complete) {
-        self.submitButton.alpha = 1.0f;
-        self.submitButton.hidden = YES;
-    }];
-}
-
-#pragma mark - Button Callbacks -
-- (void)submitButtonTapped:(id)sender
-{
-    if (self.passcodeCompletedHandler) {
-        self.passcodeCompletedHandler(self.passcode);
-    }
-}
-
-#pragma mark - Private Accessors -
-- (UIView *)inputField
-{
-    if (self.fixedInputView) {
-        return (UIView *)self.fixedInputView;
-    }
-
-    return (UIView *)self.variableInputView;
-}
-
-- (NSInteger)maximumPasscodeLength
-{
-    if (self.style == TOPasscodeInputFieldStyleFixed) {
-        return self.fixedInputView.length;
-    }
-
-    return 0;
-}
-
-#pragma mark - Public Accessors -
-
-- (void)setShowSubmitButton:(BOOL)showSubmitButton
-{
-    if (_showSubmitButton == showSubmitButton) {
-        return;
-    }
-
-    _showSubmitButton = showSubmitButton;
-
-    if (!_showSubmitButton) {
-        [self.submitButton removeFromSuperview];
-        self.submitButton = nil;
-        return;
-    }
-
-    self.submitButton = [UIButton buttonWithType:UIButtonTypeSystem];
-    [self.submitButton setTitle:@"OK" forState:UIControlStateNormal];
-    [self.submitButton addTarget:self action:@selector(submitButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-    [self.submitButton.titleLabel setFont:[UIFont systemFontOfSize:18.0f]];
-    self.submitButton.hidden = YES;
-    [self addSubview:self.submitButton];
-
-    [self setNeedsLayout];
-}
-
-- (void)setSubmitButtonSpacing:(CGFloat)submitButtonSpacing
-{
-    if (submitButtonSpacing == _submitButtonSpacing) { return; }
-    _submitButtonSpacing = submitButtonSpacing;
-    [self setNeedsLayout];
-}
-
-- (void)setSubmitButtonFontSize:(CGFloat)submitButtonFontSize
-{
-    if (submitButtonFontSize == _submitButtonFontSize) { return; }
-    _submitButtonFontSize = submitButtonFontSize;
-    self.submitButton.titleLabel.font = [UIFont systemFontOfSize:_submitButtonFontSize];
-    [self.submitButton sizeToFit];
-    [self setNeedsLayout];
-}
-
-- (void)setStyle:(TOPasscodeInputFieldStyle)style
-{
-    if (style == _style) { return; }
-    _style = style;
-    [self setUpForStyle:_style];
-}
-
-- (void)setPasscode:(NSString *)passcode
-{
-    [self setPasscode:passcode animated:NO];
-}
-
-- (void)setContentAlpha:(CGFloat)contentAlpha
-{
-    _contentAlpha = contentAlpha;
-    self.inputField.alpha = contentAlpha;
-    self.submitButton.alpha = contentAlpha;
-}
-
-- (void)setHorizontalLayout:(BOOL)horizontalLayout
-{
-    [self setHorizontalLayout:horizontalLayout animated:NO duration:0.0f];
-}
-
-- (void)setHorizontalLayout:(BOOL)horizontalLayout animated:(BOOL)animated duration:(CGFloat)duration
-{
-    if (_horizontalLayout == horizontalLayout) {
-        return;
-    }
-
-    UIView *snapshotView = nil;
-
-    if (self.submitButton && self.submitButton.hidden == NO && animated) {
-        snapshotView = [self.submitButton snapshotViewAfterScreenUpdates:NO];
-        snapshotView.frame = self.submitButton.frame;
-        [self addSubview:snapshotView];
-    }
-
-    _horizontalLayout = horizontalLayout;
-
-    if (!animated || !self.submitButton) {
-        [self sizeToFit];
-        [self setNeedsLayout];
-        return;
-    }
-
-    self.submitButton.alpha = 0.0f;
-    [self setNeedsLayout];
-    [self layoutIfNeeded];
-
-    id animationBlock = ^{
-        self.submitButton.alpha = 1.0f;
-        snapshotView.alpha = 0.0f;
-    };
-
-    id completionBlock = ^(BOOL complete) {
-        [snapshotView removeFromSuperview];
-        [self bringSubviewToFront:self.submitButton];
-    };
-
-    [UIView animateWithDuration:duration animations:animationBlock completion:completionBlock];
-}
-
-@end

+ 0 - 55
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeVariableInputView.h

@@ -1,55 +0,0 @@
-//
-//  TOPasscodeVariableInputView.h
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-/**
- A basic content view showing a rounded rectangle containing circles
- that can be used to represent a variable size passcode.
- */
-@interface TOPasscodeVariableInputView : UIImageView
-
-/* The thickness of the stroke around the view (Default is 1.5) */
-@property (nonatomic, assign) CGFloat outlineThickness;
-
-/* The corner radius of the stroke (Default is 5) */
-@property (nonatomic, assign) CGFloat outlineCornerRadius;
-
-/* The size of each circle bullet point representing a passcoded character (Default is 10) */
-@property (nonatomic, assign) CGFloat circleDiameter;
-
-/* The spacing between each circle (Default is 15) */
-@property (nonatomic, assign) CGFloat circleSpacing;
-
-/* The padding between the circles and the outer outline (Default is {10,10}) */
-@property (nonatomic, assign) CGSize outlinePadding;
-
-/* The maximum number of circles to show (This will indicate the view's width) (Default is 12) */
-@property (nonatomic, assign) NSInteger maximumVisibleLength;
-
-/* Set the number of characters entered into this view (May be larger than `maximumVisibleLength`) */
-@property (nonatomic, assign) NSInteger length;
-
-/* Set the number of characters represented by this field, animated if desired */
-- (void)setLength:(NSInteger)length animated:(BOOL)animated;
-
-@end

+ 0 - 254
Libraries external/TOPasscodeViewController/Views/Shared/TOPasscodeVariableInputView.m

@@ -1,254 +0,0 @@
-//
-//  TOPasscodeVariableInputView.m
-//
-//  Copyright 2017 Timothy Oliver. All rights reserved.
-//
-//  Permission is hereby granted, free of charge, to any person obtaining a copy
-//  of this software and associated documentation files (the "Software"), to
-//  deal in the Software without restriction, including without limitation the
-//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-//  sell copies of the Software, and to permit persons to whom the Software is
-//  furnished to do so, subject to the following conditions:
-//
-//  The above copyright notice and this permission notice shall be included in
-//  all copies or substantial portions of the Software.
-//
-//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#import "TOPasscodeVariableInputView.h"
-#import "TOPasscodeCircleImage.h"
-
-@interface TOPasscodeVariableInputView ()
-
-@property (nonatomic, strong) UIImage *backgroundImage; // The outline image for this view
-@property (nonatomic, strong) UIImage *circleImage;     // The circle image representing a single character
-
-@property (nonatomic, strong) NSMutableArray<UIImageView *> *circleViews;
-
-@end
-
-@implementation TOPasscodeVariableInputView
-
-#pragma mark - Class Creation -
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if (self = [super initWithFrame:frame]) {
-        _outlineThickness = 1.0f;
-        _outlineCornerRadius = 5.0f;
-        _circleDiameter = 11.0f;
-        _circleSpacing = 7.0f;
-        _outlinePadding = (CGSize){10,10};
-        _maximumVisibleLength = 12;
-    }
-
-    return self;
-}
-
-#pragma mark - View Setup -
-- (void)setUpImageForCircleViews
-{
-    if (self.circleImage != nil) { return; }
-
-    self.circleImage = [TOPasscodeCircleImage circleImageOfSize:_circleDiameter inset:0.0f padding:1.0f antialias:YES];
-    for (UIImageView *circleView in self.circleViews) {
-        circleView.image = self.circleImage;
-        [circleView sizeToFit];
-    }
-}
-
-- (void)setUpCircleViewsForLength:(NSInteger)length
-{
-    // Set up the number of circle views if needed
-    if (self.circleViews.count == length) { return; }
-
-    if (self.circleViews == nil) {
-        self.circleViews = [NSMutableArray arrayWithCapacity:_maximumVisibleLength];
-    }
-
-    // Reduce the number of views
-    while (self.circleViews.count > length) {
-        UIImageView *circleView = self.circleViews.lastObject;
-        [circleView removeFromSuperview];
-        [self.circleViews removeLastObject];
-    }
-
-    // Increase the number of views
-    [UIView performWithoutAnimation:^{
-        while (self.circleViews.count < length) {
-            UIImageView *circleView = [[UIImageView alloc] initWithImage:self.circleImage];
-            circleView.alpha = 0.0f;
-            [self addSubview:circleView];
-            [self.circleViews addObject:circleView];
-        }
-    }];
-}
-
-- (void)setUpBackgroundImage
-{
-    if (self.backgroundImage != nil) { return; }
-
-    self.backgroundImage = [[self class] backgroundImageWithThickness:_outlineThickness cornerRadius:_outlineCornerRadius];
-    self.image = self.backgroundImage;
-}
-
-#pragma mark - View Layout -
-
-- (void)sizeToFit
-{
-    CGRect frame = self.frame;
-
-    // Calculate the width
-    frame.size.width = self.outlineThickness * 2.0f;
-    frame.size.width += (self.outlinePadding.width * 2.0f);
-    frame.size.width += (self.maximumVisibleLength * (self.circleDiameter+2.0f)); // +2 for padding
-    frame.size.width += ((self.maximumVisibleLength - 1) * self.circleSpacing);
-
-    // Height
-    frame.size.height = self.outlineThickness * 2.0f;
-    frame.size.height += self.outlinePadding.height * 2.0f;
-    frame.size.height += self.circleDiameter;
-
-    self.frame = CGRectIntegral(frame);
-}
-
-- (void)layoutSubviews
-{
-    [super layoutSubviews];
-
-    // Genearate the background image if we don't have one yet
-    [self setUpBackgroundImage];
-
-    // Set up the circle view image
-    [self setUpImageForCircleViews];
-
-    // Set up the circle views
-    [self setUpCircleViewsForLength:self.maximumVisibleLength];
-
-    // Layout the circle views for the current length
-    CGRect frame = CGRectZero;
-    frame.size = self.circleImage.size;
-    frame.origin.y = CGRectGetMidY(self.bounds) - (frame.size.height * 0.5f);
-    frame.origin.x = self.outlinePadding.width + self.outlineThickness;
-
-    for (UIImageView *circleView in self.circleViews) {
-        circleView.frame = frame;
-        frame.origin.x += frame.size.width + self.circleSpacing;
-    }
-}
-
-#pragma mark - Accessors -
-
-- (void)setOutlineThickness:(CGFloat)outlineThickness
-{
-    if (_outlineThickness == outlineThickness) { return; }
-    _outlineThickness = outlineThickness;
-    self.backgroundImage = nil;
-    [self setNeedsLayout];
-}
-
-- (void)setOutlineCornerRadius:(CGFloat)outlineCornerRadius
-{
-    if (_outlineCornerRadius == outlineCornerRadius) { return; }
-    _outlineCornerRadius = outlineCornerRadius;
-    self.backgroundImage = nil;
-    [self setNeedsLayout];
-}
-
-- (void)setCircleDiameter:(CGFloat)circleDiameter
-{
-    if (_circleDiameter == circleDiameter) { return; }
-    _circleDiameter = circleDiameter;
-    self.circleImage = nil;
-    [self setUpImageForCircleViews];
-}
-
-- (void)setCircleSpacing:(CGFloat)circleSpacing
-{
-    if (_circleSpacing == circleSpacing) { return; }
-    _circleSpacing = circleSpacing;
-    [self sizeToFit];
-    [self setNeedsLayout];
-}
-
-- (void)setOutlinePadding:(CGSize)outlinePadding
-{
-    if (CGSizeEqualToSize(outlinePadding, _outlinePadding)) { return; }
-    _outlinePadding = outlinePadding;
-    [self sizeToFit];
-    [self setNeedsLayout];
-}
-
-- (void)setMaximumVisibleLength:(NSInteger)maximumVisibleLength
-{
-    if (_maximumVisibleLength == maximumVisibleLength) { return; }
-    _maximumVisibleLength = maximumVisibleLength;
-    [self setUpCircleViewsForLength:maximumVisibleLength];
-    [self sizeToFit];
-    [self setNeedsLayout];
-}
-
-- (void)setLength:(NSInteger)length
-{
-    [self setLength:length animated:NO];
-}
-
-- (void)setLength:(NSInteger)length animated:(BOOL)animated
-{
-    if (length == _length) { return; }
-
-    _length = length;
-
-    void (^animationBlock)(void) = ^{
-        NSInteger i = 0;
-        for (UIImageView *circleView in self.circleViews) {
-            circleView.alpha = i < length ? 1.0f : 0.0f;
-            i++;
-        }
-    };
-
-    if (!animated) {
-        animationBlock();
-        return;
-    }
-
-    [UIView animateWithDuration:0.4f animations:animationBlock];
-}
-
-#pragma mark - Image Creation -
-
-+ (UIImage *)backgroundImageWithThickness:(CGFloat)thickness cornerRadius:(CGFloat)radius
-{
-    CGFloat inset = thickness / 2.0f;
-    CGFloat dimension = (radius * 2.0f) + 2.0f;
-
-    CGRect frame = CGRectZero;
-    frame.origin = CGPointMake(inset, inset);
-    frame.size = CGSizeMake(dimension, dimension);
-
-    CGSize canvasSize = frame.size;
-    canvasSize.width += thickness;
-    canvasSize.height += thickness;
-
-    UIGraphicsBeginImageContextWithOptions(canvasSize, NO, 0.0f);
-    {
-        UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:frame cornerRadius:radius];
-        path.lineWidth = thickness;
-        [[UIColor blackColor] setStroke];
-        [path stroke];
-    }
-
-    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-
-    UIEdgeInsets insets = UIEdgeInsetsMake(radius+1, radius+1, radius+1, radius+1);
-    image = [image resizableImageWithCapInsets:insets];
-    return [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
-}
-
-@end

+ 5 - 160
Nextcloud.xcodeproj/project.pbxproj

@@ -152,23 +152,6 @@
 		F711CD73246AC9B80009B204 /* nsEscCharsetProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F711CD43246AC9B80009B204 /* nsEscCharsetProber.cpp */; };
 		F711CD74246AC9B80009B204 /* nsUTF8Prober.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F711CD45246AC9B80009B204 /* nsUTF8Prober.cpp */; };
 		F711CD75246AC9B80009B204 /* nsEscSM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F711CD48246AC9B80009B204 /* nsEscSM.cpp */; };
-		F711CDC2246AD2E40009B204 /* TOPasscodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CD99246AD2E40009B204 /* TOPasscodeViewController.m */; };
-		F711CDC3246AD2E40009B204 /* TOPasscodeCircleImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CD9F246AD2E40009B204 /* TOPasscodeCircleImage.m */; };
-		F711CDC4246AD2E40009B204 /* TOPasscodeViewControllerAnimatedTransitioning.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDA0246AD2E40009B204 /* TOPasscodeViewControllerAnimatedTransitioning.m */; };
-		F711CDC5246AD2E40009B204 /* TOSettingsKeypadImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDA1246AD2E40009B204 /* TOSettingsKeypadImage.m */; };
-		F711CDC6246AD2E40009B204 /* TOPasscodeViewContentLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDA2246AD2E40009B204 /* TOPasscodeViewContentLayout.m */; };
-		F711CDC7246AD2E40009B204 /* TOPasscodeSettingsKeypadView.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDAC246AD2E40009B204 /* TOPasscodeSettingsKeypadView.m */; };
-		F711CDC8246AD2E40009B204 /* TOPasscodeSettingsWarningLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDAD246AD2E40009B204 /* TOPasscodeSettingsWarningLabel.m */; };
-		F711CDC9246AD2E40009B204 /* TOPasscodeSettingsKeypadButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDAE246AD2E40009B204 /* TOPasscodeSettingsKeypadButton.m */; };
-		F711CDCA246AD2E40009B204 /* TOPasscodeFixedInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDB5246AD2E40009B204 /* TOPasscodeFixedInputView.m */; };
-		F711CDCB246AD2E40009B204 /* TOPasscodeCircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDB6246AD2E40009B204 /* TOPasscodeCircleView.m */; };
-		F711CDCC246AD2E40009B204 /* TOPasscodeButtonLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDB7246AD2E40009B204 /* TOPasscodeButtonLabel.m */; };
-		F711CDCD246AD2E40009B204 /* TOPasscodeVariableInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDB8246AD2E40009B204 /* TOPasscodeVariableInputView.m */; };
-		F711CDCE246AD2E40009B204 /* TOPasscodeInputField.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDB9246AD2E40009B204 /* TOPasscodeInputField.m */; };
-		F711CDCF246AD2E40009B204 /* TOPasscodeCircleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDBD246AD2E40009B204 /* TOPasscodeCircleButton.m */; };
-		F711CDD0246AD2E40009B204 /* TOPasscodeKeypadView.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDBE246AD2E40009B204 /* TOPasscodeKeypadView.m */; };
-		F711CDD1246AD2E40009B204 /* TOPasscodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDC0246AD2E40009B204 /* TOPasscodeView.m */; };
-		F711CDD2246AD2E40009B204 /* TOPasscodeSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F711CDC1246AD2E40009B204 /* TOPasscodeSettingsViewController.m */; };
 		F71459B81D12E3B700CAFEEC /* CCError.m in Sources */ = {isa = PBXBuildFile; fileRef = F76C3B881C638A4C00DC4301 /* CCError.m */; };
 		F71459BA1D12E3B700CAFEEC /* NSString+TruncateToWidth.m in Sources */ = {isa = PBXBuildFile; fileRef = F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */; };
 		F71459BC1D12E3B700CAFEEC /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05261C889184008DAB36 /* Reachability.m */; };
@@ -359,6 +342,7 @@
 		F7AE00F5230D5F9E007ACF8A /* NCLoginWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AE00F4230D5F9E007ACF8A /* NCLoginWeb.swift */; };
 		F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AE00F7230E81CB007ACF8A /* NCBrowserWeb.swift */; };
 		F7AE00FA230E81EB007ACF8A /* NCBrowserWeb.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7AE00F9230E81EB007ACF8A /* NCBrowserWeb.storyboard */; };
+		F7AF7633246BEDFE00B86E3C /* TOPasscodeViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7AF7632246BEDFE00B86E3C /* TOPasscodeViewController.framework */; };
 		F7B0C0CD1EE7E7750033AC24 /* CCSynchronize.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B0C0CC1EE7E7750033AC24 /* CCSynchronize.m */; };
 		F7B0C1751EE839A30033AC24 /* NCAutoUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B0C1741EE839A30033AC24 /* NCAutoUpload.m */; };
 		F7B174C822FAC0A8000B7579 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B174C722FAC0A8000B7579 /* AppDelegate.m */; };
@@ -660,41 +644,6 @@
 		F711CD49246AC9B80009B204 /* nsLatin1Prober.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsLatin1Prober.h; sourceTree = "<group>"; };
 		F711CD4A246AC9B80009B204 /* nsEUCTWProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsEUCTWProber.h; sourceTree = "<group>"; };
 		F711CD4B246AC9B80009B204 /* uchardet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uchardet.h; sourceTree = "<group>"; };
-		F711CD99246AD2E40009B204 /* TOPasscodeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeViewController.m; sourceTree = "<group>"; };
-		F711CD9B246AD2E40009B204 /* TOPasscodeCircleImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeCircleImage.h; sourceTree = "<group>"; };
-		F711CD9C246AD2E40009B204 /* TOPasscodeViewControllerAnimatedTransitioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeViewControllerAnimatedTransitioning.h; sourceTree = "<group>"; };
-		F711CD9D246AD2E40009B204 /* TOPasscodeViewContentLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeViewContentLayout.h; sourceTree = "<group>"; };
-		F711CD9E246AD2E40009B204 /* TOSettingsKeypadImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOSettingsKeypadImage.h; sourceTree = "<group>"; };
-		F711CD9F246AD2E40009B204 /* TOPasscodeCircleImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeCircleImage.m; sourceTree = "<group>"; };
-		F711CDA0246AD2E40009B204 /* TOPasscodeViewControllerAnimatedTransitioning.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeViewControllerAnimatedTransitioning.m; sourceTree = "<group>"; };
-		F711CDA1246AD2E40009B204 /* TOSettingsKeypadImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOSettingsKeypadImage.m; sourceTree = "<group>"; };
-		F711CDA2246AD2E40009B204 /* TOPasscodeViewContentLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeViewContentLayout.m; sourceTree = "<group>"; };
-		F711CDA3246AD2E40009B204 /* TOPasscodeSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeSettingsViewController.h; sourceTree = "<group>"; };
-		F711CDA4246AD2E40009B204 /* TOPasscodeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeViewController.h; sourceTree = "<group>"; };
-		F711CDA6246AD2E40009B204 /* TOPasscodeViewControllerConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeViewControllerConstants.h; sourceTree = "<group>"; };
-		F711CDA9246AD2E40009B204 /* TOPasscodeSettingsKeypadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeSettingsKeypadView.h; sourceTree = "<group>"; };
-		F711CDAA246AD2E40009B204 /* TOPasscodeSettingsWarningLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeSettingsWarningLabel.h; sourceTree = "<group>"; };
-		F711CDAB246AD2E40009B204 /* TOPasscodeSettingsKeypadButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeSettingsKeypadButton.h; sourceTree = "<group>"; };
-		F711CDAC246AD2E40009B204 /* TOPasscodeSettingsKeypadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeSettingsKeypadView.m; sourceTree = "<group>"; };
-		F711CDAD246AD2E40009B204 /* TOPasscodeSettingsWarningLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeSettingsWarningLabel.m; sourceTree = "<group>"; };
-		F711CDAE246AD2E40009B204 /* TOPasscodeSettingsKeypadButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeSettingsKeypadButton.m; sourceTree = "<group>"; };
-		F711CDB0246AD2E40009B204 /* TOPasscodeCircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeCircleView.h; sourceTree = "<group>"; };
-		F711CDB1246AD2E40009B204 /* TOPasscodeFixedInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeFixedInputView.h; sourceTree = "<group>"; };
-		F711CDB2246AD2E40009B204 /* TOPasscodeVariableInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeVariableInputView.h; sourceTree = "<group>"; };
-		F711CDB3246AD2E40009B204 /* TOPasscodeButtonLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeButtonLabel.h; sourceTree = "<group>"; };
-		F711CDB4246AD2E40009B204 /* TOPasscodeInputField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeInputField.h; sourceTree = "<group>"; };
-		F711CDB5246AD2E40009B204 /* TOPasscodeFixedInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeFixedInputView.m; sourceTree = "<group>"; };
-		F711CDB6246AD2E40009B204 /* TOPasscodeCircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeCircleView.m; sourceTree = "<group>"; };
-		F711CDB7246AD2E40009B204 /* TOPasscodeButtonLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeButtonLabel.m; sourceTree = "<group>"; };
-		F711CDB8246AD2E40009B204 /* TOPasscodeVariableInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeVariableInputView.m; sourceTree = "<group>"; };
-		F711CDB9246AD2E40009B204 /* TOPasscodeInputField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeInputField.m; sourceTree = "<group>"; };
-		F711CDBB246AD2E40009B204 /* TOPasscodeKeypadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeKeypadView.h; sourceTree = "<group>"; };
-		F711CDBC246AD2E40009B204 /* TOPasscodeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeView.h; sourceTree = "<group>"; };
-		F711CDBD246AD2E40009B204 /* TOPasscodeCircleButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeCircleButton.m; sourceTree = "<group>"; };
-		F711CDBE246AD2E40009B204 /* TOPasscodeKeypadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeKeypadView.m; sourceTree = "<group>"; };
-		F711CDBF246AD2E40009B204 /* TOPasscodeCircleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOPasscodeCircleButton.h; sourceTree = "<group>"; };
-		F711CDC0246AD2E40009B204 /* TOPasscodeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeView.m; sourceTree = "<group>"; };
-		F711CDC1246AD2E40009B204 /* TOPasscodeSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeSettingsViewController.m; sourceTree = "<group>"; };
 		F7151A811D477A4B00E6AF45 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F7169A171EE590930086BD69 /* NCShares.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCShares.h; sourceTree = "<group>"; };
 		F7169A181EE590930086BD69 /* NCShares.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCShares.m; sourceTree = "<group>"; };
@@ -925,6 +874,7 @@
 		F7AE00F4230D5F9E007ACF8A /* NCLoginWeb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLoginWeb.swift; sourceTree = "<group>"; };
 		F7AE00F7230E81CB007ACF8A /* NCBrowserWeb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCBrowserWeb.swift; sourceTree = "<group>"; };
 		F7AE00F9230E81EB007ACF8A /* NCBrowserWeb.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCBrowserWeb.storyboard; sourceTree = "<group>"; };
+		F7AF7632246BEDFE00B86E3C /* TOPasscodeViewController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TOPasscodeViewController.framework; path = Carthage/Build/iOS/TOPasscodeViewController.framework; sourceTree = "<group>"; };
 		F7B0C0CB1EE7E7750033AC24 /* CCSynchronize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSynchronize.h; sourceTree = "<group>"; };
 		F7B0C0CC1EE7E7750033AC24 /* CCSynchronize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSynchronize.m; sourceTree = "<group>"; };
 		F7B0C1731EE839A30033AC24 /* NCAutoUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCAutoUpload.h; sourceTree = "<group>"; };
@@ -1082,6 +1032,7 @@
 				F7A377161EB2364A002856D3 /* Crashlytics.framework in Frameworks */,
 				F733B65221997CC2001C1FFA /* TLPhotoPicker.framework in Frameworks */,
 				F7D4B6872295663D000C2C86 /* FirebaseAnalytics.framework in Frameworks */,
+				F7AF7633246BEDFE00B86E3C /* TOPasscodeViewController.framework in Frameworks */,
 				F7FC7D561DC1F93800BB2C6A /* libz.tbd in Frameworks */,
 				F7C40BE521998D5B0004137E /* MGSwipeTableCell.framework in Frameworks */,
 				F7D4B68B2295663D000C2C86 /* FirebaseInstanceID.framework in Frameworks */,
@@ -1207,7 +1158,6 @@
 				F7CA1EBB20E7E3FE002CC65E /* PKDownloadButton */,
 				F75037421DBFA91A008FB480 /* PureLayout */,
 				F70F05241C889184008DAB36 /* Reachability */,
-				F711CD98246AD2E40009B204 /* TOPasscodeViewController */,
 				F70F05561C889184008DAB36 /* UIImage+animatedGIF */,
 			);
 			path = "Libraries external";
@@ -1439,96 +1389,6 @@
 			path = LangModels;
 			sourceTree = "<group>";
 		};
-		F711CD98246AD2E40009B204 /* TOPasscodeViewController */ = {
-			isa = PBXGroup;
-			children = (
-				F711CD9A246AD2E40009B204 /* Models */,
-				F711CDA5246AD2E40009B204 /* Supporting */,
-				F711CDA3246AD2E40009B204 /* TOPasscodeSettingsViewController.h */,
-				F711CDC1246AD2E40009B204 /* TOPasscodeSettingsViewController.m */,
-				F711CDA4246AD2E40009B204 /* TOPasscodeViewController.h */,
-				F711CD99246AD2E40009B204 /* TOPasscodeViewController.m */,
-				F711CDA7246AD2E40009B204 /* Views */,
-			);
-			path = TOPasscodeViewController;
-			sourceTree = "<group>";
-		};
-		F711CD9A246AD2E40009B204 /* Models */ = {
-			isa = PBXGroup;
-			children = (
-				F711CD9B246AD2E40009B204 /* TOPasscodeCircleImage.h */,
-				F711CD9C246AD2E40009B204 /* TOPasscodeViewControllerAnimatedTransitioning.h */,
-				F711CD9D246AD2E40009B204 /* TOPasscodeViewContentLayout.h */,
-				F711CD9E246AD2E40009B204 /* TOSettingsKeypadImage.h */,
-				F711CD9F246AD2E40009B204 /* TOPasscodeCircleImage.m */,
-				F711CDA0246AD2E40009B204 /* TOPasscodeViewControllerAnimatedTransitioning.m */,
-				F711CDA1246AD2E40009B204 /* TOSettingsKeypadImage.m */,
-				F711CDA2246AD2E40009B204 /* TOPasscodeViewContentLayout.m */,
-			);
-			path = Models;
-			sourceTree = "<group>";
-		};
-		F711CDA5246AD2E40009B204 /* Supporting */ = {
-			isa = PBXGroup;
-			children = (
-				F711CDA6246AD2E40009B204 /* TOPasscodeViewControllerConstants.h */,
-			);
-			path = Supporting;
-			sourceTree = "<group>";
-		};
-		F711CDA7246AD2E40009B204 /* Views */ = {
-			isa = PBXGroup;
-			children = (
-				F711CDA8246AD2E40009B204 /* Settings */,
-				F711CDAF246AD2E40009B204 /* Shared */,
-				F711CDBA246AD2E40009B204 /* Main */,
-			);
-			path = Views;
-			sourceTree = "<group>";
-		};
-		F711CDA8246AD2E40009B204 /* Settings */ = {
-			isa = PBXGroup;
-			children = (
-				F711CDA9246AD2E40009B204 /* TOPasscodeSettingsKeypadView.h */,
-				F711CDAA246AD2E40009B204 /* TOPasscodeSettingsWarningLabel.h */,
-				F711CDAB246AD2E40009B204 /* TOPasscodeSettingsKeypadButton.h */,
-				F711CDAC246AD2E40009B204 /* TOPasscodeSettingsKeypadView.m */,
-				F711CDAD246AD2E40009B204 /* TOPasscodeSettingsWarningLabel.m */,
-				F711CDAE246AD2E40009B204 /* TOPasscodeSettingsKeypadButton.m */,
-			);
-			path = Settings;
-			sourceTree = "<group>";
-		};
-		F711CDAF246AD2E40009B204 /* Shared */ = {
-			isa = PBXGroup;
-			children = (
-				F711CDB0246AD2E40009B204 /* TOPasscodeCircleView.h */,
-				F711CDB1246AD2E40009B204 /* TOPasscodeFixedInputView.h */,
-				F711CDB2246AD2E40009B204 /* TOPasscodeVariableInputView.h */,
-				F711CDB3246AD2E40009B204 /* TOPasscodeButtonLabel.h */,
-				F711CDB4246AD2E40009B204 /* TOPasscodeInputField.h */,
-				F711CDB5246AD2E40009B204 /* TOPasscodeFixedInputView.m */,
-				F711CDB6246AD2E40009B204 /* TOPasscodeCircleView.m */,
-				F711CDB7246AD2E40009B204 /* TOPasscodeButtonLabel.m */,
-				F711CDB8246AD2E40009B204 /* TOPasscodeVariableInputView.m */,
-				F711CDB9246AD2E40009B204 /* TOPasscodeInputField.m */,
-			);
-			path = Shared;
-			sourceTree = "<group>";
-		};
-		F711CDBA246AD2E40009B204 /* Main */ = {
-			isa = PBXGroup;
-			children = (
-				F711CDBB246AD2E40009B204 /* TOPasscodeKeypadView.h */,
-				F711CDBC246AD2E40009B204 /* TOPasscodeView.h */,
-				F711CDBD246AD2E40009B204 /* TOPasscodeCircleButton.m */,
-				F711CDBE246AD2E40009B204 /* TOPasscodeKeypadView.m */,
-				F711CDBF246AD2E40009B204 /* TOPasscodeCircleButton.h */,
-				F711CDC0246AD2E40009B204 /* TOPasscodeView.m */,
-			);
-			path = Main;
-			sourceTree = "<group>";
-		};
 		F7169A161EE590930086BD69 /* Shares */ = {
 			isa = PBXGroup;
 			children = (
@@ -2198,6 +2058,7 @@
 		F7FC7D541DC1F93700BB2C6A /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				F7AF7632246BEDFE00B86E3C /* TOPasscodeViewController.framework */,
 				F7D2C772246470CA008513AE /* XLForm.framework */,
 				F79018A424092EF4007C9B6D /* ATGMediaBrowser.framework */,
 				F7DBD82B23E46A4700ECB7C6 /* MarkdownKit.framework */,
@@ -2625,6 +2486,7 @@
 				"$(SRCROOT)/Carthage/Build/iOS/FloatingPanel.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/MarkdownKit.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/XLForm.framework",
+				"$(SRCROOT)/Carthage/Build/iOS/TOPasscodeViewController.framework",
 			);
 			outputPaths = (
 			);
@@ -2749,7 +2611,6 @@
 				F77444F522281649000D5EB0 /* NCGridMediaCell.swift in Sources */,
 				F711CD5C246AC9B80009B204 /* nsEUCJPProber.cpp in Sources */,
 				F7E09CE323E3088000FB3E9E /* NCMainRefreshControl.swift in Sources */,
-				F711CDD1246AD2E40009B204 /* TOPasscodeView.m in Sources */,
 				F77B0DF41D118A16002130FE /* CCMain.m in Sources */,
 				F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */,
 				F7E9C41B20F4CA870040CF18 /* CCTransfers.m in Sources */,
@@ -2759,12 +2620,9 @@
 				F711CD66246AC9B80009B204 /* LangThaiModel.cpp in Sources */,
 				F7C525A01E3B48B700FFE02C /* CCNotification.swift in Sources */,
 				F711CCBA246AC99E0009B204 /* OCShareUser.m in Sources */,
-				F711CDCD246AD2E40009B204 /* TOPasscodeVariableInputView.m in Sources */,
 				F7B0C0CD1EE7E7750033AC24 /* CCSynchronize.m in Sources */,
 				F711CCE2246AC99E0009B204 /* OCNotifications.m in Sources */,
 				F710D1FE24057E5E00A6033D /* NCActionSheetHeader.swift in Sources */,
-				F711CDCF246AD2E40009B204 /* TOPasscodeCircleButton.m in Sources */,
-				F711CDC5246AD2E40009B204 /* TOSettingsKeypadImage.m in Sources */,
 				F77B0DFF1D118A16002130FE /* OCNetworking.m in Sources */,
 				F790110E21415BF600D7B136 /* NCViewerRichdocument.swift in Sources */,
 				F78ACD4021903CC20088454D /* NCGridCell.swift in Sources */,
@@ -2779,7 +2637,6 @@
 				F78ACD4221903CE00088454D /* NCListCell.swift in Sources */,
 				F76D3CF12428B40E005DFA87 /* NCViewerPDFSearch.swift in Sources */,
 				F78ACD4F2190440D0088454D /* NCLayout.swift in Sources */,
-				F711CDC7246AD2E40009B204 /* TOPasscodeSettingsKeypadView.m in Sources */,
 				F73F537F1E929C8500F8678D /* CCMore.swift in Sources */,
 				F79018B7240962C7007C9B6D /* NCViewerImageContentView.swift in Sources */,
 				F711CCD6246AC99E0009B204 /* NSDate+ISO8601.m in Sources */,
@@ -2787,26 +2644,21 @@
 				F711CD6F246AC9B80009B204 /* LangDanishModel.cpp in Sources */,
 				F7DFB7F0219C5B8000680748 /* NCCreateFormUploadAssets.swift in Sources */,
 				371B5A2E23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift in Sources */,
-				F711CDC8246AD2E40009B204 /* TOPasscodeSettingsWarningLabel.m in Sources */,
 				F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */,
 				F711CD6B246AC9B80009B204 /* LangEsperantoModel.cpp in Sources */,
 				F77444F8222816D5000D5EB0 /* NCPhotosPickerViewController.swift in Sources */,
 				F711CCDE246AC99E0009B204 /* NCComments.m in Sources */,
 				F77B0E141D118A16002130FE /* CCError.m in Sources */,
-				F711CDC4246AD2E40009B204 /* TOPasscodeViewControllerAnimatedTransitioning.m in Sources */,
 				F7E09CE523E3088C00FB3E9E /* NCSplitViewController.swift in Sources */,
 				F710D1F724057C9400A6033D /* NCDetailNavigationController.swift in Sources */,
 				F769454622E9F1B0000A798A /* NCShareCommon.swift in Sources */,
-				F711CDCE246AD2E40009B204 /* TOPasscodeInputField.m in Sources */,
 				F7B0C1751EE839A30033AC24 /* NCAutoUpload.m in Sources */,
 				F738E8421F90FFD100F95C8E /* NCManageEndToEndEncryption.m in Sources */,
 				F78A18B823CDE2B300F681F3 /* NCViewerRichWorkspace.swift in Sources */,
 				F711CD60246AC9B80009B204 /* nsSJISProber.cpp in Sources */,
 				F78A18B623CDD07D00F681F3 /* NCViewerRichWorkspaceWebView.swift in Sources */,
-				F711CDD2246AD2E40009B204 /* TOPasscodeSettingsViewController.m in Sources */,
 				F75A9EE623796C6F0044CFCE /* NCNetworking.swift in Sources */,
 				F758B460212C56A400515F55 /* ScanCollectionView.swift in Sources */,
-				F711CDC6246AD2E40009B204 /* TOPasscodeViewContentLayout.m in Sources */,
 				F711CD67246AC9B80009B204 /* LangSpanishModel.cpp in Sources */,
 				F78ACD52219046DC0088454D /* NCSectionHeaderFooter.swift in Sources */,
 				F711CD65246AC9B80009B204 /* LangFrenchModel.cpp in Sources */,
@@ -2848,7 +2700,6 @@
 				F711CD62246AC9B80009B204 /* LangHungarianModel.cpp in Sources */,
 				F711CD04246AC9B10009B204 /* DropdownItem.swift in Sources */,
 				F711CD72246AC9B80009B204 /* nsUniversalDetector.cpp in Sources */,
-				F711CDCB246AD2E40009B204 /* TOPasscodeCircleView.m in Sources */,
 				F711CCB2246AC99E0009B204 /* OCFileDto.m in Sources */,
 				F711CD63246AC9B80009B204 /* LangVietnameseModel.cpp in Sources */,
 				F7682FE023C36B0500983A04 /* NCMainTabBar.swift in Sources */,
@@ -2858,10 +2709,8 @@
 				F711CCD4246AC99E0009B204 /* OCWebDAVClient.m in Sources */,
 				3781B9B223DB2B9F006B4B1D /* CCMain+Menu.swift in Sources */,
 				F7651A8B23A2A3F2001403D2 /* NCCreateFormUploadDocuments.swift in Sources */,
-				F711CDD0246AD2E40009B204 /* TOPasscodeKeypadView.m in Sources */,
 				F7417DB3216CE925007D05F5 /* NCTrashSectionHeaderFooter.swift in Sources */,
 				F711CD51246AC9B80009B204 /* nsMBCSGroupProber.cpp in Sources */,
-				F711CDC2246AD2E40009B204 /* TOPasscodeViewController.m in Sources */,
 				F7F878AE1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */,
 				F7DBC37C23325E02001A85BA /* NCAppConfigView.swift in Sources */,
 				F711CCC6246AC99E0009B204 /* NCXMLListParser.m in Sources */,
@@ -2928,7 +2777,6 @@
 				F707C26521A2DC5200F6181E /* NCStoreReview.swift in Sources */,
 				F7BAADCB1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */,
 				F79018B9240962C7007C9B6D /* NCViewerImageContentTransformers.swift in Sources */,
-				F711CDC3246AD2E40009B204 /* TOPasscodeCircleImage.m in Sources */,
 				F70968A424212C4E00ED60E5 /* NCLivePhoto.swift in Sources */,
 				F7A321551E9E2A070069AD1B /* CCFavorites.m in Sources */,
 				F711CCCA246AC99E0009B204 /* NCXMLGetAppPasswordParser.m in Sources */,
@@ -2947,8 +2795,6 @@
 				F7CA1ED820E7E3FE002CC65E /* PKBorderedButton.m in Sources */,
 				F704B5E52430AA8000632F5F /* NCCreateFormUploadConflict.swift in Sources */,
 				F765608F23BF813600765969 /* NCContentPresenter.swift in Sources */,
-				F711CDCC246AD2E40009B204 /* TOPasscodeButtonLabel.m in Sources */,
-				F711CDC9246AD2E40009B204 /* TOPasscodeSettingsKeypadButton.m in Sources */,
 				F70CEF5623E9C7E50007035B /* UIColor+adjust.swift in Sources */,
 				F711CD73246AC9B80009B204 /* nsEscCharsetProber.cpp in Sources */,
 				F75AC2431F1F62450073EC19 /* NCManageAutoUploadFileName.swift in Sources */,
@@ -2966,7 +2812,6 @@
 				F77B0ED51D118A16002130FE /* PHAsset+Utility.m in Sources */,
 				F711CCB0246AC99E0009B204 /* NCRichDocumentTemplate.m in Sources */,
 				F77B0ED91D118A16002130FE /* main.m in Sources */,
-				F711CDCA246AD2E40009B204 /* TOPasscodeFixedInputView.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 1 - 1
iOSClient/AppDelegate.m

@@ -32,7 +32,7 @@
 #import "NCAutoUpload.h"
 #import "NCPushNotificationEncryption.h"
 #import <QuartzCore/QuartzCore.h>
-#import "TOPasscodeViewController.h"
+#import <TOPasscodeViewController/TOPasscodeViewController.h>
 
 @class NCViewerRichdocument;
 

+ 3 - 2
iOSClient/Settings/CCSettings.m

@@ -30,8 +30,8 @@
 #import "CCManageAccount.h"
 #import "NCManageEndToEndEncryption.h"
 #import "NCBridgeSwift.h"
-#import "TOPasscodeSettingsViewController.h"
-#import "TOPasscodeViewController.h"
+#import <TOPasscodeViewController/TOPasscodeViewController.h>
+
 
 #define alertViewEsci 1
 #define alertViewAzzeraCache 2
@@ -373,6 +373,7 @@
             }
         }
         
+        settingsController.hideOptionsButton = YES;
         settingsController.requireCurrentPasscode = NO;
         settingsController.passcodeType = TOPasscodeTypeSixDigits;
         settingsController.delegate = self;

+ 1 - 1
iOSClient/Settings/NCManageEndToEndEncryption.m

@@ -24,7 +24,7 @@
 #import "NCManageEndToEndEncryption.h"
 #import "AppDelegate.h"
 #import "CCNetworking.h"
-#import "TOPasscodeViewController.h"
+#import <TOPasscodeViewController/TOPasscodeViewController.h>
 
 #import "NCBridgeSwift.h"