Browse Source

add some files

hxb 9 years ago
parent
commit
b07b579857

+ 26 - 5
README.md

@@ -111,9 +111,30 @@ String uid         -可选项,请求唯一标识
 
 
 
----------------------------------
+----------------
 CoreData
-AddrBookID  Int64    用户ID
-appState    Int16
-avatar      String   头像链接
-branchId    Int64    
+----------------
+|AddrBook|          用户个人信息表
+----------
+AddrBookID          Int64    用户ID
+appState            Int16
+avatar              String      头像链接
+branchId            Int64       组织id
+cellTelephone       String      手机号码
+createTime          Date        创建时间
+defaultLoginName    String      默认登录名
+deleted             Int16   是否已停用
+department          String      部门
+disPlayName         String      显示昵称    
+duty                String      职务       XX中心负责人
+email               String      邮箱
+gender              Int16       性别      (男/女)
+groupID             Int64       所属组织ID -不明
+isFriend            Boolean
+isPersonal          Boolean
+loginName           String
+loginState          Int16       登陆状态
+mobile              String
+name                String
+postion             String      不明
+

+ 26 - 4
SocketChat.xcodeproj/project.pbxproj

@@ -16,7 +16,7 @@
 		D120FAF41CF7EA1800BB4737 /* RecentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D120FAF31CF7EA1800BB4737 /* RecentViewController.swift */; };
 		D120FAF61CF7EA2800BB4737 /* ContactViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D120FAF51CF7EA2800BB4737 /* ContactViewController.swift */; };
 		D120FAF81CF7EA3400BB4737 /* SettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D120FAF71CF7EA3400BB4737 /* SettingViewController.swift */; };
-		D12D9F931CFBE0750089B514 /* HTTPRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12D9F921CFBE0750089B514 /* HTTPRequest.swift */; };
+		D12D9F931CFBE0750089B514 /* HTTPHelp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12D9F921CFBE0750089B514 /* HTTPHelp.swift */; };
 		D12D9F951CFBE6C80089B514 /* RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12D9F941CFBE6C80089B514 /* RootViewController.swift */; };
 		D12D9F981CFBE7A30089B514 /* NoticeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12D9F971CFBE7A30089B514 /* NoticeViewController.swift */; };
 		D12D9F9E1CFBF9630089B514 /* LoginRet.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12D9F9B1CFBF9630089B514 /* LoginRet.swift */; };
@@ -250,6 +250,9 @@
 		D14188DB1CF3F2F900DD43D0 /* ServerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14188D91CF3F2F900DD43D0 /* ServerModel.swift */; };
 		D1800D921CFD36D3009C5ABB /* SMSViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1800D911CFD36D3009C5ABB /* SMSViewController.swift */; };
 		D1889A961CF43E2D00160217 /* LoginMsg.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1889A951CF43E2D00160217 /* LoginMsg.swift */; };
