Browse Source

remove warning

Marino Faggiana 7 years ago
parent
commit
a760dd170b
3 changed files with 13 additions and 9 deletions
  1. 3 1
      iOSClient/Main/CCMain.h
  2. 7 7
      iOSClient/Main/CCMain.m
  3. 3 1
      iOSClient/Main/CCMore.swift

+ 3 - 1
iOSClient/Main/CCMain.h

@@ -59,10 +59,12 @@
 @property (nonatomic, strong) NSString *serverUrl;
 @property (nonatomic, strong) NSString *titleMain;
 @property (nonatomic, strong) NSString *textBackButton;
-
 @property (nonatomic, weak) CCShareOC *shareOC;
 @property (nonatomic, weak) CCDetail *detailViewController;
 @property (nonatomic, strong) UISearchController *searchController;
+@property (nonatomic, strong) UIView *reMenuBackgroundView;
+@property (nonatomic, strong) UITapGestureRecognizer *singleFingerTap;
+
 
 - (void)closeAllMenu;
 - (void)returnCreate:(NSInteger)type;

+ 7 - 7
iOSClient/Main/CCMain.m

@@ -55,8 +55,6 @@
     NSMutableDictionary *_statusSwipeCell;
     
     UIImageView *_ImageTitleHomeCryptoCloud;
-    UIView *_reMenuBackgroundView;
-    UITapGestureRecognizer *_singleFingerTap;
     
     NSString *_directoryGroupBy;
     NSString *_directoryOrder;
@@ -177,7 +175,7 @@
         self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"navigationLogo"] style:UIBarButtonItemStylePlain target:nil action:nil];
     
     // reMenu Background
-    _reMenuBackgroundView = [[UIView alloc] init];
+    _reMenuBackgroundView = [UIView new];
     _reMenuBackgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
     
     // if this is not Main (the Main uses inizializeMain)
@@ -3269,11 +3267,12 @@
     
     appDelegate.reMainMenu.bounce = NO;
     
+    __weak typeof(self) weakSelf = self;
     [appDelegate.reMainMenu setClosePreparationBlock:^{
         
         // Backgroun reMenu (Gesture)
-        [_reMenuBackgroundView removeFromSuperview];
-        [_reMenuBackgroundView removeGestureRecognizer:_singleFingerTap];
+        [weakSelf.reMenuBackgroundView removeFromSuperview];
+        [weakSelf.reMenuBackgroundView removeGestureRecognizer:weakSelf.singleFingerTap];
     }];
 }
 
@@ -3365,11 +3364,12 @@
 
     appDelegate.reSelectMenu.bounce = NO;
     
+    __weak typeof(self) weakSelf = self;
     [appDelegate.reSelectMenu setClosePreparationBlock:^{
         
         // Backgroun reMenu (Gesture)
-        [_reMenuBackgroundView removeFromSuperview];
-        [_reMenuBackgroundView removeGestureRecognizer:_singleFingerTap];
+        [weakSelf.reMenuBackgroundView removeFromSuperview];
+        [weakSelf.reMenuBackgroundView removeGestureRecognizer:weakSelf.singleFingerTap];
     }];
 }
 

+ 3 - 1
iOSClient/Main/CCMore.swift

@@ -308,7 +308,9 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
         
         } else if item.url.contains("open") && !item.url.contains("//") {
             
-            let nameStoryboard = item.url.substring(from: item.url.index(item.url.startIndex, offsetBy: 4))
+            let nameStoryboard = String(item.url[..<item.url.index(item.url.startIndex, offsetBy: 4)])
+            
+            //let nameStoryboard = item.url.substring(from: item.url.index(item.url.startIndex, offsetBy: 4))
             
             let storyboard = UIStoryboard(name: nameStoryboard, bundle: nil)
             let controller = storyboard.instantiateViewController(withIdentifier: nameStoryboard)