Quellcode durchsuchen

Merge pull request #1192 from Infomaniak/remove-unused-dep

Remove AHKActionSheet
Marino Faggiana vor 5 Jahren
Ursprung
Commit
eca1726ff0

+ 0 - 20
Nextcloud.xcodeproj/project.pbxproj

@@ -128,8 +128,6 @@
 		F723B3DD22FC6D1D00301EFE /* NCShareCommentsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F723B3DC22FC6D1C00301EFE /* NCShareCommentsCell.xib */; };
 		F7267A82225DFCE100D6DB7D /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7267A81225DFCE100D6DB7D /* AFNetworking.framework */; };
 		F726EEEC1FED1C820030B9C8 /* NCEndToEndInitialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = F726EEEB1FED1C820030B9C8 /* NCEndToEndInitialize.swift */; };
-		F72AAECA1E5C60C700BB17E1 /* AHKActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */; };
-		F72AAECB1E5C60C700BB17E1 /* AHKActionSheetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */; };
 		F72D1007210B6882009C96B7 /* NCPushNotificationEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */; };
 		F72D404923D2082500A97FD0 /* NCViewerNextcloudText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72D404823D2082500A97FD0 /* NCViewerNextcloudText.swift */; };
 		F72E0B9D21AD60BC00898D7B /* WeScan.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F72E0B9C21AD60BC00898D7B /* WeScan.framework */; };