+		D1F08FAE1CFD75EB0008D6A1 /* zhuxun.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = D1F08FAD1CFD75EB0008D6A1 /* zhuxun.xcdatamodel */; };
+		D1FC83121CFE828C003318E4 /* MyAlertViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1FC83111CFE828C003318E4 /* MyAlertViewController.swift */; };
+		D1FC83341CFEBF11003318E4 /* XKeyBoard.m in Sources */ = {isa = PBXBuildFile; fileRef = D1FC83331CFEBF11003318E4 /* XKeyBoard.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -265,7 +268,7 @@
 		D120FAF31CF7EA1800BB4737 /* RecentViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecentViewController.swift; sourceTree = "<group>"; };
 		D120FAF51CF7EA2800BB4737 /* ContactViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactViewController.swift; sourceTree = "<group>"; };
 		D120FAF71CF7EA3400BB4737 /* SettingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = "<group>"; };
-		D12D9F921CFBE0750089B514 /* HTTPRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPRequest.swift; sourceTree = "<group>"; };
+		D12D9F921CFBE0750089B514 /* HTTPHelp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPHelp.swift; sourceTree = "<group>"; };
 		D12D9F941CFBE6C80089B514 /* RootViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = "<group>"; };
 		D12D9F971CFBE7A30089B514 /* NoticeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NoticeViewController.swift; sourceTree = "<group>"; };
 		D12D9F9B1CFBF9630089B514 /* LoginRet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginRet.swift; sourceTree = "<group>"; };
@@ -500,6 +503,10 @@
 		D14188D91CF3F2F900DD43D0 /* ServerModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerModel.swift; sourceTree = "<group>"; };
 		D1800D911CFD36D3009C5ABB /* SMSViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SMSViewController.swift; sourceTree = "<group>"; };
 		D1889A951CF43E2D00160217 /* LoginMsg.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginMsg.swift; sourceTree = "<group>"; };
+		D1F08FAD1CFD75EB0008D6A1 /* zhuxun.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = zhuxun.xcdatamodel; sourceTree = "<group>"; };
+		D1FC83111CFE828C003318E4 /* MyAlertViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyAlertViewController.swift; sourceTree = "<group>"; };
+		D1FC83321CFEBF11003318E4 /* XKeyBoard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XKeyBoard.h; sourceTree = "<group>"; };
+		D1FC83331CFEBF11003318E4 /* XKeyBoard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XKeyBoard.m; sourceTree = "<group>"; };
 		D258BF5883AA9D6A5B402A92 /* Pods-SocketChat.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SocketChat.release.xcconfig"; path = "Pods/Target Support Files/Pods-SocketChat/Pods-SocketChat.release.xcconfig"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
@@ -546,6 +553,7 @@
 		C075D71B1C5E0E81009F9044 /* SocketChat */ = {
 			isa = PBXGroup;
 			children = (
+				D1F08FAD1CFD75EB0008D6A1 /* zhuxun.xcdatamodel */,
 				C075D71C1C5E0E81009F9044 /* AppDelegate.swift */,
 				D13BE1531CEEFCEE003EED36 /* Images */,
 				D13BE3161CEF0896003EED36 /* ToolClass */,
@@ -936,8 +944,10 @@
 		D13BE3161CEF0896003EED36 /* ToolClass */ = {
 			isa = PBXGroup;
 			children = (
+				D1FC83311CFEBF11003318E4 /* XKeyBoard */,
 				D13BE3171CEF098A003EED36 /* func.swift */,
 				D14188D21CF3E55E00DD43D0 /* ManagerUserDefault.swift */,
+				D1FC83111CFE828C003318E4 /* MyAlertViewController.swift */,
 			);
 			name = ToolClass;
 			path = ..;
@@ -957,7 +967,7 @@
 		D14188D61CF3F2DA00DD43D0 /* TCPIP */ = {
 			isa = PBXGroup;
 			children = (
-				D12D9F921CFBE0750089B514 /* HTTPRequest.swift */,
+				D12D9F921CFBE0750089B514 /* HTTPHelp.swift */,
 				D120FAEC1CF7E0D200BB4737 /* TCPClient.swift */,
 				D1889A991CF5761600160217 /* MessageType */,
 			);
@@ -988,6 +998,15 @@
 			name = MessageType;
 			sourceTree = "<group>";
 		};
+		D1FC83311CFEBF11003318E4 /* XKeyBoard */ = {
+			isa = PBXGroup;
+			children = (
+				D1FC83321CFEBF11003318E4 /* XKeyBoard.h */,
+				D1FC83331CFEBF11003318E4 /* XKeyBoard.m */,
+			);
+			path = XKeyBoard;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -1336,18 +1355,21 @@
 				D1889A961CF43E2D00160217 /* LoginMsg.swift in Sources */,
 				D120FAED1CF7E0D200BB4737 /* TCPClient.swift in Sources */,
 				D120FAF81CF7EA3400BB4737 /* SettingViewController.swift in Sources */,
+				D1F08FAE1CFD75EB0008D6A1 /* zhuxun.xcdatamodel in Sources */,
 				D12D9F9E1CFBF9630089B514 /* LoginRet.swift in Sources */,
 				D12D9FA01CFBF9630089B514 /* LoginRetDevice.swift in Sources */,
 				D1800D921CFD36D3009C5ABB /* SMSViewController.swift in Sources */,
 				D12D9F951CFBE6C80089B514 /* RootViewController.swift in Sources */,
+				D1FC83341CFEBF11003318E4 /* XKeyBoard.m in Sources */,
 				D12D9F981CFBE7A30089B514 /* NoticeViewController.swift in Sources */,
 				D14188D11CF3E41900DD43D0 /* BaseViewController.swift in Sources */,
+				D1FC83121CFE828C003318E4 /* MyAlertViewController.swift in Sources */,
 				D120FAF41CF7EA1800BB4737 /* RecentViewController.swift in Sources */,
 				D13BE3181CEF098A003EED36 /* func.swift in Sources */,
 				D13BE3151CEF05AC003EED36 /* LoginViewController.swift in Sources */,
 				D14188DA1CF3F2F900DD43D0 /* ServerData.swift in Sources */,
 				D14188CF1CF3E3E800DD43D0 /* BaseOBJ.swift in Sources */,
-				D12D9F931CFBE0750089B514 /* HTTPRequest.swift in Sources */,
+				D12D9F931CFBE0750089B514 /* HTTPHelp.swift in Sources */,
 				D14188D31CF3E55E00DD43D0 /* ManagerUserDefault.swift in Sources */,
 				C075D71D1C5E0E81009F9044 /* AppDelegate.swift in Sources */,
 			);

+ 32 - 0
SocketChat.xcworkspace/xcshareddata/SocketChat.xcscmblueprint

@@ -0,0 +1,32 @@
+{
+  "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "198249DF2457583A45B314FE6A07077EF310B4A0",
+  "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
+    "d6d01364-c14c-4f4e-b8b5-2b265cae8b81++5410" : {
+
+    }
+  },
+  "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
+    "d6d01364-c14c-4f4e-b8b5-2b265cae8b81++5410" : 0,
+    "198249DF2457583A45B314FE6A07077EF310B4A0" : 0
+  },
+  "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "976AF41F-04FE-4C9A-A485-C46A210D636E",
+  "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
+    "d6d01364-c14c-4f4e-b8b5-2b265cae8b81++5410" : "SwiftIMChat\/SocketChat\/zhuxun.xcdatamodel\/",
+    "198249DF2457583A45B314FE6A07077EF310B4A0" : "SwiftIMChat\/"
+  },
+  "DVTSourceControlWorkspaceBlueprintNameKey" : "SocketChat",
+  "DVTSourceControlWorkspaceBlueprintVersion" : 204,
+  "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "SocketChat.xcworkspace",
+  "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
+    {
+      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "http:\/\/git.wswin.cn\/hxb\/swift.git",
+      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
+      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "198249DF2457583A45B314FE6A07077EF310B4A0"
+    },
+    {
+      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "http:\/\/101.71.251.190:18080\/svn\/ios",
+      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
+      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "d6d01364-c14c-4f4e-b8b5-2b265cae8b81++5410"
+    }
+  ]
+}

