ソースを参照

1.完成Login相关的用户界面。

Pen Li 9 年 前
コミット
815c877890

+ 19 - 0
RA Image/BasicViewController.h

@@ -0,0 +1,19 @@
+//
+//  BasicViewController.h
+//  RA Image
+//
+//  Created by Jack on 2017/4/27.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "const.h"
+#import "config.h"
+
+@interface BasicViewController : UIViewController
+
+- (id)userDefaultsValue:(NSString *)key;
+
+- (void)setUserDefaultsValue:(id)value forKey:(NSString *)key;
+
+@end

+ 40 - 0
RA Image/BasicViewController.m

@@ -0,0 +1,40 @@
+//
+//  BasicViewController.m
+//  RA Image
+//
+//  Created by Jack on 2017/4/27.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import "BasicViewController.h"
+
+@interface BasicViewController ()
+
+@end
+
+@implementation BasicViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+- (id)userDefaultsValue:(NSString *)key {
+    
+    return [[NSUserDefaults standardUserDefaults] valueForKey:key];
+    
+}
+
+- (void)setUserDefaultsValue:(id)value forKey:(NSString *)key {
+    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+    [userDefaults setValue:value forKey:key];
+    [userDefaults synchronize];
+}
+
+
+@end

+ 86 - 8
RA Image/RA Image.xcodeproj/project.pbxproj

@@ -7,6 +7,11 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		42E1B0FD1EB1C8EE00EEF27C /* LoginSwitchCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42E1B0FB1EB1C8EE00EEF27C /* LoginSwitchCell.m */; };
+		42E1B0FE1EB1C8EE00EEF27C /* LoginTextFiledCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42E1B0FC1EB1C8EE00EEF27C /* LoginTextFiledCell.m */; };
+		42E1B1021EB1C92000EEF27C /* BasicViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42E1B1011EB1C92000EEF27C /* BasicViewController.m */; };
+		42E1B1041EB1CCB200EEF27C /* login.json in Resources */ = {isa = PBXBuildFile; fileRef = 42E1B1031EB1CCB200EEF27C /* login.json */; };
+		42E1B1081EB1D9B100EEF27C /* LoginSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42E1B1071EB1D9B100EEF27C /* LoginSettingViewController.m */; };
 		71114A9D1EB1BCB400D2200C /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114A9C1EB1BCB400D2200C /* LoginViewController.m */; };
 		71114AA01EB1C3DE00D2200C /* NetworkUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114A9F1EB1C3DE00D2200C /* NetworkUtils.m */; };
 		71114AA31EB1C40900D2200C /* RAINetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AA21EB1C40900D2200C /* RAINetwork.m */; };
