Просмотр исходного кода

1.完成Apex Mobile Result视图,并修改Result刷新视图。

Pen Li 8 лет назад
Родитель
Сommit
95195bd151

+ 10 - 0
Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj

@@ -7,6 +7,8 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		4235C30320229F7200A99D04 /* Result.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4235C30220229F7200A99D04 /* Result.xib */; };
+		4235C3052022A60A00A99D04 /* ResultCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4235C3042022A60A00A99D04 /* ResultCell.xib */; };
 		425660DB202015E1002DB0CA /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 425660DA202015E1002DB0CA /* Launch.storyboard */; };
 		425CF096201EB2B500750E32 /* JLRefreshFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 425CF08C201EB2B500750E32 /* JLRefreshFooter.m */; };
 		425CF097201EB2B500750E32 /* JLRefreshHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 425CF08F201EB2B500750E32 /* JLRefreshHeader.m */; };
@@ -161,6 +163,8 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
+		4235C30220229F7200A99D04 /* Result.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Result.xib; sourceTree = "<group>"; };
+		4235C3042022A60A00A99D04 /* ResultCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ResultCell.xib; sourceTree = "<group>"; };
 		425660DA202015E1002DB0CA /* Launch.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; };
 		425CF08B201EB2B500750E32 /* JLRefreshFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JLRefreshFooter.h; sourceTree = "<group>"; };
 		425CF08C201EB2B500750E32 /* JLRefreshFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JLRefreshFooter.m; sourceTree = "<group>"; };
@@ -982,6 +986,8 @@
 				71E0D1D32022AB7E009A08EB /* ResultViewController.m */,
 				71B799992021B22D00F8685E /* AMResultViewController.h */,
 				71B7999A2021B22D00F8685E /* AMResultViewController.m */,
+				4235C30220229F7200A99D04 /* Result.xib */,
+				4235C3042022A60A00A99D04 /* ResultCell.xib */,
 			);
 			name = result;
 			sourceTree = "<group>";
@@ -1097,6 +1103,7 @@
 				42604129201C57A7002374A8 /* ShipSearch.storyboard in Resources */,
 				715643DC201C117300B04267 /* search.json in Resources */,
 				719EF8FF18BB839F00EFFF5F /* Images.xcassets in Resources */,
+				4235C30320229F7200A99D04 /* Result.xib in Resources */,
 				719EF8F418BB839F00EFFF5F /* Main_iPhone.storyboard in Resources */,
 				715709BC20215E0000EFE5C5 /* LICENSE in Resources */,
 				71E0D1D92022AB7E009A08EB /* Result.storyboard in Resources */,
@@ -1113,6 +1120,7 @@
 				7162546D201C412E009E3A41 /* ShippingStatusCell.xib in Resources */,
 				719EF8EB18BB839F00EFFF5F /* InfoPlist.strings in Resources */,
 				71F57D8019CD5C320014C893 /* GoogleMaps.bundle in Resources */,