BIN
SocketChat.xcworkspace/xcuserdata/justine.xcuserdatad/UserInterfaceState.xcuserstate


+ 18 - 50
SocketChat.xcworkspace/xcuserdata/justine.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -138,12 +138,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "SocketChat/SMSViewController.swift"
-            timestampString = "486369479.111585"
+            timestampString = "486381531.255054"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "53"
-            endingLineNumber = "53"
-            landmarkName = "viewDidLoad()"
+            startingLineNumber = "49"
+            endingLineNumber = "49"
+            landmarkName = "checkCode(_:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -154,45 +154,13 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "SocketChat/SMSViewController.swift"
-            timestampString = "486369474.255421"
+            timestampString = "486382134.909039"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "29"
-            endingLineNumber = "29"
-            landmarkName = "requireCode(_:)"
+            startingLineNumber = "58"
+            endingLineNumber = "58"
+            landmarkName = "checkCode(_:)"
             landmarkType = "5">
-            <Locations>
-               <Location
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "SocketChat.SMSViewController.requireCode (__ObjC.UIButton) -&gt; ()"
-                  moduleName = "SocketChat"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/justine/Desktop/IOSproject/SwiftIMChat/SocketChat/SMSViewController.swift"
-                  timestampString = "486371259.994444"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "29"
-                  endingLineNumber = "29"
-                  offsetFromSymbolStart = "1160">
-               </Location>
-               <Location
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "SocketChat.SMSViewController.(requireCode (__ObjC.UIButton) -&gt; ()).(closure #1)"
-                  moduleName = "SocketChat"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/justine/Desktop/IOSproject/SwiftIMChat/SocketChat/SMSViewController.swift"
-                  timestampString = "486371259.994583"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "30"
-                  endingLineNumber = "30"
-                  offsetFromSymbolStart = "128">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -201,13 +169,13 @@
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "SocketChat/LoginViewController.swift"
-            timestampString = "486370281.490533"
+            filePath = "SocketChat/RecentViewController.swift"
+            timestampString = "486465239.281162"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "134"
-            endingLineNumber = "134"
-            landmarkName = "checkUser(_:password:)"
+            startingLineNumber = "20"
+            endingLineNumber = "20"
+            landmarkName = "viewDidLoad()"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -217,13 +185,13 @@
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "SocketChat/LoginViewController.swift"
-            timestampString = "486369646.808496"
+            filePath = "SocketChat/AppDelegate.swift"
+            timestampString = "486465247.188306"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "119"
-            endingLineNumber = "119"
-            landmarkName = "checkUser(_:password:)"
+            startingLineNumber = "35"
+            endingLineNumber = "35"
+            landmarkName = "application(_:didFinishLaunchingWithOptions:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>

