Browse Source

clear code

marinofaggiana 4 years ago
parent
commit
dea87b957f
3 changed files with 3 additions and 2 deletions
  1. 0 1
      iOSClient/AppDelegate.h
  2. 0 1
      iOSClient/AppDelegate.m
  3. 3 0
      iOSClient/Main/NCMainTabBar.swift

+ 0 - 1
iOSClient/AppDelegate.h

@@ -51,7 +51,6 @@
 @interface AppDelegate : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate>
 
 // Timer Process
-@property (nonatomic, strong) NSTimer *timerUpdateApplicationIconBadgeNumber;
 @property (nonatomic, strong) NSTimer *timerErrorNetworking;
 
 @property (nonatomic, strong) UIWindow *window;

+ 0 - 1
iOSClient/AppDelegate.m

@@ -113,7 +113,6 @@
     [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
     
     // Start Timer
-    self.timerUpdateApplicationIconBadgeNumber = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(updateApplicationIconBadgeNumber) userInfo:nil repeats:YES];
     [self startTimerErrorNetworking];
 
     // Store review

+ 3 - 0
iOSClient/Main/NCMainTabBar.swift

@@ -28,6 +28,7 @@ class NCMainTabBar: UITabBar {
     private var fillColor: UIColor!
     private var shapeLayer: CALayer?
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
+    private var timer: Timer?
     
 //    override var traitCollection: UITraitCollection {
 //        return UITraitCollection(horizontalSizeClass: .compact)
@@ -36,6 +37,8 @@ class NCMainTabBar: UITabBar {
     required init?(coder: NSCoder) {
         super.init(coder: coder)
         
+        timer = Timer.scheduledTimer(timeInterval: 5, target: self, selector: (#selector(updateBadgeNumber)), userInfo: nil, repeats: true)
+            
         NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCBrandGlobal.shared.notificationCenterChangeTheming), object: nil)
         
         changeTheming()