@@ -33,6 +38,15 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
+		42E1B0F91EB1C8EE00EEF27C /* LoginSwitchCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginSwitchCell.h; sourceTree = "<group>"; };
+		42E1B0FA1EB1C8EE00EEF27C /* LoginTextFiledCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginTextFiledCell.h; sourceTree = "<group>"; };
+		42E1B0FB1EB1C8EE00EEF27C /* LoginSwitchCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginSwitchCell.m; sourceTree = "<group>"; };
+		42E1B0FC1EB1C8EE00EEF27C /* LoginTextFiledCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginTextFiledCell.m; sourceTree = "<group>"; };
+		42E1B1001EB1C92000EEF27C /* BasicViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BasicViewController.h; sourceTree = "<group>"; };
+		42E1B1011EB1C92000EEF27C /* BasicViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BasicViewController.m; sourceTree = "<group>"; };
+		42E1B1031EB1CCB200EEF27C /* login.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = login.json; sourceTree = "<group>"; };
+		42E1B1061EB1D9B100EEF27C /* LoginSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginSettingViewController.h; sourceTree = "<group>"; };
+		42E1B1071EB1D9B100EEF27C /* LoginSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginSettingViewController.m; sourceTree = "<group>"; };
 		71114A9B1EB1BCB400D2200C /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; };
 		71114A9C1EB1BCB400D2200C /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
 		71114A9E1EB1C3DE00D2200C /* NetworkUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkUtils.h; path = "../../RedAnt ERP Mobile/common/NetworkUtils.h"; sourceTree = "<group>"; };
@@ -91,6 +105,67 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		42E1B0F71EB1C8BB00EEF27C /* Login */ = {
+			isa = PBXGroup;
+			children = (
+				42E1B1031EB1CCB200EEF27C /* login.json */,
+				71114A9B1EB1BCB400D2200C /* LoginViewController.h */,
+				71114A9C1EB1BCB400D2200C /* LoginViewController.m */,
+				42E1B0F81EB1C8DB00EEF27C /* view */,
+				42E1B1051EB1D90F00EEF27C /* Setting */,
+			);
+			name = Login;
+			sourceTree = "<group>";
+		};
+		42E1B0F81EB1C8DB00EEF27C /* view */ = {
+			isa = PBXGroup;
+			children = (
+				42E1B0F91EB1C8EE00EEF27C /* LoginSwitchCell.h */,
+				42E1B0FB1EB1C8EE00EEF27C /* LoginSwitchCell.m */,
+				42E1B0FA1EB1C8EE00EEF27C /* LoginTextFiledCell.h */,
+				42E1B0FC1EB1C8EE00EEF27C /* LoginTextFiledCell.m */,
+			);
+			name = view;
+			sourceTree = "<group>";
+		};
+		42E1B0FF1EB1C90700EEF27C /* BasicViewController */ = {
+			isa = PBXGroup;
+			children = (
+				42E1B1001EB1C92000EEF27C /* BasicViewController.h */,
+				42E1B1011EB1C92000EEF27C /* BasicViewController.m */,
+			);
+			name = BasicViewController;
+			sourceTree = "<group>";
+		};
+		42E1B1051EB1D90F00EEF27C /* Setting */ = {
+			isa = PBXGroup;
+			children = (
+				42E1B1061EB1D9B100EEF27C /* LoginSettingViewController.h */,
+				42E1B1071EB1D9B100EEF27C /* LoginSettingViewController.m */,
+			);
+			name = Setting;
+			sourceTree = "<group>";
+		};
+		42E1B10D1EB1E91D00EEF27C /* Network */ = {
+			isa = PBXGroup;
+			children = (
+				71114A9E1EB1C3DE00D2200C /* NetworkUtils.h */,
+				71114A9F1EB1C3DE00D2200C /* NetworkUtils.m */,
+				71114AA11EB1C40900D2200C /* RAINetwork.h */,
+				71114AA21EB1C40900D2200C /* RAINetwork.m */,
+			);
+			name = Network;
+			sourceTree = "<group>";
+		};
+		42E1B10E1EB1E93E00EEF27C /* Root */ = {
+			isa = PBXGroup;
+			children = (
+				71DCDC3D1EAF234E00BA045A /* RootViewController.h */,
+				71DCDC3E1EAF234E00BA045A /* RootViewController.m */,
+			);
+			name = Root;
+			sourceTree = "<group>";
+		};
 		71114AA71EB1C51200D2200C /* util */ = {
 			isa = PBXGroup;
 			children = (
@@ -149,6 +224,7 @@
 		71DCDC2B1EAF234E00BA045A = {
 			isa = PBXGroup;
 			children = (
+				42E1B0FF1EB1C90700EEF27C /* BasicViewController */,
 				71DCDC361EAF234E00BA045A /* RA Image */,
 				71DCDC351EAF234E00BA045A /* Products */,
 				71114ACA1EB1C76E00D2200C /* Frameworks */,
@@ -169,18 +245,13 @@
 				71114AB71EB1C68B00D2200C /* const.h */,
 				71114AB81EB1C6B700D2200C /* config.h */,
 				71114AA71EB1C51200D2200C /* util */,
+				42E1B10D1EB1E91D00EEF27C /* Network */,
 				71DCDC4E1EAF34F800BA045A /* modes */,
+				42E1B0F71EB1C8BB00EEF27C /* Login */,
+				42E1B10E1EB1E93E00EEF27C /* Root */,
 				71DCDC3A1EAF234E00BA045A /* AppDelegate.h */,
 				71DCDC3B1EAF234E00BA045A /* AppDelegate.m */,
-				71DCDC3D1EAF234E00BA045A /* RootViewController.h */,
-				71DCDC3E1EAF234E00BA045A /* RootViewController.m */,
-				71114A9B1EB1BCB400D2200C /* LoginViewController.h */,
-				71114A9C1EB1BCB400D2200C /* LoginViewController.m */,
 				71DCDC401EAF234E00BA045A /* Main.storyboard */,
-				71114A9E1EB1C3DE00D2200C /* NetworkUtils.h */,
-				71114A9F1EB1C3DE00D2200C /* NetworkUtils.m */,
-				71114AA11EB1C40900D2200C /* RAINetwork.h */,
-				71114AA21EB1C40900D2200C /* RAINetwork.m */,
 				71DCDC431EAF234E00BA045A /* Assets.xcassets */,
 				71DCDC451EAF234E00BA045A /* LaunchScreen.storyboard */,
 				71DCDC481EAF234E00BA045A /* Info.plist */,
@@ -269,6 +340,7 @@
 				71DCDC501EAF353000BA045A /* modelist.json in Resources */,
 				71DCDC421EAF234E00BA045A /* Main.storyboard in Resources */,
 				71114AB31EB1C5C800D2200C /* LICENSE in Resources */,
+				42E1B1041EB1CCB200EEF27C /* login.json in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -285,6 +357,7 @@
 				71114AB51EB1C5C800D2200C /* NSData+CommonCrypto.m in Sources */,
 				71114AC71EB1C73B00D2200C /* mztools.c in Sources */,
 				71DCDC3F1EAF234E00BA045A /* RootViewController.m in Sources */,
+				42E1B1081EB1D9B100EEF27C /* LoginSettingViewController.m in Sources */,
 				71114AC81EB1C73B00D2200C /* unzip.c in Sources */,
 				71114AA01EB1C3DE00D2200C /* NetworkUtils.m in Sources */,
 				71114AA31EB1C40900D2200C /* RAINetwork.m in Sources */,
@@ -292,10 +365,13 @@
 				71114AB61EB1C5C800D2200C /* NSString+Base64.m in Sources */,
 				71114AA61EB1C50D00D2200C /* RAUtils.m in Sources */,
 				71DCDC3C1EAF234E00BA045A /* AppDelegate.m in Sources */,
+				42E1B1021EB1C92000EEF27C /* BasicViewController.m in Sources */,
 				71DCDC391EAF234E00BA045A /* main.m in Sources */,
 				71114ABC1EB1C73400D2200C /* ZipArchive.mm in Sources */,
+				42E1B0FE1EB1C8EE00EEF27C /* LoginTextFiledCell.m in Sources */,
 				71114AB41EB1C5C800D2200C /* NSData+Base64.m in Sources */,
 				71114ACF1EB1C79300D2200C /* Reachability.m in Sources */,
+				42E1B0FD1EB1C8EE00EEF27C /* LoginSwitchCell.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -417,6 +493,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RA Image/Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.RA-Image";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -429,6 +506,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RA Image/Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.RA-Image";
 				PRODUCT_NAME = "$(TARGET_NAME)";

BIN
RA Image/RA Image.xcodeproj/project.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 5 - 0
RA Image/RA Image.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+   type = "1"
+   version = "2.0">
+</Bucket>

+ 91 - 0
RA Image/RA Image.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/RA Image.xcscheme

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0820"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "71DCDC331EAF234E00BA045A"
+               BuildableName = "RA Image.app"
+               BlueprintName = "RA Image"
+               ReferencedContainer = "container:RA Image.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+      </Testables>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "71DCDC331EAF234E00BA045A"
+            BuildableName = "RA Image.app"
+            BlueprintName = "RA Image"
+            ReferencedContainer = "container:RA Image.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "71DCDC331EAF234E00BA045A"
+            BuildableName = "RA Image.app"
+            BlueprintName = "RA Image"
+            ReferencedContainer = "container:RA Image.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "71DCDC331EAF234E00BA045A"
+            BuildableName = "RA Image.app"
+            BlueprintName = "RA Image"
+            ReferencedContainer = "container:RA Image.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 22 - 0
RA Image/RA Image.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>SchemeUserState</key>
+	<dict>
+		<key>RA Image.xcscheme</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>0</integer>
+		</dict>
+	</dict>
+	<key>SuppressBuildableAutocreation</key>
+	<dict>
+		<key>71DCDC331EAF234E00BA045A</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+	</dict>
+</dict>
+</plist>

+ 241 - 4
RA Image/RA Image/Base.lproj/Main.storyboard

@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="zf9-JT-Kr2">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="zf9-JT-Kr2">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
@@ -55,13 +56,249 @@
                     <view key="view" contentMode="scaleToFill" id="eFV-Mf-82R">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RA Image" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7Tz-Ne-9Q4">
+                                <rect key="frame" x="0.0" y="100" width="375" height="50"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="50" id="tbZ-ys-B3a"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="30"/>
+                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="40" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="ZEy-rA-ish">
+                                <rect key="frame" x="0.0" y="190" width="375" height="160"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="160" id="qNy-dF-L1y"/>
+                                </constraints>
+                                <prototypes>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="LoginTextFiledCell" rowHeight="40" id="AzG-Bz-3Gu" customClass="LoginTextFiledCell">
+                                        <rect key="frame" x="0.0" y="28" width="375" height="40"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="AzG-Bz-3Gu" id="DIU-Qe-sGe">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="39"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="fill" placeholder="place order" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="YXP-if-YQ2">
+                                                    <rect key="frame" x="10" y="5" width="355" height="29"/>
+                                                    <nil key="textColor"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <textInputTraits key="textInputTraits"/>
+                                                </textField>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="bottom" secondItem="YXP-if-YQ2" secondAttribute="bottom" constant="5" id="4Sa-X2-GkU"/>
+                                                <constraint firstItem="YXP-if-YQ2" firstAttribute="leading" secondItem="DIU-Qe-sGe" secondAttribute="leading" constant="10" id="CZL-EC-3x4"/>
+                                                <constraint firstAttribute="trailing" secondItem="YXP-if-YQ2" secondAttribute="trailing" constant="10" id="FEh-AE-9gq"/>
+                                                <constraint firstItem="YXP-if-YQ2" firstAttribute="top" secondItem="DIU-Qe-sGe" secondAttribute="top" constant="5" id="lsm-A6-tLE"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="textBox" destination="YXP-if-YQ2" id="rLi-GD-e77"/>
+                                        </connections>
+                                    </tableViewCell>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="LoginSwitchCell" rowHeight="40" id="LYr-Om-Dpu" customClass="LoginSwitchCell">
+                                        <rect key="frame" x="0.0" y="68" width="375" height="40"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="LYr-Om-Dpu" id="DQB-yC-XbO">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="39"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="记住我的登录状态" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l0F-dN-mYq">
+                                                    <rect key="frame" x="10" y="5" width="285" height="29.5"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ayl-9L-kj9">
+                                                    <rect key="frame" x="315" y="5" width="52" height="29.5"/>
+                                                    <connections>
+                                                        <action selector="switchClick:" destination="LYr-Om-Dpu" eventType="valueChanged" id="AD8-uu-gGL"/>
+                                                    </connections>
+                                                </switch>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="l0F-dN-mYq" firstAttribute="leading" secondItem="DQB-yC-XbO" secondAttribute="leading" constant="10" id="2Pv-EG-Typ"/>
+                                                <constraint firstItem="l0F-dN-mYq" firstAttribute="top" secondItem="DQB-yC-XbO" secondAttribute="top" constant="5" id="AS5-qb-qmA"/>
+                                                <constraint firstAttribute="trailing" secondItem="Ayl-9L-kj9" secondAttribute="trailing" constant="10" id="KKL-7Y-rGz"/>
+                                                <constraint firstItem="Ayl-9L-kj9" firstAttribute="top" secondItem="DQB-yC-XbO" secondAttribute="top" constant="5" id="KeO-xb-xte"/>
+                                                <constraint firstAttribute="bottom" secondItem="Ayl-9L-kj9" secondAttribute="bottom" constant="5" id="MBN-lQ-Axe"/>
+                                                <constraint firstAttribute="bottom" secondItem="l0F-dN-mYq" secondAttribute="bottom" constant="5" id="sMp-Be-x6B"/>
+                                                <constraint firstItem="Ayl-9L-kj9" firstAttribute="leading" secondItem="l0F-dN-mYq" secondAttribute="trailing" constant="20" id="szM-HB-JH2"/>
+                                                <constraint firstAttribute="trailing" secondItem="l0F-dN-mYq" secondAttribute="trailing" constant="80" id="wBz-OH-Old"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="msgLabel" destination="l0F-dN-mYq" id="0Wu-o2-zG7"/>
+                                            <outlet property="stateSwitch" destination="Ayl-9L-kj9" id="0Af-UQ-jWz"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="l61-Sy-3V2" id="ftG-1q-g3I"/>
+                                    <outlet property="delegate" destination="l61-Sy-3V2" id="tqE-wd-DVH"/>
+                                </connections>
+                            </tableView>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Qgm-gt-QHB">
+                                <rect key="frame" x="10" y="617" width="40" height="40"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="Zih-se-HAO"/>
+                                    <constraint firstAttribute="height" constant="40" id="jjZ-vh-Hjh"/>
+                                </constraints>
+                                <state key="normal" title="S"/>
+                                <connections>
+                                    <action selector="settingBtnClick:" destination="l61-Sy-3V2" eventType="touchUpInside" id="ojR-rF-7SJ"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9eS-az-Avg">
+                                <rect key="frame" x="20" y="380" width="335" height="50"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="50" id="q1V-lL-5KU"/>
+                                </constraints>
+                                <state key="normal" title="Login"/>
+                                <connections>
+                                    <action selector="loginBtnClick:" destination="l61-Sy-3V2" eventType="touchUpInside" id="ob0-JX-uK7"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <color key="backgroundColor" red="0.10180238736934404" green="0.98262900114059448" blue="0.67473328857458892" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="Qgm-gt-QHB" firstAttribute="leading" secondItem="eFV-Mf-82R" secondAttribute="leading" constant="10" id="Di9-kk-t7S"/>
+                            <constraint firstAttribute="trailing" secondItem="ZEy-rA-ish" secondAttribute="trailing" id="NTf-3C-4Ro"/>
+                            <constraint firstItem="9eS-az-Avg" firstAttribute="top" secondItem="ZEy-rA-ish" secondAttribute="bottom" constant="30" id="VHh-eU-GOx"/>
+                            <constraint firstItem="7Tz-Ne-9Q4" firstAttribute="top" secondItem="H4k-R1-29n" secondAttribute="bottom" constant="80" id="aNW-Be-opP"/>
+                            <constraint firstItem="9eS-az-Avg" firstAttribute="leading" secondItem="eFV-Mf-82R" secondAttribute="leading" constant="20" id="dQN-LQ-RKc"/>
+                            <constraint firstItem="p61-40-fkz" firstAttribute="top" secondItem="Qgm-gt-QHB" secondAttribute="bottom" constant="10" id="dZy-Uz-47Q"/>
+                            <constraint firstItem="ZEy-rA-ish" firstAttribute="top" secondItem="7Tz-Ne-9Q4" secondAttribute="bottom" constant="40" id="dkW-VQ-pSb"/>
+                            <constraint firstAttribute="trailing" secondItem="7Tz-Ne-9Q4" secondAttribute="trailing" id="kYo-Ne-fAZ"/>
+                            <constraint firstItem="7Tz-Ne-9Q4" firstAttribute="leading" secondItem="eFV-Mf-82R" secondAttribute="leading" id="n2h-R0-gci"/>
+                            <constraint firstAttribute="trailing" secondItem="9eS-az-Avg" secondAttribute="trailing" constant="20" id="qS8-xf-h6A"/>
+                            <constraint firstItem="ZEy-rA-ish" firstAttribute="leading" secondItem="eFV-Mf-82R" secondAttribute="leading" id="w9O-y0-08A"/>
+                            <constraint firstItem="ZEy-rA-ish" firstAttribute="centerX" secondItem="eFV-Mf-82R" secondAttribute="centerX" id="zTH-G4-bdZ"/>
+                        </constraints>
                     </view>
+                    <connections>
+                        <outlet property="loginBtn" destination="9eS-az-Avg" id="zus-dh-HZL"/>
+                        <outlet property="loginTable" destination="ZEy-rA-ish" id="OM0-gg-rrj"/>
+                        <outlet property="settingBtn" destination="Qgm-gt-QHB" id="W1I-7x-KJ6"/>
+                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="QKd-iz-zHw" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
             <point key="canvasLocation" x="630" y="97"/>
         </scene>
+        <!--Login Setting View Controller-->
+        <scene sceneID="g1f-oD-LiL">
+            <objects>
+                <viewController storyboardIdentifier="LoginSettingViewController" id="r7u-Ls-Lza" customClass="LoginSettingViewController" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="pYb-eQ-flk"/>
+                        <viewControllerLayoutGuide type="bottom" id="dmd-sA-BVL"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="mu4-lc-PRk">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ak9-ZL-LJg">
+                                <rect key="frame" x="26" y="80" width="40" height="40"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="cUn-d9-05T"/>
+                                    <constraint firstAttribute="height" constant="40" id="pKp-9z-wKu"/>
+                                </constraints>
+                                <state key="normal" title="O">
+                                    <color key="titleColor" red="0.25435081980000002" green="0.75957768849999996" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                                <connections>
+                                    <action selector="internalCheckBtnClick:" destination="r7u-Ls-Lza" eventType="touchUpInside" id="GIU-oB-sNH"/>
+                                </connections>
+                            </button>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="IP" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="blU-4o-XVJ">
+                                <rect key="frame" x="26" y="130" width="339" height="40"/>
+                                <nil key="textColor"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <textInputTraits key="textInputTraits"/>
+                            </textField>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Name" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="N4g-tS-PSF">
+                                <rect key="frame" x="26" y="40" width="323" height="30"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="30" id="Yf5-Pn-1SW"/>
+                                </constraints>
+                                <nil key="textColor"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <textInputTraits key="textInputTraits"/>
+                            </textField>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Internal Address" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l39-8d-pmH">
+                                <rect key="frame" x="86" y="80" width="279" height="40"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kbo-vR-wxL">
+                                <rect key="frame" x="26" y="190" width="40" height="40"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="CLg-nr-pUz"/>
+                                    <constraint firstAttribute="width" constant="40" id="ZyL-b3-rIU"/>
+                                </constraints>
+                                <state key="normal" title="O">
+                                    <color key="titleColor" red="0.25435081980000002" green="0.75957768849999996" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                                <connections>
+                                    <action selector="externalCheckBtnClick:" destination="r7u-Ls-Lza" eventType="touchUpInside" id="BhV-eZ-ONE"/>
+                                </connections>
+                            </button>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="IP" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="6u3-iJ-b6y">
+                                <rect key="frame" x="26" y="240" width="339" height="40"/>
+                                <nil key="textColor"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <textInputTraits key="textInputTraits"/>
+                            </textField>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="External Address" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="65S-Fg-ERX">
+                                <rect key="frame" x="86" y="190" width="279" height="40"/>
+                                <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="l39-8d-pmH" firstAttribute="height" secondItem="ak9-ZL-LJg" secondAttribute="height" id="6gd-8y-bdZ"/>
+                            <constraint firstItem="6u3-iJ-b6y" firstAttribute="leading" secondItem="kbo-vR-wxL" secondAttribute="leading" id="8d1-fi-tLC"/>
+                            <constraint firstAttribute="trailing" secondItem="6u3-iJ-b6y" secondAttribute="trailing" constant="10" id="ElH-e4-39m"/>
+                            <constraint firstItem="65S-Fg-ERX" firstAttribute="leading" secondItem="kbo-vR-wxL" secondAttribute="trailing" constant="20" id="GTd-Ee-T0R"/>
+                            <constraint firstAttribute="trailing" secondItem="l39-8d-pmH" secondAttribute="trailing" constant="10" id="OIc-CK-Oge"/>
+                            <constraint firstItem="65S-Fg-ERX" firstAttribute="centerY" secondItem="kbo-vR-wxL" secondAttribute="centerY" id="Pzg-XR-ZTJ"/>
+                            <constraint firstItem="blU-4o-XVJ" firstAttribute="leading" secondItem="ak9-ZL-LJg" secondAttribute="leading" id="Ucr-yy-feK"/>
+                            <constraint firstItem="l39-8d-pmH" firstAttribute="centerY" secondItem="ak9-ZL-LJg" secondAttribute="centerY" id="VAv-u4-sgI"/>
+                            <constraint firstAttribute="trailing" secondItem="65S-Fg-ERX" secondAttribute="trailing" constant="10" id="WNf-Xd-Dj4"/>
+                            <constraint firstItem="blU-4o-XVJ" firstAttribute="top" secondItem="ak9-ZL-LJg" secondAttribute="bottom" constant="10" id="aD6-ml-Fhm"/>
+                            <constraint firstItem="6u3-iJ-b6y" firstAttribute="height" secondItem="kbo-vR-wxL" secondAttribute="height" id="aR8-j4-StY"/>
+                            <constraint firstItem="blU-4o-XVJ" firstAttribute="height" secondItem="ak9-ZL-LJg" secondAttribute="height" id="f8q-0V-8RV"/>
+                            <constraint firstItem="65S-Fg-ERX" firstAttribute="height" secondItem="kbo-vR-wxL" secondAttribute="height" id="fIc-f9-v0B"/>
+                            <constraint firstItem="N4g-tS-PSF" firstAttribute="top" secondItem="pYb-eQ-flk" secondAttribute="bottom" constant="20" id="h3p-CX-VWS"/>
+                            <constraint firstItem="ak9-ZL-LJg" firstAttribute="leading" secondItem="N4g-tS-PSF" secondAttribute="leading" id="hY2-4J-C9K"/>
+                            <constraint firstAttribute="trailing" secondItem="blU-4o-XVJ" secondAttribute="trailing" constant="10" id="hu2-Vv-cFU"/>
+                            <constraint firstItem="ak9-ZL-LJg" firstAttribute="top" secondItem="N4g-tS-PSF" secondAttribute="bottom" constant="10" id="keo-la-Ruh"/>
+                            <constraint firstItem="kbo-vR-wxL" firstAttribute="leading" secondItem="ak9-ZL-LJg" secondAttribute="leading" id="okh-NH-F5P"/>
+                            <constraint firstItem="N4g-tS-PSF" firstAttribute="leading" secondItem="mu4-lc-PRk" secondAttribute="leadingMargin" constant="10" id="oyR-VA-K9M"/>
+                            <constraint firstItem="kbo-vR-wxL" firstAttribute="top" secondItem="blU-4o-XVJ" secondAttribute="bottom" constant="20" id="uZu-fa-ULm"/>
+                            <constraint firstItem="l39-8d-pmH" firstAttribute="leading" secondItem="ak9-ZL-LJg" secondAttribute="trailing" constant="20" id="wiV-8D-vx9"/>
+                            <constraint firstItem="6u3-iJ-b6y" firstAttribute="top" secondItem="kbo-vR-wxL" secondAttribute="bottom" constant="10" id="xlA-i3-hle"/>
+                            <constraint firstAttribute="trailingMargin" secondItem="N4g-tS-PSF" secondAttribute="trailing" constant="10" id="yXh-vN-ybU"/>
+                        </constraints>
+                    </view>
+                    <connections>
+                        <outlet property="externalCheckBtn" destination="kbo-vR-wxL" id="gYt-D4-bet"/>
+                        <outlet property="externalTextField" destination="6u3-iJ-b6y" id="PkG-Vx-2Xd"/>
+                        <outlet property="internalCheckBtn" destination="ak9-ZL-LJg" id="9pw-ae-4yN"/>
+                        <outlet property="internalTextField" destination="blU-4o-XVJ" id="Cz1-DP-Zrf"/>
+                        <outlet property="nameTextField" destination="N4g-tS-PSF" id="kdZ-Ct-VgR"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="pdO-Fj-tWK" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1652" y="123.68815592203899"/>
+        </scene>
         <!--Title-->
         <scene sceneID="ved-nH-EPI">
             <objects>
@@ -100,7 +337,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="2M2-NW-Ap7" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1410" y="104"/>
+            <point key="canvasLocation" x="2593" y="106"/>
         </scene>
     </scenes>
 </document>

+ 13 - 0
RA Image/RA Image/LoginSettingViewController.h

@@ -0,0 +1,13 @@
+//
+//  LoginSettingViewController.h
+//  RA Image
+//
+//  Created by Jack on 2017/4/27.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import "BasicViewController.h"
+
+@interface LoginSettingViewController : BasicViewController
+
+@end

+ 57 - 0
RA Image/RA Image/LoginSettingViewController.m

@@ -0,0 +1,57 @@
+//
+//  LoginSettingViewController.m
+//  RA Image
+//
+//  Created by Jack on 2017/4/27.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import "LoginSettingViewController.h"
+
+@interface LoginSettingViewController ()
+
+@property (strong, nonatomic) IBOutlet UITextField *nameTextField;
+@property (strong, nonatomic) IBOutlet UIButton *internalCheckBtn;
+@property (strong, nonatomic) IBOutlet UITextField *internalTextField;
+@property (strong, nonatomic) IBOutlet UIButton *externalCheckBtn;
+@property (strong, nonatomic) IBOutlet UITextField *externalTextField;
+
+@end
+
+@implementation LoginSettingViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    UIView *v = [UIView new];
+    [self.view insertSubview:v atIndex:0];
+    
+    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStylePlain target:self action:@selector(doneItemClick:)];
+    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Scan" style:UIBarButtonItemStylePlain target:self action:@selector(scanItemClick:)];
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+
+#pragma mark - Button Click
+
+- (void)doneItemClick:(UIBarButtonItem *)sender {
+    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
+}
+
+- (void)scanItemClick:(UIBarButtonItem *)sender {
+    
+}
+
+- (IBAction)internalCheckBtnClick:(UIButton *)sender {
+    
+}
+
+- (IBAction)externalCheckBtnClick:(UIButton *)sender {
+    
+}
+
+@end

+ 26 - 0
RA Image/RA Image/LoginSwitchCell.h

@@ -0,0 +1,26 @@
+//
+//  LoginSwitchCell.h
+//  RA Image
+//
+//  Created by Jack on 2017/4/27.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@protocol LoginSwitchDelegate <NSObject>
+
+@optional
+
+- (void)switchButton:(UISwitch *)switchBtn valueChange:(BOOL)value;
+
+@end
+
+@interface LoginSwitchCell : UITableViewCell
+
+@property (strong, nonatomic) IBOutlet UILabel *msgLabel;
+@property (strong, nonatomic) IBOutlet UISwitch *stateSwitch;
+
+@property (nonatomic,weak) id<LoginSwitchDelegate> delegate;
+
+@end

+ 29 - 0
RA Image/RA Image/LoginSwitchCell.m

@@ -0,0 +1,29 @@
+//
+//  LoginSwitchCell.m
+//  RA Image
+//
+//  Created by Jack on 2017/4/27.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import "LoginSwitchCell.h"
+
+@implementation LoginSwitchCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+- (IBAction)switchClick:(UISwitch *)sender {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(switchButton:valueChange:)]) {
+        [self.delegate switchButton:sender valueChange:sender.isOn];
+    }
+}
+
+@end

+ 16 - 0
RA Image/RA Image/LoginTextFiledCell.h

@@ -0,0 +1,16 @@
+//
+//  LoginTextFiledCell.h
+//  RA Image
+//
+//  Created by Jack on 2017/4/27.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface LoginTextFiledCell : UITableViewCell
+
+@property (strong, nonatomic) IBOutlet UITextField *textBox;
+
+
+@end

+ 24 - 0
RA Image/RA Image/LoginTextFiledCell.m

@@ -0,0 +1,24 @@
+//
+//  LoginTextFiledCell.m
+//  RA Image
+//
+//  Created by Jack on 2017/4/27.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import "LoginTextFiledCell.h"
+
+@implementation LoginTextFiledCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+@end

+ 2 - 2
RA Image/RA Image/LoginViewController.h

@@ -6,8 +6,8 @@
 //  Copyright © 2017 USAI. All rights reserved.
 //
 
-#import <UIKit/UIKit.h>
+#import "BasicViewController.h"
 
-@interface LoginViewController : UIViewController
+@interface LoginViewController : BasicViewController
 
 @end

+ 133 - 8
RA Image/RA Image/LoginViewController.m

@@ -7,8 +7,22 @@
 //
 
 #import "LoginViewController.h"
+#import "LoginTextFiledCell.h"
+#import "LoginSwitchCell.h"
+#import "LoginSettingViewController.h"
 
-@interface LoginViewController ()
+static NSString *kRememberLogin = @"RememberLogin";
+static NSString *kLoginUserInfo = @"UserInfo";
+
+@interface LoginViewController ()<UITableViewDelegate,UITableViewDataSource,LoginSwitchDelegate>
+
+@property (strong, nonatomic) IBOutlet UITableView *loginTable;
+@property (nonatomic,strong) NSDictionary *dataDic;
+@property (strong, nonatomic) IBOutlet UIButton *loginBtn;
+@property (strong, nonatomic) IBOutlet UIButton *settingBtn;
+@property (nonatomic,copy) NSString *address;
+@property (nonatomic,copy) NSString *user;
+@property (nonatomic,copy) NSString *pwd;
 
 @end
 
@@ -17,6 +31,9 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
+    
+    [self loadData];
+    [self.loginTable reloadData];
 }
 
 - (void)didReceiveMemoryWarning {
@@ -24,14 +41,122 @@
     // Dispose of any resources that can be recreated.
 }
 
-/*
-#pragma mark - Navigation
+#pragma mark - Private
+
+- (void)loadData {
+    NSString *path = [[NSBundle mainBundle] pathForResource:@"login.json" ofType:nil];
+    NSData *data = [NSData dataWithContentsOfFile:path options:NSDataReadingMappedIfSafe error:nil];
+    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
+    self.dataDic = dic;
+}
 
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
+- (void)initUserData {
+    NSString *userData = [self userDefaultsValue:kLoginUserInfo];
+    NSArray *arr = [userData componentsSeparatedByString:@"&"];
+    [arr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        if (idx == 0) self.address = obj;
+        if (idx == 1) self.user = obj;
+        if (idx == 2) self.pwd = obj;
+    }];
 }
-*/
+
+- (void)prepareUserData {
+    
+    int count = [[self.dataDic objectForKey:@"count"] intValue];
+    for (int i = 0; i < count; i++) {
+        NSDictionary *itemDic = [self.dataDic objectForKey:[NSString stringWithFormat:@"item_%d",i]];
+        if ([[itemDic objectForKey:@"type"] isEqualToString:@"text"]) {
+            LoginTextFiledCell *cell = [self.loginTable cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
+            NSString *placeOrder = cell.textBox.placeholder;
+            if ([placeOrder isEqualToString:@"Address"]) {
+                self.address = cell.textBox.text;
+            } else if ([placeOrder isEqualToString:@"user name"]) {
+                self.user = cell.textBox.text;
+            } else if ([placeOrder isEqualToString:@"password"]) {
+                self.pwd = cell.textBox.text;
+            }
+        }
+    }
+    
+}
+
+#pragma mark - Orientation
+
+- (BOOL)shouldAutorotate {
+    return NO;
+}
+
+- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
+    return UIInterfaceOrientationPortrait;
+}
+
+#pragma mark - DataSource
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return [[self.dataDic objectForKey:@"count"] intValue];
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    NSDictionary *itemDic = [self.dataDic objectForKey:[NSString stringWithFormat:@"item_%ld",indexPath.row]];
+    
+    NSString *type = [itemDic objectForKey:@"type"];
+    id rememberValue = [self userDefaultsValue:kRememberLogin];
+    
+    if ([type isEqualToString:@"text"]) {
+        
+        LoginTextFiledCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LoginTextFiledCell"];
+        cell.textBox.placeholder = [itemDic objectForKey:@"place_order"];
+        BOOL editable = [[itemDic objectForKey:@"edit"] boolValue];
+        cell.textBox.enabled = editable;
+        NSString *placeOrder = cell.textBox.placeholder;
+        if ([placeOrder isEqualToString:@"Address"]) {
+            cell.textBox.text = self.address;
+        } else if ([placeOrder isEqualToString:@"user name"]) {
+            cell.textBox.text = self.user;
+        } else if ([placeOrder isEqualToString:@"password"]) {
+            cell.textBox.text = self.pwd;
+        }
+        return cell;
+    
+    } else if ([type isEqualToString:@"switch"]) {
+        
+        LoginSwitchCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LoginSwitchCell"];
+        cell.msgLabel.text = [itemDic objectForKey:@"tip_msg"];
+        if (rememberValue) {
+            cell.stateSwitch.on = [rememberValue boolValue];
+        } else {
+            cell.stateSwitch.on = [[itemDic objectForKey:@"status"] boolValue];
+        }
+        cell.delegate = self;
+        return cell;
+    }
+    
+    return nil;
+}
+
+#pragma mark - Delegate
+
+- (void)switchButton:(UISwitch *)switchBtn valueChange:(BOOL)value {
+    if (!value) [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
+    [self setUserDefaultsValue:@(value) forKey:kRememberLogin];
+}
+
+#pragma mark - Button Click
+
+- (IBAction)loginBtnClick:(UIButton *)sender {
+    [self prepareUserData];
+    if ([self userDefaultsValue:kRememberLogin]) {
+        [self setUserDefaultsValue:[NSString stringWithFormat:@"%@&%@&%@",self.address,self.user,self.pwd] forKey:kLoginUserInfo];
+    }
+}
+
+- (IBAction)settingBtnClick:(UIButton *)sender {
+    
+    LoginSettingViewController *loginSettingVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginSettingViewController"];
+    UINavigationController *settingRootNav = [[UINavigationController alloc] initWithRootViewController:loginSettingVC];
+    [self presentViewController:settingRootNav animated:YES completion:nil];
+    
+}
+
 
 @end

+ 2 - 2
RA Image/RA Image/RootViewController.h

@@ -6,9 +6,9 @@
 //  Copyright © 2017 USAI. All rights reserved.
 //
 
-#import <UIKit/UIKit.h>
+#import "BasicViewController.h"
 
-@interface RootViewController : UIViewController
+@interface RootViewController : BasicViewController
 
 
 @end

+ 11 - 0
RA Image/RA Image/RootViewController.m

@@ -7,6 +7,7 @@
 //
 
 #import "RootViewController.h"
+#import "LoginViewController.h"
 
 @interface RootViewController ()
 
@@ -17,6 +18,16 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view, typically from a nib.
+    
+    self.view.backgroundColor = [UIColor redColor];
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    
+    LoginViewController *loginVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginViewController"];
+    
+    [self.navigationController presentViewController:loginVC animated:YES completion:nil];
 }
 
 

+ 24 - 0
RA Image/RA Image/login.json

@@ -0,0 +1,24 @@
+{
+  "count" : 4,
+  
+  "item_0" : {
+    "edit" : false,
+    "type" : "text",
+    "place_order" : "Address"
+  },
+  "item_1" : {
+    "edit" : true,
+    "type" : "text",
+    "place_order" : "user name"
+  },
+  "item_2" : {
+    "edit" : true,
+    "type" : "text",
+    "place_order" : "password"
+  },
+  "item_3" : {
+    "type" : "switch",
+    "tip_msg" : "remember my login",
+    "status" : true
+  }
+}