+ 5 - 1
SocketChat/AppDelegate.swift

@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         else{
             self.showLoginViewContorller()
         }
-        tcpClient?.connect(USER_APP_SERVER as! String)
+        //
         
         
         
@@ -124,6 +124,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         self.window?.rootViewController = tabbarController
         self.window?.makeKeyAndVisible()
         
+        //建立链接
+        
+        
+        
     }
     
     

+ 32 - 14
SocketChat/Base.lproj/Main.storyboard

@@ -158,10 +158,10 @@
             </objects>
             <point key="canvasLocation" x="-591" y="534"/>
         </scene>
-        <!--RecentVC-->
+        <!--LOGINSMSVC-->
         <scene sceneID="nOy-ie-NPj">
             <objects>
-                <viewController storyboardIdentifier="SMSVC" title="RecentVC" useStoryboardIdentifierAsRestorationIdentifier="YES" id="9Qf-j5-Kbi" customClass="SMSViewController" customModule="SocketChat" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="SMSVC" title="LOGINSMSVC" useStoryboardIdentifierAsRestorationIdentifier="YES" id="9Qf-j5-Kbi" customClass="SMSViewController" customModule="SocketChat" customModuleProvider="target" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="IFT-Cm-L6U"/>
                         <viewControllerLayoutGuide type="bottom" id="Zfo-pp-M2F"/>
@@ -171,16 +171,16 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="GAK-CL-Aq1">
-                                <rect key="frame" x="40" y="80" width="520" height="30"/>
+                                <rect key="frame" x="20" y="80" width="560" height="30"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="手机号:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k2F-b7-I81">
                                         <rect key="frame" x="0.0" y="0.0" width="56" height="30"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+                                        <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Pve-AE-YUa" userLabel="mobile">
-                                        <rect key="frame" x="64" y="0.0" width="456" height="30"/>
+                                        <rect key="frame" x="64" y="0.0" width="496" height="30"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                         <textInputTraits key="textInputTraits" keyboardType="phonePad"/>
                                     </textField>
@@ -192,21 +192,21 @@
                                 </constraints>
                             </stackView>
                             <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="xmH-2T-x8l">
-                                <rect key="frame" x="40" y="120" width="520" height="30"/>
+                                <rect key="frame" x="20" y="120" width="560" height="30"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="验证码:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3hU-oV-suN">
                                         <rect key="frame" x="0.0" y="0.0" width="56" height="30"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+                                        <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="KSF-Mg-poK" userLabel="smscode">
-                                        <rect key="frame" x="64" y="0.0" width="344" height="30"/>
+                                        <rect key="frame" x="64" y="0.0" width="296" height="30"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                         <textInputTraits key="textInputTraits" keyboardType="numberPad"/>
                                     </textField>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="L0c-kp-LAi">
-                                        <rect key="frame" x="416" y="0.0" width="104" height="30"/>
+                                    <button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="L0c-kp-LAi">
+                                        <rect key="frame" x="368" y="0.0" width="192" height="30"/>
                                         <state key="normal" title="发送验证码"/>
                                         <connections>
                                             <action selector="requireCode:" destination="9Qf-j5-Kbi" eventType="touchUpInside" id="c4I-65-nKS"/>