@@ -735,10 +733,6 @@
 		F728B2BB23E83AD200E12DA0 /* Notification_Service_Extension.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Notification_Service_Extension.plist; sourceTree = "<group>"; };
 		F728B2BC23E83AD200E12DA0 /* Notification_Service_Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Notification_Service_Extension.entitlements; sourceTree = "<group>"; };
 		F7296A661C8880ED001A7809 /* CCloadItemData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCloadItemData.swift; sourceTree = "<group>"; };
-		F72AAEC21E5C60C700BB17E1 /* AHKActionSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AHKActionSheet.h; sourceTree = "<group>"; };
-		F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AHKActionSheet.m; sourceTree = "<group>"; };
-		F72AAEC41E5C60C700BB17E1 /* AHKActionSheetViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AHKActionSheetViewController.h; sourceTree = "<group>"; };
-		F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AHKActionSheetViewController.m; sourceTree = "<group>"; };
 		F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCPushNotificationEncryption.m; sourceTree = "<group>"; };
 		F72D1006210B6882009C96B7 /* NCPushNotificationEncryption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCPushNotificationEncryption.h; sourceTree = "<group>"; };
 		F72D404823D2082500A97FD0 /* NCViewerNextcloudText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerNextcloudText.swift; sourceTree = "<group>"; };
@@ -1631,17 +1625,6 @@
 			path = Share;
 			sourceTree = "<group>";
 		};
-		F72AAEC11E5C60C700BB17E1 /* AHKActionSheet */ = {
-			isa = PBXGroup;
-			children = (
-				F72AAEC21E5C60C700BB17E1 /* AHKActionSheet.h */,
-				F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */,
-				F72AAEC41E5C60C700BB17E1 /* AHKActionSheetViewController.h */,
-				F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */,
-			);
-			path = AHKActionSheet;
-			sourceTree = "<group>";
-		};
 		F72B60941A24F04E004EF66F /* Localizations */ = {
 			isa = PBXGroup;
 			children = (
@@ -2481,7 +2464,6 @@
 		F7F54CAC1E5B143100E19C62 /* Library */ = {
 			isa = PBXGroup;
 			children = (
-				F72AAEC11E5C60C700BB17E1 /* AHKActionSheet */,
 				F73CC0571E813DFF006E3047 /* BKPasscodeView */,
 				F754EEC321772B6100BB1CDF /* DropdownMenu */,
 				F7B4F1C51F44356F00B53B42 /* NCUchardet */,
@@ -3371,7 +3353,6 @@
 				F73B4EF91F470D9100BBEE4B /* LangEsperantoModel.cpp in Sources */,
 				F77B0E8F1D118A16002130FE /* CCSection.m in Sources */,
 				F7CA1ED720E7E3FE002CC65E /* PKDownloadButton.m in Sources */,
-				F72AAECB1E5C60C700BB17E1 /* AHKActionSheetViewController.m in Sources */,
 				F760F79B21F21F61006B1A73 /* ColorCollectionViewCell.swift in Sources */,
 				F77B0E921D118A16002130FE /* CCCellMainTransfer.m in Sources */,
 				F77B0E981D118A16002130FE /* CCManageAccount.m in Sources */,
@@ -3452,7 +3433,6 @@
 				F758B45E212C569D00515F55 /* ScanCell.swift in Sources */,
 				F781996922636BFA00EBDF6A /* HCFeatures.m in Sources */,
 				F70022FE1EC4C9100080073F /* UtilsFramework.m in Sources */,
-				F72AAECA1E5C60C700BB17E1 /* AHKActionSheet.m in Sources */,
 				F7CA1ED920E7E3FE002CC65E /* NSLayoutConstraint+PKDownloadButton.m in Sources */,
 				F74E432620B5547700C2E54C /* NCNetworkingEndToEnd.m in Sources */,
 				F73B4F141F470D9100BBEE4B /* nsUTF8Prober.cpp in Sources */,

+ 0 - 1
iOSClient/Favorites/CCFavorites.h

@@ -24,7 +24,6 @@
 #import <UIKit/UIKit.h>
 #import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>
 
-#import "AHKActionSheet.h"
 #import "CCCellMain.h"
 #import "CCCellMainTransfer.h"
 #import "CCUtility.h"

+ 0 - 95
iOSClient/Library/AHKActionSheet/AHKActionSheet.h

@@ -1,95 +0,0 @@
-//
-//  AHKActionSheet.h
-//  AHKActionSheetExample
-//
-//  Created by Arkadiusz on 08-04-14.
-//  Copyright (c) 2014 Arkadiusz Holko. All rights reserved.
-//
-
-//  Modify by Marino Faggiana on 11/01/17.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, AHKActionSheetButtonType) {
-    AHKActionSheetButtonTypeDefault = 0,
-	AHKActionSheetButtonTypeDisabled,
-    AHKActionSheetButtonTypeDestructive,
-    AHKActionSheetButtonTypeEncrypted
-};
-
-@class AHKActionSheet;
-typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
-
-
-/// A block-based alternative to the `UIAlertView`.
-@interface AHKActionSheet : UIView <UIAppearanceContainer>
-
-// Appearance - all of the following properties should be set before showing the action sheet. See `+initialize` to learn the default values of all properties.
-
-/**
- *  See UIImage+AHKAdditions.h/.m to learn how these three properties are used.
- */
-
-/// Height of the button (internally it's a `UITableViewCell`).
-@property (nonatomic) CGFloat buttonHeight UI_APPEARANCE_SELECTOR;
-/// Height of the cancel button.
-@property (nonatomic) CGFloat cancelButtonHeight UI_APPEARANCE_SELECTOR;
-/// Height separator from cancelButtonHeight and table
-@property (nonatomic) CGFloat separatorHeight UI_APPEARANCE_SELECTOR;
-/**
- *  If set, a small shadow (a gradient layer) will be drawn above the cancel button to separate it visually from the other buttons.
- *  It's best to use a color similar (but maybe with a lower alpha value) to blurTintColor.
- *  See "Advanced" example in the example project to see it used.
- */
-/// Boxed (@YES, @NO) boolean value (enabled by default). Isn't supported on iOS 6.
-@property (strong, nonatomic) NSNumber *automaticallyTintButtonImages UI_APPEARANCE_SELECTOR;
-/// Boxed boolean value. Useful when adding buttons without images (in that case text looks better centered). Disabled by default.
-@property (strong, nonatomic) NSNumber *buttonTextCenteringEnabled UI_APPEARANCE_SELECTOR;
-/// Color of the separator between buttons.
-@property (strong, nonatomic) UIColor *separatorColor UI_APPEARANCE_SELECTOR;
-/// Text attributes of the title (passed in initWithTitle: or set via `title` property)
-@property (copy, nonatomic) NSDictionary *buttonTextAttributes UI_APPEARANCE_SELECTOR;
-@property (copy, nonatomic) NSDictionary *disableButtonTextAttributes UI_APPEARANCE_SELECTOR;
-@property (copy, nonatomic) NSDictionary *destructiveButtonTextAttributes UI_APPEARANCE_SELECTOR;
-@property (copy, nonatomic) NSDictionary *encryptedButtonTextAttributes UI_APPEARANCE_SELECTOR;
-@property (copy, nonatomic) NSDictionary *cancelButtonTextAttributes UI_APPEARANCE_SELECTOR;
-/// Duration of the show/dismiss animations. Defaults to 0.5.
-@property (nonatomic) NSTimeInterval animationDuration UI_APPEARANCE_SELECTOR;
-
-/// Boxed boolean value. Enables/disables control hiding with pan gesture. Enabled by default.
-@property (strong, nonatomic) NSNumber *cancelOnPanGestureEnabled UI_APPEARANCE_SELECTOR;
-
-/// Boxed boolean value. Enables/disables control hiding when tapped on empty area. Disabled by default.
-@property (strong, nonatomic) NSNumber *cancelOnTapEmptyAreaEnabled UI_APPEARANCE_SELECTOR;
-
-/// A handler called on every type of dismissal (tapping on "Cancel" or swipe down or flick down).
-@property (strong, nonatomic) AHKActionSheetHandler cancelHandler;
-@property (copy, nonatomic) NSString *cancelButtonTitle;
-@property (copy, nonatomic) UIColor *cancelButtonBackgroudColor;
-
-/// String to display above the buttons.
-@property (copy, nonatomic) NSString *title;
-/// View to display above the buttons (only if the title isn't set).
-@property (strong, nonatomic) UIView *headerView;
-/// Window visible before the actionSheet was presented.
-@property (weak, nonatomic, readonly) UIWindow *previousKeyWindow;
-/// View actionSheet was presented.
-@property (nonatomic, weak) UIView *view;
-/// Extra Bottom Padding for iPhone X
-@property CGFloat bottomPadding;
-
-- (instancetype)initWithView:(UIView *)view title:(NSString *)title;
-
-- (void)addButtonWithTitle:(NSString *)title image:(UIImage *)image backgroundColor:(UIColor *)backgroundColor height:(CGFloat)height type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler;
-
-/// Displays the action sheet.
-- (void)show;
-
-/// Dismisses the action sheet with an optional animation.
-- (void)dismissAnimated:(BOOL)animated;
-
-@end

+ 0 - 573
iOSClient/Library/AHKActionSheet/AHKActionSheet.m

@@ -1,573 +0,0 @@
-//
-//  AHKActionSheet.m
-//  AHKActionSheetExample
-//
-//  Created by Arkadiusz on 08-04-14.
-//  Copyright (c) 2014 Arkadiusz Holko. All rights reserved.
-//
-
-//  Modify by Marino Faggiana on 11/01/17.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-
-#import <QuartzCore/QuartzCore.h>
-#import "AHKActionSheet.h"
-#import "AHKActionSheetViewController.h"
-
-
-static const NSTimeInterval kDefaultAnimationDuration = 0.2f;
-// Length of the range at which the blurred background is being hidden when the user scrolls the tableView to the top.
-static const CGFloat kBlurFadeRangeSize = 200.0f;
-static NSString * const kCellIdentifier = @"Cell";
-// How much user has to scroll beyond the top of the tableView for the view to dismiss automatically.
-static const CGFloat kAutoDismissOffset = 80.0f;
-// Offset at which there's a check if the user is flicking the tableView down.
-static const CGFloat kFlickDownHandlingOffset = 20.0f;
-static const CGFloat kFlickDownMinVelocity = 2000.0f;
-// How much free space to leave at the top (above the tableView's contents) when there's a lot of elements. It makes this control look similar to the UIActionSheet.
-static const CGFloat kTopSpaceMarginFraction = 0.0f;
-// cancelButton's shadow height as the ratio to the cancelButton's height
-static const CGFloat kSpaceDivide = 5.0f;
-// width iPhone 7 Plus
-static const CGFloat maxWidth = 414.0f;
-
-
-/// Used for storing button configuration.
-@interface AHKActionSheetItem : NSObject
-@property (copy, nonatomic) NSString *title;
-@property (strong, nonatomic) UIImage *image;
-@property (nonatomic) AHKActionSheetButtonType type;
-@property (strong, nonatomic) AHKActionSheetHandler handler;
-@property (nonatomic, strong) UIColor *backgroundColor;
-@property (nonatomic) CGFloat height;
-@end
-
-@implementation AHKActionSheetItem
-@end
-
-
-
-@interface AHKActionSheet() <UITableViewDataSource, UITableViewDelegate, UIGestureRecognizerDelegate>
-@property (strong, nonatomic) NSMutableArray *items;
-@property (weak, nonatomic, readwrite) UIWindow *previousKeyWindow;
-@property (strong, nonatomic) UIWindow *window;
-@property (weak, nonatomic) UIView *blurredBackgroundView;
-@property (weak, nonatomic) UITableView *tableView;
-@property (weak, nonatomic) UIButton *cancelButton;
-@end
-
-@implementation AHKActionSheet
-
-#pragma mark - Init
-
-+ (void)initialize
-{
-    if (self != [AHKActionSheet class]) {
-        return;
-    }
-
-    AHKActionSheet *appearance = [self appearance];
-    [appearance setButtonHeight:50.0f];
-    [appearance setSeparatorHeight:5.0f];
-    [appearance setCancelButtonHeight:44.0f];
-    [appearance setAutomaticallyTintButtonImages:@YES];
-    [appearance setCancelButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f], NSForegroundColorAttributeName : [UIColor darkGrayColor] }];
-    [appearance setButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f]}];
-    [appearance setDisableButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f]}];
-    [appearance setDestructiveButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f], NSForegroundColorAttributeName : [UIColor redColor] }];
-    [appearance setCancelOnPanGestureEnabled:@(NO)];
-    [appearance setCancelOnTapEmptyAreaEnabled:@(YES)];
-    [appearance setAnimationDuration:kDefaultAnimationDuration];
-}
-
-- (instancetype)initWithView:(UIView *)view title:(NSString *)title
-{
-    self = [super init];
-    
-    if (self) {
-        _title = [title copy];
-        _cancelButtonTitle = @"Cancel";
-        _view = view;
-        if (@available(iOS 11, *)) {
-            _bottomPadding = view.safeAreaInsets.bottom;
-        }
-    }
-    
-    return self;
-}
-
-- (void)dealloc
-{
-    self.tableView.dataSource = nil;
-    self.tableView.delegate = nil;
-}
-
-#pragma mark - UITableViewDataSource
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return 1;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    return (NSInteger)[self.items count];
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    UITableViewCell *cell;
-    
-    if (cell == nil)
-        cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier forIndexPath:indexPath];
-    
-    //cell.selectionStyle = UITableViewCellSelectionStyleNone;
-    
-    AHKActionSheetItem *item = self.items[(NSUInteger)indexPath.row];
-
-    NSDictionary *attributes = nil;
-    switch (item.type)
-    {
-        case AHKActionSheetButtonTypeDefault:
-            attributes = self.buttonTextAttributes;
-            break;
-        case AHKActionSheetButtonTypeDisabled:
-            attributes = self.disableButtonTextAttributes;
-            cell.selectionStyle = UITableViewCellSelectionStyleNone;
-            break;
-        case AHKActionSheetButtonTypeDestructive:
-            attributes = self.destructiveButtonTextAttributes;
-            break;
-        case AHKActionSheetButtonTypeEncrypted:
-            attributes = self.encryptedButtonTextAttributes;
-            break;
-    }
-    
-    UIImageView *imageView;
-    
-    if (item.type == AHKActionSheetButtonTypeDisabled) {
-        
-        imageView = [[UIImageView alloc]initWithFrame:CGRectMake(20, _buttonHeight/2 - (30/2), 30, 30)];
-        imageView.backgroundColor = [UIColor clearColor];
-        [imageView setImage:item.image];
-        
-    } else {
-        
-        imageView = [[UIImageView alloc]initWithFrame:CGRectMake(20, _buttonHeight/2 - (25/2), 25, 25)];
-        
-        BOOL useTemplateMode = [UIImage instancesRespondToSelector:@selector(imageWithRenderingMode:)] && [self.automaticallyTintButtonImages boolValue];
-
-        imageView.image = useTemplateMode ? [item.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] : item.image;
-        
-        if ([UIImageView instancesRespondToSelector:@selector(tintColor)]){
-            imageView.tintColor = attributes[NSForegroundColorAttributeName] ? attributes[NSForegroundColorAttributeName] : [UIColor blackColor];
-        }
-    }
-    
-    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(cell.frame.size.height + 5 , 0, cell.frame.size.width - cell.frame.size.height - 20, cell.frame.size.height)];
-    NSAttributedString *attrTitle = [[NSAttributedString alloc] initWithString:item.title attributes:attributes];
-    label.text =  [NSString stringWithFormat: @"test"];
-    label.numberOfLines = 0;
-    label.attributedText = attrTitle;
-    label.textAlignment = [self.buttonTextCenteringEnabled boolValue] ? NSTextAlignmentCenter : NSTextAlignmentLeft;
-    
-    cell.backgroundColor = item.backgroundColor;
-    cell.selectedBackgroundView = [self createBackgroundView:tableView cell:cell forRowAtIndexPath:indexPath color:self.separatorColor];
-    
-    for (UIView *subview in [cell.contentView subviews])
-        [subview removeFromSuperview];
-    
-    [cell.contentView addSubview:imageView];
-    [cell.contentView addSubview:label];
-
-    return cell;
-}
-
-#pragma mark - UITableViewDelegate
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    AHKActionSheetItem *item = self.items[(NSUInteger)indexPath.row];
-    
-    if (item.type != AHKActionSheetButtonTypeDisabled) {
-        [self dismissAnimated:YES duration:self.animationDuration completion:item.handler];
-    }
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    AHKActionSheetItem *item = self.items[(NSUInteger)indexPath.row];
-    return item.height;
-}
-
-- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    AHKActionSheetItem *item = self.items[(NSUInteger)indexPath.row];
-    
-    cell.backgroundView = [self createBackgroundView:tableView cell:cell forRowAtIndexPath:indexPath color:item.backgroundColor];
-}
-
-- (UIView *)createBackgroundView:(UITableView *)tableView cell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath color:(UIColor *)color
-{
-    CGFloat cornerRadius = 10.f;
-    cell.backgroundColor = UIColor.clearColor;
-    CAShapeLayer *layer = [[CAShapeLayer alloc] init];
-    CGMutablePathRef pathRef = CGPathCreateMutable();
-    CGRect bounds = CGRectInset(cell.bounds, 10, 0);
-    BOOL addLine = NO;
-    
-    if (indexPath.row == 0 && indexPath.row == [tableView numberOfRowsInSection:indexPath.section]-1) {
-        CGPathAddRoundedRect(pathRef, nil, bounds, cornerRadius, cornerRadius);
-    } else if (indexPath.row == 0) {
-        CGPathMoveToPoint(pathRef, nil, CGRectGetMinX(bounds), CGRectGetMaxY(bounds));
-        CGPathAddArcToPoint(pathRef, nil, CGRectGetMinX(bounds), CGRectGetMinY(bounds), CGRectGetMidX(bounds), CGRectGetMinY(bounds), cornerRadius);
-        CGPathAddArcToPoint(pathRef, nil, CGRectGetMaxX(bounds), CGRectGetMinY(bounds), CGRectGetMaxX(bounds), CGRectGetMidY(bounds), cornerRadius);
-        CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(bounds), CGRectGetMaxY(bounds));
-        addLine = YES;
-    } else if (indexPath.row == [tableView numberOfRowsInSection:indexPath.section]-1) {
-        CGPathMoveToPoint(pathRef, nil, CGRectGetMinX(bounds), CGRectGetMinY(bounds));
-        CGPathAddArcToPoint(pathRef, nil, CGRectGetMinX(bounds), CGRectGetMaxY(bounds), CGRectGetMidX(bounds), CGRectGetMaxY(bounds), cornerRadius);
-        CGPathAddArcToPoint(pathRef, nil, CGRectGetMaxX(bounds), CGRectGetMaxY(bounds), CGRectGetMaxX(bounds), CGRectGetMidY(bounds), cornerRadius);
-        CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(bounds), CGRectGetMinY(bounds));
-    } else {
-        CGPathAddRect(pathRef, nil, bounds);
-        addLine = YES;
-    }
-    
-    if (addLine == YES) {
-        CALayer *lineLayer = [[CALayer alloc] init];
-        CGFloat lineHeight = (1.f / [UIScreen mainScreen].scale);
-        lineLayer.frame = CGRectMake(CGRectGetMinX(bounds), bounds.size.height-lineHeight, bounds.size.width, lineHeight);
-        lineLayer.backgroundColor = tableView.separatorColor.CGColor;
-        [layer addSublayer:lineLayer];
-    }
-
-    layer.path = pathRef;
-    CFRelease(pathRef);
-    layer.fillColor = color.CGColor;
-
-    UIView *testView = [[UIView alloc] initWithFrame:bounds];
-    [testView.layer insertSublayer:layer atIndex:0];
-    testView.backgroundColor = UIColor.clearColor;
-
-    return testView;
-}
-
-
-#pragma mark - UIScrollViewDelegate
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView
-{
-    if (![self.cancelOnPanGestureEnabled boolValue]) {
-        return;
-    }
-
-    [self fadeBlursOnScrollToTop];
-}
-
-- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
-{
-    if (![self.cancelOnPanGestureEnabled boolValue]) {
-        return;
-    }
-
-    CGPoint scrollVelocity = [scrollView.panGestureRecognizer velocityInView:self];
-
-    BOOL viewWasFlickedDown = scrollVelocity.y > kFlickDownMinVelocity && scrollView.contentOffset.y < -self.tableView.contentInset.top - kFlickDownHandlingOffset;
-    BOOL shouldSlideDown = scrollView.contentOffset.y < -self.tableView.contentInset.top - kAutoDismissOffset;
-    if (viewWasFlickedDown) {
-        // use a shorter duration for a flick down animation
-        static const NSTimeInterval duration = 0.2f;
-        [self dismissAnimated:YES duration:duration completion:self.cancelHandler];
-    } else if (shouldSlideDown) {
-        [self dismissAnimated:YES duration:self.animationDuration completion:self.cancelHandler];
-    }
-}
-
-#pragma mark - Properties
-
-- (NSMutableArray *)items
-{
-    if (!_items) {
-        _items = [NSMutableArray array];
-    }
-
-    return _items;
-}
-
-#pragma mark - Actions
-
-- (void)cancelButtonTapped:(id)sender
-{
-    [self dismissAnimated:YES duration:self.animationDuration completion:self.cancelHandler];
-}
-
-#pragma mark - Public
-
-- (void)addButtonWithTitle:(NSString *)title image:(UIImage *)image backgroundColor:(UIColor *)backgroundColor height:(CGFloat)height type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler
-{
-    AHKActionSheetItem *item = [[AHKActionSheetItem alloc] init];
-    item.title = title;
-    item.image = image;
-    item.backgroundColor = backgroundColor;
-    item.height = height;
-    item.type = type;
-    item.handler = handler;
-    [self.items addObject:item];
-}
-
-- (void)show
-{
-    if ([self isVisible]) {
-        return;
-    }
-
-    self.previousKeyWindow = [UIApplication sharedApplication].keyWindow;
-
-    [self setUpNewWindow];
-    [self setUpBlurredBackground];
-    [self setUpCancelButton];
-    [self setUpTableView];
-    
-    if (self.cancelOnTapEmptyAreaEnabled.boolValue) {
-        [self setUpCancelTapGestureForView:self.tableView];
-        [self setUpCancelTapGestureForView:self.blurredBackgroundView];
-    }
-    
-    CGFloat slideDownMinOffset = (CGFloat)fmin(CGRectGetHeight(self.frame) + self.tableView.contentOffset.y, CGRectGetHeight(self.frame));
-    self.tableView.transform = CGAffineTransformMakeTranslation(0, slideDownMinOffset);
-
-    void(^immediateAnimations)(void) = ^(void) {
-        self.blurredBackgroundView.alpha = 1.0f;
-    };
-
-    void(^delayedAnimations)(void) = ^(void) {
-        
-        CGFloat width = CGRectGetWidth(self.view.bounds);
-        if (width > maxWidth) width = maxWidth;
-        
-        self.cancelButton.frame = CGRectMake(10 + (CGRectGetWidth(self.view.bounds)/2 - width/2), CGRectGetMaxY(self.view.bounds) - self.cancelButtonHeight - _bottomPadding, width - 20, self.cancelButtonHeight - kSpaceDivide);
-    
-        // Corner Radius
-        self.cancelButton.layer.cornerRadius = 10;
-        self.cancelButton.clipsToBounds = YES;
-        
-        // Add White color background
-        if (self.cancelButtonBackgroudColor == nil) {
-            self.cancelButton.backgroundColor = [UIColor whiteColor];
-        } else {
-            self.cancelButton.backgroundColor = self.cancelButtonBackgroudColor;
-        }
-        
-        self.tableView.transform = CGAffineTransformMakeTranslation(0, 0);
-
-        // manual calculation of table's contentSize.height
-        CGFloat tableContentHeight = 0;
-        
-        for (AHKActionSheetItem *item in self.items) {
-            tableContentHeight = tableContentHeight + item.height;
-        }
-        tableContentHeight = tableContentHeight + self.separatorHeight + CGRectGetHeight(self.tableView.tableHeaderView.frame);
-        
-        CGFloat topInset;
-        BOOL buttonsFitInWithoutScrolling = tableContentHeight < CGRectGetHeight(self.tableView.frame) * (1.0 - kTopSpaceMarginFraction);
-        if (buttonsFitInWithoutScrolling) {
-            // show all buttons if there isn't many
-            topInset = CGRectGetHeight(self.tableView.frame) - tableContentHeight;
-        } else {
-            // leave an empty space on the top to make the control look similar to UIActionSheet
-            topInset = (CGFloat)round(CGRectGetHeight(self.tableView.frame) * kTopSpaceMarginFraction);
-        }
-        
-        self.tableView.contentInset = UIEdgeInsetsMake(topInset, 0, 0, 0);
-
-        self.tableView.bounces = [self.cancelOnPanGestureEnabled boolValue] || !buttonsFitInWithoutScrolling;
-    };
-
-    if ([UIView respondsToSelector:@selector(animateKeyframesWithDuration:delay:options:animations:completion:)]){
-        // Animate sliding in tableView and cancel button with keyframe animation for a nicer effect.
-        [UIView animateKeyframesWithDuration:self.animationDuration delay:0 options:0 animations:^{
-            immediateAnimations();
-
-            [UIView addKeyframeWithRelativeStartTime:0.3f relativeDuration:0.7f animations:^{
-                delayedAnimations();
-            }];
-        } completion:nil];
-
-    } else {
-
-        [UIView animateWithDuration:self.animationDuration animations:^{
-            immediateAnimations();
-            delayedAnimations();
-        }];
-    }
-}
-
-- (void)dismissAnimated:(BOOL)animated
-{
-    [self dismissAnimated:animated duration:self.animationDuration completion:self.cancelHandler];
-}
-
-#pragma mark - Private
-
-- (BOOL)isVisible
-{
-    // action sheet is visible iff it's associated with a window
-    return !!self.window;
-}
-
-- (void)dismissAnimated:(BOOL)animated duration:(NSTimeInterval)duration completion:(AHKActionSheetHandler)completionHandler
-{
-    if (![self isVisible]) {
-        return;
-    }
-
-    // delegate isn't needed anymore because tableView will be hidden (and we don't want delegate methods to be called now)
-    self.tableView.delegate = nil;
-    self.tableView.userInteractionEnabled = NO;
-    // keep the table from scrolling back up
-    self.tableView.contentInset = UIEdgeInsetsMake(-self.tableView.contentOffset.y, 0, 0, 0);
-
-    void(^tearDownView)(void) = ^(void) {
-        // remove the views because it's easiest to just recreate them if the action sheet is shown again
-        for (UIView *view in @[self.tableView, self.cancelButton, self.blurredBackgroundView, self.window]) {
-            [view removeFromSuperview];
-        }
-
-        self.window = nil;
-        [self.previousKeyWindow makeKeyAndVisible];
-
-        if (completionHandler) {
-            completionHandler(self);
-        }
-    };
-
-    if (animated) {
-        // animate sliding down tableView and cancelButton.
-        [UIView animateWithDuration:duration animations:^{
-            self.blurredBackgroundView.alpha = 0.0f;
-            self.cancelButton.transform = CGAffineTransformTranslate(self.cancelButton.transform, 0, self.cancelButtonHeight - kSpaceDivide + _bottomPadding);
-
-            // Shortest shift of position sufficient to hide all tableView contents below the bottom margin.
-            // contentInset isn't used here (unlike in -show) because it caused weird problems with animations in some cases.
-            CGFloat slideDownMinOffset = (CGFloat)fmin(CGRectGetHeight(self.frame) + self.tableView.contentOffset.y, CGRectGetHeight(self.frame));
-            self.tableView.transform = CGAffineTransformMakeTranslation(0, slideDownMinOffset);
-        } completion:^(BOOL finished) {
-            tearDownView();
-        }];
-    } else {
-        tearDownView();
-    }
-}
-
-- (void)setUpNewWindow
-{
-    AHKActionSheetViewController *actionSheetVC = [[AHKActionSheetViewController alloc] initWithNibName:nil bundle:nil];
-    actionSheetVC.actionSheet = self;
-
-    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
-    self.window.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    self.window.opaque = NO;
-    self.window.rootViewController = actionSheetVC;
-    [self.window makeKeyAndVisible];
-}
-
-- (void)setUpBlurredBackground
-{
-    UIView *backgroundView = [UIView new];
-    backgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
-    backgroundView.frame = [UIScreen mainScreen].bounds;
-    [self addSubview:backgroundView];
-    self.blurredBackgroundView = backgroundView;
-}
-
-- (void)setUpCancelTapGestureForView:(UIView*)view {
-    UITapGestureRecognizer *cancelTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cancelButtonTapped:)];
-    cancelTap.delegate = self;
-    [view addGestureRecognizer:cancelTap];
-}
-
-- (void)setUpCancelButton
-{
-    UIButton *cancelButton;
-    
-    CGFloat width = CGRectGetWidth(self.view.bounds);
-    if (width > maxWidth) width = maxWidth;
-
-    // It's hard to check if UIButtonTypeSystem enumeration exists, so we're checking existence of another method that was introduced in iOS 7.
-    if ([UIView instancesRespondToSelector:@selector(tintAdjustmentMode)]) {
-        cancelButton= [UIButton buttonWithType:UIButtonTypeSystem];
-    } else {
-        cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    }
-
-    NSAttributedString *attrTitle = [[NSAttributedString alloc] initWithString:self.cancelButtonTitle attributes:self.cancelButtonTextAttributes];
-    
-    [cancelButton setAttributedTitle:attrTitle forState:UIControlStateNormal];
-    [cancelButton addTarget:self action:@selector(cancelButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-    
-    cancelButton.frame = CGRectMake(10 + (CGRectGetWidth(self.view.bounds)/2 - width/2), CGRectGetMaxY(self.view.bounds) - self.cancelButtonHeight, width - 20, self.cancelButtonHeight - kSpaceDivide);
-    
-    // move the button below the screen (ready to be animated -show)
-    cancelButton.transform = CGAffineTransformMakeTranslation(0, self.cancelButtonHeight - kSpaceDivide);
-    cancelButton.clipsToBounds = YES;
-    [self addSubview:cancelButton];
-
-    self.cancelButton = cancelButton;
-}
-
-- (void)setUpTableView
-{
-    CGFloat width = CGRectGetWidth(self.view.bounds);
-    if (width > maxWidth) width = maxWidth;
-    
-    CGRect statusBarViewRect = [self convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
-    CGFloat statusBarHeight = CGRectGetHeight(statusBarViewRect);
-    
-    CGRect frame = CGRectMake((CGRectGetWidth(self.view.bounds)/2 - width/2), statusBarHeight, width, CGRectGetHeight(self.view.bounds) - statusBarHeight - self.cancelButtonHeight - self.separatorHeight - _bottomPadding);
-
-    UITableView *tableView = [[UITableView alloc] initWithFrame:frame];
-    
-    tableView.backgroundColor = [UIColor clearColor];
-    tableView.showsVerticalScrollIndicator = NO;
-    tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
-
-    if (self.separatorColor) {
-        tableView.separatorColor = self.separatorColor;
-    }
-    
-    tableView.delegate = self;
-    tableView.dataSource = self;
-    [tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kCellIdentifier];
-    [self insertSubview:tableView aboveSubview:self.blurredBackgroundView];
-    // move the content below the screen, ready to be animated in -show
-    tableView.contentInset = UIEdgeInsetsMake(CGRectGetHeight(self.view.bounds), 0, 0, 0);
-    // removes separators below the footer (between empty cells)
-    tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
-
-    self.tableView = tableView;
-}
-
-- (void)fadeBlursOnScrollToTop
-{
-    if (self.tableView.isDragging || self.tableView.isDecelerating) {
-        CGFloat alphaWithoutBounds = 1.0f - ( -(self.tableView.contentInset.top + self.tableView.contentOffset.y) / kBlurFadeRangeSize);
-        // limit alpha to the interval [0, 1]
-        CGFloat alpha = (CGFloat)fmax(fmin(alphaWithoutBounds, 1.0f), 0.0f);
-        self.blurredBackgroundView.alpha = alpha;
-    }
-}
-
-- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
-    // If the view that is touched is not the view associated with this view's table view, but
-    // is one of the sub-views, we should not recognize the touch.
-    // Original source: http://stackoverflow.com/questions/10755566/how-to-know-uitableview-is-pressed-when-empty
-    if (touch.view != self.tableView && [touch.view isDescendantOfView:self.tableView]) {
-        return NO;
-    }
-    return YES;
-}
-
-@end

+ 0 - 15
iOSClient/Library/AHKActionSheet/AHKActionSheetViewController.h

@@ -1,15 +0,0 @@
-//
-//  AHKActionSheetViewController.h
-//  AHKActionSheetExample
-//
-//  Created by Arkadiusz on 09-04-14.
-//  Copyright (c) 2014 Arkadiusz Holko. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@class AHKActionSheet;
-
-@interface AHKActionSheetViewController : UIViewController
-@property (strong, nonatomic) AHKActionSheet *actionSheet;
-@end

+ 0 - 83
iOSClient/Library/AHKActionSheet/AHKActionSheetViewController.m

@@ -1,83 +0,0 @@
-//
-//  AHKActionSheetViewController.m
-//  AHKActionSheetExample
-//
-//  Created by Arkadiusz on 09-04-14.
-//  Copyright (c) 2014 Arkadiusz Holko. All rights reserved.
-//
-
-#import "AHKActionSheetViewController.h"
-#import "AHKActionSheet.h"
-
-@interface AHKActionSheetViewController ()
-
-@property (nonatomic) BOOL viewAlreadyAppear;
-@property (nonatomic) UIInterfaceOrientation storeOrientation;
-
-@end
-
-@implementation AHKActionSheetViewController
-
-#pragma mark - UIViewController
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotateDeviceChangeNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
-    
-    _storeOrientation = [[UIApplication sharedApplication] statusBarOrientation];
-
-    [self.view addSubview:self.actionSheet];
-    self.actionSheet.frame = self.view.bounds;
-}
-
-- (void)viewDidAppear:(BOOL)animated
-{
-    [super viewDidAppear:animated];
-
-    self.viewAlreadyAppear = YES;
-}
-
-- (void)viewWillDisappear:(BOOL)animated
-{
-    [super viewWillDisappear:animated];
-    
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-
-- (void)viewWillLayoutSubviews
-{
-    [super viewWillLayoutSubviews];
-
-    self.actionSheet.frame = self.view.bounds;
-}
-
-- (BOOL)shouldAutorotate
-{
-    // doesn't allow autorotation after the view did appear (rotation messes up a blurred background)
-    return !self.viewAlreadyAppear;
-}
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
-- (NSUInteger)supportedInterfaceOrientations
-#else
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations
-#endif
-{
-    return UIInterfaceOrientationMaskAll;
-}
-
--(void)didRotateDeviceChangeNotification:(NSNotification *)notification
-{
-    UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation];
-    
-    if (currentOrientation != _storeOrientation) {
-        [self.actionSheet dismissAnimated:NO];
-    }
-    
-    _storeOrientation = currentOrientation;
-}
-
-@end

+ 0 - 1
iOSClient/Main/CCMain.h

@@ -27,7 +27,6 @@
 #import <AudioToolbox/AudioToolbox.h>
 #import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>
 
-#import "AHKActionSheet.h"
 #import "BKPasscodeViewController.h"
 #import "NSString+TruncateToWidth.h"
 #import "CCLogin.h"

+ 0 - 1
iOSClient/Nextcloud-Bridging-Header.h

@@ -2,7 +2,6 @@
 //  Use this file to import your target's public headers that you would like to expose to Swift.
 //
 
-#import "AHKActionSheet.h"
 #import "AppDelegate.h"
 #import "OCNetworking.h"
 #import "CCManageAccount.h"

+ 0 - 18
iOSClient/Settings/Acknowledgements.rtf

@@ -24,15 +24,6 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMA
 ____________________________________________\
 \
 
-\f1\b AHKActionSheet
-\f0\b0 \
-\
-The MIT License (MIT)\
-\
-Copyright (c) Arkadiusz Holko <fastred@fastred.org>\
-____________________________________________\
-\
-
 \f1\b BKPasscodeView
 \f0\b0 \
 \
@@ -242,15 +233,6 @@ Copyright (c) WeTransfer\
 ____________________________________________\
 \
 
-\f1\b Sheeeeeeeeet
-\f0\b0 \
-\
-The MIT License (MIT)\
-\
-Copyright (c) Daniel Saidi\
-____________________________________________\
-\
-
 \f1\b SVGKit
 \f0\b0 \
 \