Marino Faggiana 8 жил өмнө
parent
commit
d8bc079d17

+ 8 - 0
iOSClient/Main/CCMain.m

@@ -1043,6 +1043,13 @@
     if ([JSAlertView isOpenAlertWindows])
         return;
     
+    CCNotification *notificationVC = [[UIStoryboard storyboardWithName:@"CCNotification" bundle:nil] instantiateViewControllerWithIdentifier:@"CCNotification"];
+
+    notificationVC.view.superview.frame = CGRectMake(100,100,self.view.bounds.size.width-100,self.view.bounds.size.height-100);
+
+    [self presentViewController:notificationVC animated:YES completion:nil];
+    
+    /*
     for (NSString *idNotification in app.listOfNotifications) {
         
         OCNotifications *notification = [app.listOfNotifications objectForKey:idNotification];
@@ -1100,6 +1107,7 @@
             }];
         }
     }
+    */
     
     // Update NavigationBar
     if (!_isSelectedMode)

+ 1 - 1
iOSClient/Notification/CCNotification.storyboard

@@ -12,7 +12,7 @@
         <!--Notification-->
         <scene sceneID="qpr-sp-LUL">
             <objects>
-                <tableViewController id="XR4-7S-Rf2" customClass="CCNotification" sceneMemberID="viewController">
+                <tableViewController restorationIdentifier="CCNotification" storyboardIdentifier="CCNotification" id="XR4-7S-Rf2" customClass="CCNotification" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="zcw-hW-s5f">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

+ 25 - 1
iOSClient/Notification/CCNotification.swift

@@ -11,10 +11,34 @@ import UIKit
 class CCNotification: UITableViewController, UISearchResultsUpdating {
 
 
+    var resultSearchController = UISearchController()
+    
     override func viewDidLoad() {
+        
+        super.viewDidLoad()
+        
+        self.resultSearchController = ({
+
+            let controller = UISearchController(searchResultsController: nil)
+            
+            controller.searchBar.sizeToFit()
+            controller.searchResultsUpdater = self
+            controller.dimsBackgroundDuringPresentation = false
+            controller.searchBar.scopeButtonTitles = ["A", "B", "C", "D"]
+            
+            self.tableView.tableHeaderView = controller.searchBar
+            
+            return controller
+        })()
+        
+        //aggiorniamo la tabella in caso ci fossero modifiche alla lista
+        self.tableView.reloadData()
     }
     
-    
+    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        
+        return 0
+    }
     
     func updateSearchResults(for searchController: UISearchController) {
     }