@@ -217,12 +217,12 @@
                                     <constraint firstItem="L0c-kp-LAi" firstAttribute="leading" secondItem="KSF-Mg-poK" secondAttribute="trailing" constant="8" id="3sA-rt-KYh"/>
                                     <constraint firstAttribute="trailing" secondItem="L0c-kp-LAi" secondAttribute="trailing" id="FZO-Nl-jh6"/>
                                     <constraint firstItem="KSF-Mg-poK" firstAttribute="leading" secondItem="3hU-oV-suN" secondAttribute="trailing" constant="8" id="e08-UM-Elb"/>
-                                    <constraint firstItem="L0c-kp-LAi" firstAttribute="width" secondItem="KSF-Mg-poK" secondAttribute="width" multiplier="300:1000" id="jEF-mQ-DmY"/>
+                                    <constraint firstItem="L0c-kp-LAi" firstAttribute="width" secondItem="KSF-Mg-poK" secondAttribute="width" multiplier="650:1000" id="jEF-mQ-DmY"/>
                                     <constraint firstItem="3hU-oV-suN" firstAttribute="leading" secondItem="xmH-2T-x8l" secondAttribute="leading" id="ywH-rR-l5S"/>
                                 </constraints>
                             </stackView>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bXO-eR-aff">
-                                <rect key="frame" x="40" y="190" width="520" height="40"/>
+                                <rect key="frame" x="20" y="190" width="560" height="40"/>
                                 <state key="normal" title="登陆" backgroundImage="login_bg.png"/>
                                 <connections>
                                     <action selector="checkCode:" destination="9Qf-j5-Kbi" eventType="touchUpInside" id="VFe-Mz-JUt"/>
@@ -233,9 +233,9 @@
                         <constraints>
                             <constraint firstItem="bXO-eR-aff" firstAttribute="centerY" secondItem="Xne-NS-r9V" secondAttribute="centerY" id="A5e-2D-8za"/>
                             <constraint firstItem="GAK-CL-Aq1" firstAttribute="centerX" secondItem="Xne-NS-r9V" secondAttribute="centerX" id="LuL-qH-QSU"/>
-                            <constraint firstAttribute="trailingMargin" secondItem="bXO-eR-aff" secondAttribute="trailing" constant="20" id="LxW-yU-bnN"/>
+                            <constraint firstAttribute="trailingMargin" secondItem="bXO-eR-aff" secondAttribute="trailing" id="LxW-yU-bnN"/>
                             <constraint firstItem="bXO-eR-aff" firstAttribute="centerX" secondItem="Xne-NS-r9V" secondAttribute="centerX" id="Rwk-jC-M0f"/>
-                            <constraint firstItem="bXO-eR-aff" firstAttribute="leading" secondItem="Xne-NS-r9V" secondAttribute="leadingMargin" constant="20" id="Wqn-OH-Y2j"/>
+                            <constraint firstItem="bXO-eR-aff" firstAttribute="leading" secondItem="Xne-NS-r9V" secondAttribute="leadingMargin" id="Wqn-OH-Y2j"/>
                             <constraint firstItem="KSF-Mg-poK" firstAttribute="width" relation="lessThanOrEqual" secondItem="Pve-AE-YUa" secondAttribute="width" id="cl0-cs-zYh"/>
                             <constraint firstItem="xmH-2T-x8l" firstAttribute="top" secondItem="GAK-CL-Aq1" secondAttribute="top" id="dCQ-n3-Gyr"/>
                             <constraint firstItem="xmH-2T-x8l" firstAttribute="centerX" secondItem="Xne-NS-r9V" secondAttribute="centerX" id="dV9-W6-XlK"/>
@@ -261,6 +261,24 @@
             </objects>
             <point key="canvasLocation" x="448" y="353"/>
         </scene>
+        <!--RecentVC-->
+        <scene sceneID="9gY-Zd-KUn">
+            <objects>
+                <viewController storyboardIdentifier="RecentVC" title="RecentVC" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Pgs-cS-keu" customClass="RecentViewController" customModule="SocketChat" customModuleProvider="target" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="OQ7-qM-AiA"/>
+                        <viewControllerLayoutGuide type="bottom" id="Lrx-zD-7AH"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="M6N-eA-bdX">
+                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="Hr5-m0-7Ef" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="960" y="96"/>
+        </scene>
     </scenes>
     <resources>
         <image name="input_bg.png" width="320" height="86"/>

+ 5 - 26
SocketChat/HTTPHelp.swift

