Forráskód Böngészése

Notification view

Marino Faggiana 8 éve
szülő
commit
4a05327a06
2 módosított fájl, 25 hozzáadás és 22 törlés
  1. 21 21
      iOSClient/AppDelegate.m
  2. 4 1
      iOSClient/Notification/CCNotification.swift

+ 21 - 21
iOSClient/AppDelegate.m

@@ -329,27 +329,6 @@
     NSLog(@"[LOG] bye bye, Crypto Cloud !");
 }
 
-//
-// Method called by the system when all the background task has end
-//
-- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)())completionHandler
-{
-    NSLog(@"[LOG] Start completition handler from background - identifier : %@", identifier);
-    
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 25 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-        
-        [[CCNetworking sharedNetworking] automaticDownloadInError];
-        [[CCNetworking sharedNetworking] automaticUploadInError];
-        
-        self.backgroundSessionCompletionHandler = completionHandler;
-        void (^completionHandler)() = self.backgroundSessionCompletionHandler;
-        self.backgroundSessionCompletionHandler = nil;
-        completionHandler();
-        
-        NSLog(@"[LOG] End 25 sec. completition handler - identifier : %@", identifier);
-    });
-}
-
 //
 // Application Initialized
 //
@@ -1124,6 +1103,27 @@
 #pragma mark ===== Operation Networking & Session =====
 #pragma --------------------------------------------------------------------------------------------
 
+//
+// Method called by the system when all the background task has end
+//
+- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)())completionHandler
+{
+    NSLog(@"[LOG] Start completition handler from background - identifier : %@", identifier);
+    
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 25 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
+        
+        [[CCNetworking sharedNetworking] automaticDownloadInError];
+        [[CCNetworking sharedNetworking] automaticUploadInError];
+        
+        self.backgroundSessionCompletionHandler = completionHandler;
+        void (^completionHandler)() = self.backgroundSessionCompletionHandler;
+        self.backgroundSessionCompletionHandler = nil;
+        completionHandler();
+        
+        NSLog(@"[LOG] End 25 sec. completition handler - identifier : %@", identifier);
+    });
+}
+
 - (void)cancelAllOperations
 {
     [_netQueue cancelAllOperations];

+ 4 - 1
iOSClient/Notification/CCNotification.swift

@@ -174,7 +174,10 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
                 cell.icon.image = image
             }
             
-            cell.date.text = DateFormatter.localizedString(from: notification.date, dateStyle: .medium, timeStyle: .medium)
+            //
+            //cell.date.text = DateFormatter.localizedString(from: notification.date, dateStyle: .medium, timeStyle: .medium)
+            //
+            cell.date.text = CCUtility.dateDiff(notification.date)
             cell.subject.text = notification.subject
             cell.message.text = notification.message
         }