+				4235C3052022A60A00A99D04 /* ResultCell.xib in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1390,6 +1398,7 @@
 		719EF91618BB839F00EFFF5F /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -1427,6 +1436,7 @@
 		719EF91718BB839F00EFFF5F /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Distribution";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";

+ 123 - 0
Apex Mobile/Apex Mobile/AMResultViewController.m

@@ -7,6 +7,9 @@
 //
 
 #import "AMResultViewController.h"
+#import "const.h"
+#import "RANetwork.h"
+#import "RAUtils.h"
 
 @interface AMResultViewController ()
 
@@ -14,9 +17,50 @@
 
 @implementation AMResultViewController
 
+- (void)resetContraint {
+    
+    for (NSLayoutConstraint *constraint in self.view.constraints) {
+        if ([constraint.identifier isEqualToString:@"title_top"] ) {
+            [self.view removeConstraint:constraint];
+        }
+        if ([constraint.identifier isEqualToString:@"scroll_height"]) {
+            [self.view removeConstraint:constraint];
+        }
+    }
+    
+    
+    NSLayoutConstraint *scroll_top = [NSLayoutConstraint constraintWithItem:self.titleBar
+                                                                  attribute:NSLayoutAttributeTop
+                                                                  relatedBy:NSLayoutRelationEqual
+                                                                     toItem:self.topLayoutGuide
+                                                                  attribute:NSLayoutAttributeBottom
+                                                                 multiplier:1.0
+                                                                   constant:0];
+    
+    NSLayoutConstraint *scroll_bottom = [NSLayoutConstraint constraintWithItem:self.scrollview
+                                                                     attribute:NSLayoutAttributeBottom
+                                                                     relatedBy:NSLayoutRelationEqual
+                                                                        toItem:self.bottomLayoutGuide
+                                                                     attribute:NSLayoutAttributeTop
+                                                                    multiplier:1.0
+                                                                      constant:0];
+    
+    [self.view addConstraint:scroll_top];
+    [self.view addConstraint:scroll_bottom];
+}
+
+- (void)configureTableView {
+    
+    [self.tableview registerNib:[UINib nibWithNibName:@"ResultCell" bundle:nil] forCellReuseIdentifier:@"tCell"];
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
+    
+    [self resetContraint];
+    [self configureTableView];
+    
 }
 
 - (void)didReceiveMemoryWarning {
@@ -24,6 +68,85 @@
     // Dispose of any resources that can be recreated.
 }
 
+- (void)loadContentWithOption:(int)option Complete:(void (^)(int, int))finish {
+    
+    if (self.params) {
+
+        NSMutableDictionary *dic = self.params.mutableCopy;
+        switch (option) {
+            case 0:
+            case 1: {
+                self.offset = 0;
+                self.content_layout =nil;
+                self.content_action = nil;
+                self.content_menu = nil;
+                self.content_data = nil;
+            }
+            break;
+            case 2: {
+                self.offset = [self resultItemCount];
+            }
+            break;
+        }
+
+//        dic[@"criteria"] = self.params;
+
+        [dic setObject:@(self.offset) forKey:@"offset"];
+        [dic setObject:@(delta) forKey:@"limit"];
+//        dic[@"criteria"] = [NSArray arrayWithObjects:@"aaa",@"bbb", nil];
+
+        __weak typeof(self) weakSelf = self;
+        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+            
+            NSString *path = [[NSBundle mainBundle] pathForResource:@"fake_search.json" ofType:nil];
+            NSData *data = [[NSData alloc] initWithContentsOfFile:path];
+            NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+            
+            NSDictionary *contentDic = json;
+            
+            
+            NSInteger result = [[contentDic objectForKey:@"result"] integerValue];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                if (weakSelf) {
+                    __strong typeof(weakSelf) strongSelf = weakSelf;
+                    if (result == RESULT_TRUE) {
+                        strongSelf.content_layout = [contentDic objectForKey:@"layout"];
+                        strongSelf.content_action = [contentDic objectForKey:@"row_action"];
+                        strongSelf.content_menu = [[contentDic objectForKey:@"menu"] mutableCopy];
+                        [strongSelf setupNavigationBar];
+                        
+                        NSString *title = contentDic[@"table_title"];
+                        self.titleLabel.text = title;
+
+                        if(strongSelf.content_data==nil)
+                            strongSelf.content_data = [NSMutableDictionary new];
+                        NSMutableDictionary* newdata = [[contentDic objectForKey:@"data"] mutableCopy];
+                        for(int dc = 0;dc<[newdata[@"count"] intValue];dc++)
+                        {
+                            NSMutableDictionary * newdata_item = newdata[[NSString stringWithFormat:@"item_%d",dc]];
+
+                            strongSelf.content_data[[NSString stringWithFormat:@"item_%d",[strongSelf.content_data[@"count"] intValue] ]] = newdata_item;
+                            strongSelf.content_data[@"count"] = @([strongSelf.content_data[@"count"] intValue]+1);
+                        }
+
+//                        strongSelf.content_data = [contentDic objectForKey:@"data"];
+                        [strongSelf updateTableFrame];
+                        [strongSelf.tableview reloadData];
+                    } else {
+                        [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:strongSelf];
+                    }
+
+                    if (finish) {
+                        finish((int)result,(int)[self resultItemCount]);
+                    }
+
+                }
+
+            });
+        });
+    }
+}
+
 
 -(void)cellDoubleTapAction:(UIGestureRecognizer*)gestureRecognizer
 {

+ 2 - 2
Apex Mobile/Apex Mobile/Main.storyboard

@@ -803,7 +803,7 @@
                                 <items>
                                     <barButtonItem style="plain" id="BxS-sd-Ww4">
                                         <button key="customView" opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="MDg-tk-V9T">
-                                            <rect key="frame" x="16" y="5.5" width="73" height="33"/>
+                                            <rect key="frame" x="16" y="7" width="62" height="30"/>
                                             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                             <state key="normal" title="Pre Page">
                                                 <color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -818,7 +818,7 @@
                                     <barButtonItem style="plain" systemItem="flexibleSpace" id="bLa-H3-XMT"/>
                                     <barButtonItem style="plain" id="F78-3m-Pcr">
                                         <button key="customView" opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="ta5-UY-kET">
-                                            <rect key="frame" x="286" y="5.5" width="73" height="33"/>
+                                            <rect key="frame" x="288" y="7" width="71" height="30"/>
                                             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                             <state key="normal" title="Next Page">
                                                 <color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

+ 32 - 26
Apex Mobile/Apex Mobile/OrderHistoryViewController.m

@@ -12,9 +12,10 @@
 #import "JLRefreshFooter.h"
 #import "ApexMobileDB.h"
 #import "DetailTabBarController.h"
+#import "AMResultViewController.h"
 
 #define HISTORY_SHIP_CELL_IDENTIFIER @"HistoryShippingStatusCell"
-static const int delta = 7;
+static const int history_delta = 7;
 
 @interface OrderHistoryViewController () <UITableViewDelegate,UITableViewDataSource,UISearchBarDelegate,JLRefreshDelegate>
 
@@ -225,32 +226,37 @@ static const int delta = 7;
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     
-    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
-    
-    [params setObject:@"dumb" forKey:@"id"];
-    NSString* h_field;
-    //if(self.radioContainer.selected==true)
-    //{
-    //    [params setObject:@"1" forKey:@"criterion_type"];
-    //    h_field = @"ctnr";
-    //}
-    //else
-    {
-        [params setObject:@"0" forKey:@"criterion_type"];
-        h_field = @"h_bol";
-    }
-    
-    NSDictionary *item = [self.shipArray objectAtIndex:indexPath.section];
-    NSString * cargo_criterion = item[@"hbol"];
-    if(cargo_criterion==nil)
-        cargo_criterion=@"";
-    [params setObject:cargo_criterion forKey:@"cargo_criterion"];
-    
+//    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
+//
+//    [params setObject:@"dumb" forKey:@"id"];
+//    NSString* h_field;
+//    //if(self.radioContainer.selected==true)
+//    //{
+//    //    [params setObject:@"1" forKey:@"criterion_type"];
+//    //    h_field = @"ctnr";
+//    //}
+//    //else
+//    {
+//        [params setObject:@"0" forKey:@"criterion_type"];
+//        h_field = @"h_bol";
+//    }
+//
+//    NSDictionary *item = [self.shipArray objectAtIndex:indexPath.section];
+//    NSString * cargo_criterion = item[@"hbol"];
+//    if(cargo_criterion==nil)
+//        cargo_criterion=@"";
+//    [params setObject:cargo_criterion forKey:@"cargo_criterion"];
+//
+//
+//    [ApexMobileDB savehistory:h_field value:cargo_criterion];
+//
+//    DetailTabBarController *detailViewController=[[DetailTabBarController alloc] init:@"Cargo Tracking" actions:[NSArray arrayWithObjects:@"Tracking",nil] params:params];
+//    [self.navigationController pushViewController:detailViewController animated:YES];
     
-    [ApexMobileDB savehistory:h_field value:cargo_criterion];
     
-    DetailTabBarController *detailViewController=[[DetailTabBarController alloc] init:@"Cargo Tracking" actions:[NSArray arrayWithObjects:@"Tracking",nil] params:params];
-    [self.navigationController pushViewController:detailViewController animated:YES];
+    AMResultViewController *resultVC = [[AMResultViewController alloc] initWithNibName:@"Result" bundle:nil];
+    resultVC.params = [NSMutableDictionary dictionary];
+    [self.navigationController pushViewController:resultVC animated:YES];
     
 }
 
@@ -276,7 +282,7 @@ static const int delta = 7;
         
         if (refresh == weakSelf.refreshFooter) {
             [weakSelf.refreshFooter performSelector:@selector(endRefresh)];
-            if (result == 2 && count < delta) {
+            if (result == 2 && count < history_delta) {
                 [weakSelf.refreshFooter performSelector:@selector(noMoreData)];
             }
         }

+ 147 - 0
Apex Mobile/Apex Mobile/Result.xib

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ResultViewController">
+            <connections>
+                <outlet property="footer_top_constraint" destination="veQ-No-JHu" id="Iau-rm-kXH"/>
+                <outlet property="h_constraint" destination="OCH-yF-HTJ" id="4PA-KC-Oaf"/>
+                <outlet property="header_top_constraint" destination="g32-lw-wxU" id="itz-AJ-NKi"/>
+                <outlet property="lead_constraint" destination="bbY-b2-jpG" id="buh-DH-2Qm"/>
+                <outlet property="refreshFooterBar" destination="GO7-Wf-2EG" id="K8N-GT-OAy"/>
+                <outlet property="refreshFooterTitleLb" destination="aLC-7L-TFI" id="huf-al-L6p"/>
+                <outlet property="refreshHeaderBar" destination="FS6-OU-h6k" id="0m0-Lt-fpM"/>
+                <outlet property="refreshHeaderTitleLb" destination="i3K-3e-1an" id="LtE-eV-XbL"/>
+                <outlet property="scrollview" destination="SK6-pt-SSv" id="dC1-EA-4pA"/>
+                <outlet property="tableview" destination="zfU-1Y-HJW" id="Uox-t1-3qj"/>
+                <outlet property="titleBar" destination="x6s-gs-coa" id="cK1-q5-4Bf"/>
+                <outlet property="titleLabel" destination="Jzl-DK-3jH" id="vpF-dE-IPa"/>
+                <outlet property="trail_constraint" destination="WJL-rP-AGA" id="vZS-qc-Zvw"/>
+                <outlet property="view" destination="h5p-9r-ydz" id="wdH-Fn-tAh"/>
+                <outlet property="w_constraint" destination="awE-WC-Ds5" id="Pvg-A9-QMU"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="h5p-9r-ydz">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SK6-pt-SSv">
+                    <rect key="frame" x="0.0" y="44" width="375" height="623"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bl4-Od-H2W">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
+                            <subviews>
+                                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelection="NO" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="zfU-1Y-HJW">
+                                    <rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
+                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                    <connections>
+                                        <outlet property="dataSource" destination="-1" id="NDN-Yh-L0u"/>
+                                        <outlet property="delegate" destination="-1" id="wYx-HQ-Lha"/>
+                                    </connections>
+                                </tableView>
+                            </subviews>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                            <constraints>
+                                <constraint firstAttribute="trailing" secondItem="zfU-1Y-HJW" secondAttribute="trailing" id="1o4-jr-iSC"/>
+                                <constraint firstItem="zfU-1Y-HJW" firstAttribute="width" secondItem="Bl4-Od-H2W" secondAttribute="width" id="jcZ-Zv-hi4"/>
+                                <constraint firstItem="zfU-1Y-HJW" firstAttribute="top" secondItem="Bl4-Od-H2W" secondAttribute="top" id="tjX-aC-epB"/>
+                                <constraint firstItem="zfU-1Y-HJW" firstAttribute="height" secondItem="Bl4-Od-H2W" secondAttribute="height" id="uxw-6u-AOH"/>
+                                <constraint firstItem="zfU-1Y-HJW" firstAttribute="leading" secondItem="Bl4-Od-H2W" secondAttribute="leading" id="yeO-hg-XPz"/>
+                            </constraints>
+                        </view>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="Bl4-Od-H2W" secondAttribute="trailing" id="1Ti-iV-OHl"/>
+                        <constraint firstItem="Bl4-Od-H2W" firstAttribute="top" secondItem="SK6-pt-SSv" secondAttribute="top" id="9Pr-vR-G66"/>
+                        <constraint firstItem="Bl4-Od-H2W" firstAttribute="height" secondItem="SK6-pt-SSv" secondAttribute="height" id="OCH-yF-HTJ"/>
+                        <constraint firstItem="Bl4-Od-H2W" firstAttribute="width" secondItem="SK6-pt-SSv" secondAttribute="width" id="awE-WC-Ds5"/>
+                        <constraint firstAttribute="bottom" secondItem="Bl4-Od-H2W" secondAttribute="bottom" id="ken-ay-0id"/>
+                        <constraint firstItem="Bl4-Od-H2W" firstAttribute="leading" secondItem="SK6-pt-SSv" secondAttribute="leading" id="tFg-Gm-FgS"/>
+                    </constraints>
+                </scrollView>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FS6-OU-h6k">
+                    <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Header Refresh" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i3K-3e-1an">
+                            <rect key="frame" x="-0.5" y="-0.5" width="375" height="44"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                            <nil key="textColor"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    <constraints>
+                        <constraint firstItem="i3K-3e-1an" firstAttribute="centerY" secondItem="FS6-OU-h6k" secondAttribute="centerY" id="2od-kC-few"/>
+                        <constraint firstAttribute="height" constant="44" id="5sI-hR-Cxb"/>
+                        <constraint firstItem="i3K-3e-1an" firstAttribute="height" secondItem="FS6-OU-h6k" secondAttribute="height" id="H8N-D6-K9e"/>
+                        <constraint firstItem="i3K-3e-1an" firstAttribute="width" secondItem="FS6-OU-h6k" secondAttribute="width" id="Oyv-wc-jJu"/>
+                        <constraint firstItem="i3K-3e-1an" firstAttribute="centerX" secondItem="FS6-OU-h6k" secondAttribute="centerX" id="txN-Ti-XTN"/>
+                    </constraints>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="x6s-gs-coa">
+                    <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jzl-DK-3jH">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                            <nil key="textColor"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    <constraints>
+                        <constraint firstItem="Jzl-DK-3jH" firstAttribute="centerX" secondItem="x6s-gs-coa" secondAttribute="centerX" id="V5M-Nu-TQm"/>
+                        <constraint firstAttribute="height" constant="44" id="ieE-am-1pd"/>
+                        <constraint firstItem="Jzl-DK-3jH" firstAttribute="centerY" secondItem="x6s-gs-coa" secondAttribute="centerY" id="v8v-ue-WNF"/>
+                        <constraint firstItem="Jzl-DK-3jH" firstAttribute="height" secondItem="x6s-gs-coa" secondAttribute="height" id="vdu-Mr-9yu"/>
+                        <constraint firstItem="Jzl-DK-3jH" firstAttribute="width" secondItem="x6s-gs-coa" secondAttribute="width" id="xIO-zR-s3W"/>
+                    </constraints>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GO7-Wf-2EG">
+                    <rect key="frame" x="0.0" y="667" width="375" height="30"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Footer Refresh" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aLC-7L-TFI">
+                            <rect key="frame" x="-0.5" y="-0.5" width="375" height="30"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                            <nil key="textColor"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="30" id="4wG-Gk-LKc"/>
+                        <constraint firstItem="aLC-7L-TFI" firstAttribute="height" secondItem="GO7-Wf-2EG" secondAttribute="height" id="IOY-Vh-zMp"/>
+                        <constraint firstItem="aLC-7L-TFI" firstAttribute="centerY" secondItem="GO7-Wf-2EG" secondAttribute="centerY" id="XUY-M7-qR6"/>
+                        <constraint firstItem="aLC-7L-TFI" firstAttribute="centerX" secondItem="GO7-Wf-2EG" secondAttribute="centerX" id="c08-mP-qdL"/>
+                        <constraint firstItem="aLC-7L-TFI" firstAttribute="width" secondItem="GO7-Wf-2EG" secondAttribute="width" id="nrB-wU-nho"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="FS6-OU-h6k" firstAttribute="width" secondItem="x6s-gs-coa" secondAttribute="width" id="0Tg-kL-kQm"/>
+                <constraint firstItem="GO7-Wf-2EG" firstAttribute="leading" secondItem="x6s-gs-coa" secondAttribute="leading" id="3QW-0F-LMu"/>
+                <constraint firstItem="FS6-OU-h6k" firstAttribute="leading" secondItem="x6s-gs-coa" secondAttribute="leading" id="Bjx-d0-fOe"/>
+                <constraint firstItem="x6s-gs-coa" firstAttribute="leading" secondItem="h5p-9r-ydz" secondAttribute="leading" id="GCn-RX-zyO"/>
+                <constraint firstItem="SK6-pt-SSv" firstAttribute="bottom" secondItem="h5p-9r-ydz" secondAttribute="bottom" identifier="scroll_bottom" id="PgW-kq-hWQ"/>
+                <constraint firstAttribute="trailing" secondItem="SK6-pt-SSv" secondAttribute="trailing" id="WJL-rP-AGA"/>
+                <constraint firstItem="SK6-pt-SSv" firstAttribute="leading" secondItem="h5p-9r-ydz" secondAttribute="leading" id="bbY-b2-jpG"/>
+                <constraint firstItem="GO7-Wf-2EG" firstAttribute="width" secondItem="x6s-gs-coa" secondAttribute="width" id="fa5-nI-GP6"/>
+                <constraint firstItem="FS6-OU-h6k" firstAttribute="top" secondItem="x6s-gs-coa" secondAttribute="top" id="g32-lw-wxU"/>
+                <constraint firstItem="x6s-gs-coa" firstAttribute="top" secondItem="h5p-9r-ydz" secondAttribute="top" identifier="title_top" id="gxd-aW-mfE"/>
+                <constraint firstItem="SK6-pt-SSv" firstAttribute="top" secondItem="x6s-gs-coa" secondAttribute="bottom" id="mN1-LO-vgQ"/>
+                <constraint firstAttribute="trailing" secondItem="x6s-gs-coa" secondAttribute="trailing" id="vMf-BI-ntc"/>
+                <constraint firstItem="GO7-Wf-2EG" firstAttribute="top" secondItem="SK6-pt-SSv" secondAttribute="bottom" id="veQ-No-JHu"/>
+            </constraints>
+            <point key="canvasLocation" x="-106.5" y="126.5"/>
+        </view>
+    </objects>
+</document>

+ 23 - 0
Apex Mobile/Apex Mobile/ResultCell.xib

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="tCell" id="Lic-Ng-p4U">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lic-Ng-p4U" id="wsG-8E-9L2">
+                <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </tableViewCellContentView>
+        </tableViewCell>
+    </objects>
+</document>

+ 41 - 36
Apex Mobile/Apex Mobile/SearchViewController.m

@@ -14,6 +14,8 @@
 #import "TableCellDate.h"
 #import "TableCellBool.h"
 #import "MyAutocompleteView.h"
+#import "AMResultViewController.h"
+
 @interface SearchViewController ()
 @property (strong,nonatomic) SearchTableAdapter* adapter ;
 @end
@@ -314,43 +316,46 @@
 
 - (IBAction)SearchBtnOnClick:(UIButton *)sender {
     
-    GridResultViewController *resultViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ResultViewController"];
-    resultViewController.function_name = self.function_name;
-//    if([self.function_name isEqualToString:@"Document Download"])
-//        resultViewController.fullrow_select =false;
-//    else
-//        resultViewController.fullrow_select=true;
-    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
+//    GridResultViewController *resultViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ResultViewController"];
+//    resultViewController.function_name = self.function_name;
+////    if([self.function_name isEqualToString:@"Document Download"])
+////        resultViewController.fullrow_select =false;
+////    else
+////        resultViewController.fullrow_select=true;
+//    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
+//
+//    for(int i=0;i<[_adapter get_itemcount];i++)
+//    {
+//        NSMutableDictionary * field =[_adapter get_item:i];
+//        if([[field valueForKey:@"type"] isEqualToString:@"time"])
+//        {
+//            NSString* str_from= [field valueForKey:@"from"];
+//            NSString* str_to= [field valueForKey:@"to"];
+//
+//            if(str_from.length>0)
+//                [params setValue:str_from forKey:[NSString stringWithFormat:@"%@_from",[field valueForKey:@"name"]]];
+//            if(str_to.length>0)
+//                [params setValue:str_to forKey:[NSString stringWithFormat:@"%@_to",[field valueForKey:@"name"]]];
+//        }
+//        else
+//        {
+//            NSString* value =[field valueForKey:@"value"];
+//            if(value.length>0)
+//            {
+//                [params setValue:[field valueForKey:@"value"] forKey:[field valueForKey:@"name"]];
+//                if([[field valueForKey:@"type"] isEqualToString:@"string"] )
+//                {
+//                     [ApexMobileDB savehistory:[field valueForKey:@"name"] value:[field valueForKey:@"value"]];
+//                }
+//            }
+//        }
+//    }
+//    [params setValue:self.function_name forKey:@"module_name"];
+//    resultViewController.params =params;
+//    [self.navigationController pushViewController:resultViewController animated:YES];
     
-    for(int i=0;i<[_adapter get_itemcount];i++)
-    {
-        NSMutableDictionary * field =[_adapter get_item:i];
-        if([[field valueForKey:@"type"] isEqualToString:@"time"])
-        {
-            NSString* str_from= [field valueForKey:@"from"];
-            NSString* str_to= [field valueForKey:@"to"];
-            
-            if(str_from.length>0)
-                [params setValue:str_from forKey:[NSString stringWithFormat:@"%@_from",[field valueForKey:@"name"]]];
-            if(str_to.length>0)
-                [params setValue:str_to forKey:[NSString stringWithFormat:@"%@_to",[field valueForKey:@"name"]]];
-        }
-        else
-        {
-            NSString* value =[field valueForKey:@"value"];
-            if(value.length>0)
-            {
-                [params setValue:[field valueForKey:@"value"] forKey:[field valueForKey:@"name"]];
-                if([[field valueForKey:@"type"] isEqualToString:@"string"] )
-                {
-                     [ApexMobileDB savehistory:[field valueForKey:@"name"] value:[field valueForKey:@"value"]];
-                }
-            }
-        }
-    }
-    [params setValue:self.function_name forKey:@"module_name"];
-    resultViewController.params =params;
-    [self.navigationController pushViewController:resultViewController animated:YES];
+    AMResultViewController *resultVC = [[AMResultViewController alloc] initWithNibName:@"Result" bundle:nil];
+    [self.navigationController pushViewController:resultVC animated:YES];
 }