@@ -8,32 +8,11 @@
 import Alamofire
 import Foundation
 enum HTTPMethod{
-    case POST
+    case POST,GET
 }
+
+
 class HTTPRequest {
-//    //创建NSURL对象
-//    let url:NSURL!
-//    //创建请求对象
-//    let urlRequest:NSURLRequest!
-//    let Method:NSURLRequest.Type
-//    //响应对象
-//    var response:NSURLResponse?
-//    init(Methom:String = "POST",url:String,data:NSData){
-//        do{
-//            //替换HttpHeader
-//            urlRequest.setValue("application/json", forKey: "Content-Type")
-//            urlRequest.setValue("*", forKey: "accept")
-//            //发送请求
-//            //try urlRequest = NSURLRequest(URL:NSURL(string: url)!, cachePolicy: , timeoutInterval: 3.0)
-//            let data:NSData? = try NSURLConnection.sendSynchronousRequest(urlRequest,returningResponse:&response)
-//            let str = NSString(data: data!, encoding: NSUTF8StringEncoding)
-//            print(str)
-//        }catch let error as NSError{
-//            //打印错误信息
-//            print(error.code)
-//            print(error.description)
-//        }
-//    }
-//    
-//    
+    //网络状态->2G,3G,4G,wifi,None
+    func NetWorkState(){}
 }

+ 1 - 0
SocketChat/LoginViewController.swift

@@ -139,6 +139,7 @@ class LoginViewController: UIViewController{
                         else{
                             //showRootViewController
                             print("即将进入主界面")
+                            APPDELEGATE.showRootViewContorller()
                             
                         }
                     }

+ 3 - 1
SocketChat/RecentViewController.swift

@@ -10,12 +10,14 @@ import UIKit
 
 class RecentViewController: UIViewController {
     @IBOutlet weak var lab: UILabel!
-
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         self.view.backgroundColor = UIColor.redColor()
         let story = UIStoryboard(name: "Main", bundle: nil)
         let RecentVC = story.instantiateViewControllerWithIdentifier("RecentVC")
+        let NavTitle = UINavigationItem.init(title: "最近消息")
+        TCPClient.shareInstance.connect(USER_APP_SERVER! as! String)
         //self.presentViewController(RecentVC, animated: true, completion: { () -> Void in
         
         //})

+ 35 - 8
SocketChat/SMSViewController.swift

@@ -14,33 +14,60 @@ class SMSViewController: UIViewController {
     let serverid = USER_SERVER_ID as! String
     let userid = DEFAULT_USER_ID as! Int
     let loginname = DEFAULT_USER_NAME as! String
+    var afmobile:String?
     @IBAction func requireCode(sender: UIButton) {
         var remainingSeconds: Int = 60
         sender.enabled = false
         sender.setTitle(String(remainingSeconds), forState: UIControlState.Disabled)
         
         //请求验证码
-        let mobile = trimstring(self.mobile.text!,trimchar: " ")
+        afmobile = trimstring(self.mobile.text!,trimchar: " ")
+        /*待优化手机号匹配规则
+         
+         
+         
+         
+         
+        */
         let param:[String:AnyObject] = ["serverID":serverid,
                      "loginName":loginname,
                      "userID":userid,
-                     "mobile":mobile
+                     "mobile":self.afmobile!
                      ]
         request(.POST, RequireSMSURL, parameters: param).responseJSON { (R) in
             guard R.result.error == nil else{
+                print("弹窗提示验证码请求失败,请求错误")
                 return
             }
+            print("弹窗提示验证码发送成功")
         }
         
         
         
     }
-    @IBAction func checkCode(sender: UIButton) {
-        //获取手机号  未校验
-        //mobile
-        //获取验证码
-        //验证。。。。
-        //mobile.text
+    @IBAction func checkCode(sender: UIButton){
+        
+        let param:[String:AnyObject] = ["serverID":serverid,
+                                        "loginName":loginname,
+                                        "userID":userid,
+                                        "mobile":self.mobile.text!,
+                                        "code":self.smscode.text!
+        ]
+        //发送验证码到服务端比对 正确则RootView 反之AlertController
+        request(.POST, CheckSMSURL, parameters: param).responseJSON { (R) in
+            guard R.result.error == nil else{
+                print("弹窗请求错误原因")
+                print("请求出错")
+                return
+            }
+            let data = R.result.value!
+            print("弹窗提示登录成功,然后显示主界面")
+            print(data["message"])
+            self.mobile.resignFirstResponder()
+            self.smscode.resignFirstResponder()
+            APPDELEGATE.showRootViewContorller()
+            
+        }
         
     }
 

+ 68 - 7
SocketChat/TCPClient.swift

@@ -11,8 +11,8 @@ import CocoaAsyncSocket
 import SocketIOClientSwift
 
 protocol SocketIODelegate {
- //   didsend()
- //   didrecived()
+    //   didsend()
+    //   didrecived()
 }
 class TCPClient{
     static let shareInstance = TCPClient()
@@ -20,13 +20,74 @@ class TCPClient{
     var socket:SocketIOClient?
     func connect(urlstr:String){
         socket = SocketIOClient.init(socketURL: NSURL(string: urlstr)!)
+        socket?.connect()
         //socket = SocketIOClient.ini
         print(socket?.status)
     }
-
-    func disconnect(){}
-    func reconnect(){}
-    func send(){}
-    func recived(){}
     
+    func disconnect(){
+        socket?.disconnect()
+    }
+    func reconnect(){
+        socket?.reconnect()
+    }
+    //发送消息
+    func send(event:String,data:AnyObject){
+        socket?.emit(event, data)
+    }
+    
+    
+    //接收消息
+    func recived(event:String){
+        socket?.on(event, callback: { (data, Ack) in
+            switch (event){
+            case "zhuxunserver.response": break
+                //收到消息后具体处理
+                
+            case "zhuxunserver.chat.message":break
+                //收到消息后具体处理
+                
+            case "zhuxunserver.users.state":break
+                //收到消息后具体处理
+                
+            case "zhuxunserver.login.locked":break
+                //收到消息后具体处理
+            case "zhuxunserver.chatmessage.sync":break
+                
+            default:
+                print("Unrecognized event")
+            }
+            Ack.with(event)
+        })
+    }
+    
+    //        switch event {
+    //        case "zhuxunserver.response":
+    //            socket?.on(event, callback: { (data, Ack) in
+    //
+    //                //Ack("clientRcomplet")
+    //            })
+    //        case "zhuxunserver.chat.message":
+    //            socket?.on(event, callback: { (data, Ack) in
+    //
+    //                //Ack("clientRcomplet")
+    //            })
+    //        case "zhuxunserver.users.state":
+    //            socket?.on(event, callback: { (data, Ack) in
+    //
+    //                //Ack("clientRcomplet")
+    //            })
+    //        case "zhuxunserver.login.locked":
+    //            socket?.on(event, callback: { (data, Ack) in
+    //
+    //            })
+    //        default:
+    //            print("###################################################")
+    //            print("###################################################")
+    //            print("#####socket recived Unrecognize event##############")
+    //            print("###################################################")
+    //            print("###################################################")
+    //        }
+    
+ 
 }

+ 0 - 109
SocketChat/zhuxun.xcdatamodel/.svn/text-base/contents.svn-base

@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="6751" systemVersion="14C1510" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
-    <entity name="AddrBook" representedClassName="AddrBook" syncable="YES">
-        <attribute name="addrBookID" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="appState" optional="YES" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
-        <attribute name="avatar" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="branchId" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="cellTelephone" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="createTime" optional="YES" attributeType="Date" indexed="YES" syncable="YES"/>
-        <attribute name="defaultLoginName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="deleted" optional="YES" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
-        <attribute name="department" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="disPlayName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="duty" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="email" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="gender" optional="YES" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
-        <attribute name="groupID" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="isFriend" optional="YES" attributeType="Boolean" syncable="YES"/>
-        <attribute name="isPersonal" attributeType="Boolean" defaultValueString="NO" syncable="YES"/>
-        <attribute name="loginName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="loginState" optional="YES" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
-        <attribute name="mobile" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="postion" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="remark" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="secret" optional="YES" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
-        <attribute name="serverID" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="signature" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="state" optional="YES" attributeType="Integer 16" syncable="YES"/>
-        <attribute name="telephone" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="unit" optional="YES" attributeType="String" syncable="YES"/>
-        <relationship name="belongTo" optional="YES" maxCount="1" deletionRule="No Action" destinationEntity="AddrBookGroup" inverseName="addrBooks" inverseEntity="AddrBookGroup" syncable="YES"/>
-        <relationship name="branch" optional="YES" maxCount="1" deletionRule="No Action" destinationEntity="Branch" inverseName="members" inverseEntity="Branch" syncable="YES"/>
-    </entity>
-    <entity name="AddrBookGroup" representedClassName="AddrBookGroup" syncable="YES">
-        <attribute name="groupID" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="groupName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="loginName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="parentId" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="state" optional="YES" attributeType="Integer 16" syncable="YES"/>
-        <relationship name="addrBooks" optional="YES" toMany="YES" deletionRule="No Action" ordered="YES" destinationEntity="AddrBook" inverseName="belongTo" inverseEntity="AddrBook" syncable="YES"/>
-    </entity>
-    <entity name="Branch" representedClassName="Branch" syncable="YES">
-        <attribute name="branchID" optional="YES" attributeType="Integer 64" defaultValueString="0" indexed="YES" syncable="YES"/>
-        <attribute name="haveDownload" optional="YES" attributeType="Boolean" syncable="YES"/>
-        <attribute name="isSecrecy" optional="YES" attributeType="Boolean" syncable="YES"/>
-        <attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="parentID" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="serverId" optional="YES" attributeType="String" syncable="YES"/>
-        <relationship name="members" optional="YES" toMany="YES" deletionRule="No Action" ordered="YES" destinationEntity="AddrBook" inverseName="branch" inverseEntity="AddrBook" syncable="YES"/>
-        <relationship name="parentBranch" optional="YES" maxCount="1" deletionRule="No Action" destinationEntity="Branch" inverseName="subBranch" inverseEntity="Branch" syncable="YES"/>
-        <relationship name="subBranch" optional="YES" toMany="YES" deletionRule="No Action" ordered="YES" destinationEntity="Branch" inverseName="parentBranch" inverseEntity="Branch" syncable="YES"/>
-    </entity>
-    <entity name="BusinessCard" representedClassName="BusinessCard" syncable="YES">
-        <attribute name="avatar" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="cardId" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="displayName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="email" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="groupId" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="loginName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="mobile" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="nickname" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="position" optional="YES" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
-        <attribute name="remark" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="tel" optional="YES" attributeType="String" syncable="YES"/>
-        <relationship name="group" optional="YES" maxCount="1" deletionRule="No Action" destinationEntity="BusinessCardGroup" syncable="YES"/>
-    </entity>
-    <entity name="BusinessCardGroup" representedClassName="BusinessCardGroup" syncable="YES">
-        <attribute name="groupId" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="groupName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="loginName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="parentId" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-        <attribute name="state" optional="YES" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
-        <relationship name="card" optional="YES" maxCount="1" deletionRule="No Action" destinationEntity="BusinessCard" syncable="YES"/>
-    </entity>
-    <entity name="MessageEntity" representedClassName="MessageEntity" syncable="YES">
-        <attribute name="localPath" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="msgContent" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="msgContentType" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
-        <attribute name="msgId" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="msgState" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
-        <attribute name="msgTime" optional="YES" attributeType="Date" syncable="YES"/>
-        <attribute name="msgType" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
-        <attribute name="receiverId" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="senderId" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="sessionId" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="voiceLength" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
-        <attribute name="voicePlayed" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
-    </entity>
-    <entity name="RecentEntity" representedClassName="RecentEntity" syncable="YES">
-        <attribute name="avatar" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="lastMsg" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="lastTime" optional="YES" attributeType="Date" indexed="YES" syncable="YES"/>
-        <attribute name="manualSortTime" optional="YES" attributeType="Date" syncable="YES"/>
-        <attribute name="recentId" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="title" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="type" optional="YES" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
-        <attribute name="unreadCount" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
-    </entity>
-    <elements>
-        <element name="AddrBook" positionX="0" positionY="0" width="128" height="495"/>
-        <element name="AddrBookGroup" positionX="0" positionY="0" width="128" height="135"/>
-        <element name="Branch" positionX="0" positionY="0" width="128" height="180"/>
-        <element name="BusinessCard" positionX="18" positionY="162" width="128" height="223"/>
-        <element name="BusinessCardGroup" positionX="9" positionY="153" width="128" height="135"/>
-        <element name="MessageEntity" positionX="0" positionY="0" width="128" height="225"/>
-        <element name="RecentEntity" positionX="0" positionY="0" width="128" height="165"/>
-    </elements>
-</model>