Browse Source

little change

hxb 9 years ago
parent
commit
8792e465c8

+ 17 - 4
SocketChat.xcodeproj/project.pbxproj

@@ -250,7 +250,7 @@
 		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 */; };
+		D1C7D77C1D0C82F600AB6AE2 /* zhuxun.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = D1C7D77A1D0C82F600AB6AE2 /* zhuxun.xcdatamodeld */; };
 		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 */
@@ -503,7 +503,7 @@
 		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>"; };
+		D1C7D77B1D0C82F600AB6AE2 /* 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>"; };
@@ -553,7 +553,6 @@
 		C075D71B1C5E0E81009F9044 /* SocketChat */ = {
 			isa = PBXGroup;
 			children = (
-				D1F08FAD1CFD75EB0008D6A1 /* zhuxun.xcdatamodel */,
 				C075D71C1C5E0E81009F9044 /* AppDelegate.swift */,
 				D13BE1531CEEFCEE003EED36 /* Images */,
 				D13BE3161CEF0896003EED36 /* ToolClass */,
@@ -944,6 +943,7 @@
 		D13BE3161CEF0896003EED36 /* ToolClass */ = {
 			isa = PBXGroup;
 			children = (
+				D1C7D77A1D0C82F600AB6AE2 /* zhuxun.xcdatamodeld */,
 				D1FC83311CFEBF11003318E4 /* XKeyBoard */,
 				D13BE3171CEF098A003EED36 /* func.swift */,
 				D14188D21CF3E55E00DD43D0 /* ManagerUserDefault.swift */,
@@ -1355,10 +1355,10 @@
 				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 */,
+				D1C7D77C1D0C82F600AB6AE2 /* zhuxun.xcdatamodeld in Sources */,
 				D12D9F951CFBE6C80089B514 /* RootViewController.swift in Sources */,
 				D1FC83341CFEBF11003318E4 /* XKeyBoard.m in Sources */,
 				D12D9F981CFBE7A30089B514 /* NoticeViewController.swift in Sources */,
@@ -1539,6 +1539,19 @@
 			defaultConfigurationName = Release;
 		};
 /* End XCConfigurationList section */
+
+/* Begin XCVersionGroup section */
+		D1C7D77A1D0C82F600AB6AE2 /* zhuxun.xcdatamodeld */ = {
+			isa = XCVersionGroup;
+			children = (
+				D1C7D77B1D0C82F600AB6AE2 /* zhuxun.xcdatamodel */,
+			);
+			currentVersion = D1C7D77B1D0C82F600AB6AE2 /* zhuxun.xcdatamodel */;
+			path = zhuxun.xcdatamodeld;
+			sourceTree = "<group>";
+			versionGroupType = wrapper.xcdatamodel;
+		};
+/* End XCVersionGroup section */
 	};
 	rootObject = C075D7111C5E0E81009F9044 /* Project object */;
 }

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


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

@@ -1,32 +0,0 @@
-{
-  "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


+ 0 - 199
SocketChat.xcworkspace/xcuserdata/justine.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -1,199 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Bucket
-   type = "0"
-   version = "2.0">
-   <Breakpoints>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "ManagerUserDefault.swift"
-            timestampString = "485944375.792225"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "18"
-            endingLineNumber = "18"
-            landmarkName = "SetServers(_:)"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "SocketChat/AppDelegate.swift"
-            timestampString = "486298094.737187"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "43"
-            endingLineNumber = "43"
-            landmarkName = "application(_:didFinishLaunchingWithOptions:)"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "SocketChat/LoginViewController.swift"
-            timestampString = "486369479.111585"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "94"
-            endingLineNumber = "94"
-            landmarkName = "checkUser(_:password:)"
-            landmarkType = "5">
-            <Locations>
-               <Location
-                  shouldBeEnabled = "No"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "SocketChat.LoginViewController.(checkUser (Swift.String, password : Swift.String) -&gt; ()).(closure #1)"
-                  moduleName = "SocketChat"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/justine/Desktop/IOSproject/SwiftIMChat/SocketChat/LoginViewController.swift"
-                  timestampString = "486357066.815162"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "87"
-                  endingLineNumber = "87"
-                  offsetFromSymbolStart = "8136">
-               </Location>
-               <Location
-                  shouldBeEnabled = "No"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "SocketChat.LoginViewController.(checkUser (Swift.String, password : Swift.String) -&gt; ()).(closure #1).(closure #1)"
-                  moduleName = "SocketChat"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/justine/Desktop/IOSproject/SwiftIMChat/SocketChat/LoginViewController.swift"
-                  timestampString = "486357066.81532"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "88"
-                  endingLineNumber = "88"
-                  offsetFromSymbolStart = "132">
-               </Location>
-            </Locations>
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "SocketChat/LoginViewController.swift"
-            timestampString = "486369479.111585"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "46"
-            endingLineNumber = "46"
-            landmarkName = "checkUser(_:password:)"
-            landmarkType = "5">
-            <Locations>
-               <Location
-                  shouldBeEnabled = "No"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "SocketChat.LoginViewController.checkUser (Swift.String, password : Swift.String) -&gt; ()"
-                  moduleName = "SocketChat"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/justine/Desktop/IOSproject/SwiftIMChat/SocketChat/LoginViewController.swift"
-                  timestampString = "486357066.818265"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "39"
-                  endingLineNumber = "39"
-                  offsetFromSymbolStart = "156">
-               </Location>
-               <Location
-                  shouldBeEnabled = "No"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "SocketChat.LoginViewController.(checkUser (Swift.String, password : Swift.String) -&gt; ()).(closure #1)"
-                  moduleName = "SocketChat"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/justine/Desktop/IOSproject/SwiftIMChat/SocketChat/LoginViewController.swift"
-                  timestampString = "486357066.818381"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "40"
-                  endingLineNumber = "40"
-                  offsetFromSymbolStart = "188">
-               </Location>
-            </Locations>
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "SocketChat/SMSViewController.swift"
-            timestampString = "486381531.255054"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "49"
-            endingLineNumber = "49"
-            landmarkName = "checkCode(_:)"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "SocketChat/SMSViewController.swift"
-            timestampString = "486382134.909039"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "58"
-            endingLineNumber = "58"
-            landmarkName = "checkCode(_:)"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "SocketChat/RecentViewController.swift"
-            timestampString = "486465239.281162"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "20"
-            endingLineNumber = "20"
-            landmarkName = "viewDidLoad()"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "SocketChat/AppDelegate.swift"
-            timestampString = "486465247.188306"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "35"
-            endingLineNumber = "35"
-            landmarkName = "application(_:didFinishLaunchingWithOptions:)"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-   </Breakpoints>
-</Bucket>

+ 0 - 14
SocketChat.xcworkspace/xcuserdata/justine.xcuserdatad/xcdebugger/Expressions.xcexplist

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<VariablesViewState
-   version = "1.0">
-   <ContextStates>
-      <ContextState
-         contextName = "LoginViewController.(checkUser(String, password : String) -&gt; String).(closure #1):LoginViewController.swift">
-         <PersistentStrings>
-            <PersistentString
-               value = "">
-            </PersistentString>
-         </PersistentStrings>
-      </ContextState>
-   </ContextStates>
-</VariablesViewState>

+ 13 - 2
SocketChat/AppDelegate.swift

@@ -22,7 +22,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         // Override point for customization after application launch.
         
         self.window = UIWindow(frame: CGRectMake(0,0,SCREEN_WIDTH,SCREEN_HEIGHT))
-        
         //注册推送
         let notificationTypes: UIUserNotificationType = [UIUserNotificationType.Alert, UIUserNotificationType.Badge, UIUserNotificationType.Sound]
         let pushNotificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories: nil)
@@ -30,13 +29,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         application.registerForRemoteNotifications()
         
         
-        
         //是否已登陆
         if(self.isLogin()){
             self.showRootViewContorller()
+            
+
+            
         }
         else{
             self.showLoginViewContorller()
+            
         }
         //
         
@@ -48,10 +50,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         return true
     }
     func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
+        print("##############################")
+        print("##############################")
         print("DEVICE TOKEN = \(deviceToken)")
+        print("##############################")
+        print("##############################")
+        ManagerUserDefault().InsertUserDefault(deviceToken, key: USERDEFAULT_APP_TOKEN)
     }
     func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
+        print("##############################")
+        print("##############################")
         print("Fail to register APNs ----ErrorMsg:\(error)")
+        print("##############################")
+        print("##############################")
     }
     func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
         print(userInfo)

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

@@ -23,17 +23,28 @@
                             <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="login_header_default.png" translatesAutoresizingMaskIntoConstraints="NO" id="nsW-vq-69g">
                                 <rect key="frame" x="257" y="143" width="85" height="85"/>
                             </imageView>
-                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="popo.png" translatesAutoresizingMaskIntoConstraints="NO" id="Kfm-dM-NL7">
-                                <rect key="frame" x="-20" y="0.0" width="640" height="210"/>
-                            </imageView>
                             <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="input_bg.png" translatesAutoresizingMaskIntoConstraints="NO" id="Ll2-p2-3P8">
                                 <rect key="frame" x="140" y="242" width="320" height="86"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="87" id="EwX-aY-w2k"/>
+                                </constraints>
+                                <variation key="default">
+                                    <mask key="constraints">
+                                        <exclude reference="EwX-aY-w2k"/>
+                                    </mask>
+                                </variation>
+                                <variation key="widthClass=compact">
+                                    <mask key="constraints">
+                                        <include reference="EwX-aY-w2k"/>
+                                    </mask>
+                                </variation>
                             </imageView>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aez-C7-ZMf">
                                 <rect key="frame" x="140.5" y="336" width="320" height="40"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="30" id="T8M-GJ-bk8"/>
                                 </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="23"/>
                                 <state key="normal" title="登陆" backgroundImage="login_bg.png"/>
                                 <state key="highlighted" backgroundImage="login_bg_down.png"/>
                                 <variation key="default">
@@ -43,14 +54,14 @@
                                 </variation>
                                 <variation key="widthClass=compact">
                                     <mask key="constraints">
-                                        <include reference="T8M-GJ-bk8"/>
+                                        <exclude reference="T8M-GJ-bk8"/>
                                     </mask>
                                 </variation>
                                 <connections>
                                     <action selector="LoginBtn:" destination="n5I-C1-k2q" eventType="touchUpInside" id="hPs-RJ-l13"/>
                                 </connections>
                             </button>
-                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" alignment="top" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="eLa-Wd-uFN">
+                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" alignment="top" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="eLa-Wd-uFN">
                                 <rect key="frame" x="188" y="241" width="272" height="86"/>
                                 <subviews>
                                     <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" verticalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="hxb" minimumFontSize="20" translatesAutoresizingMaskIntoConstraints="NO" id="MVM-vl-ICy" userLabel="username">
@@ -69,47 +80,67 @@
                                     <constraint firstItem="lVp-uI-vcl" firstAttribute="width" secondItem="eLa-Wd-uFN" secondAttribute="width" id="7iV-QS-PJn"/>
                                     <constraint firstItem="lVp-uI-vcl" firstAttribute="width" secondItem="eLa-Wd-uFN" secondAttribute="width" id="FKL-9L-Eis"/>
                                     <constraint firstItem="MVM-vl-ICy" firstAttribute="width" secondItem="eLa-Wd-uFN" secondAttribute="width" id="H4C-ME-28Z"/>
+                                    <constraint firstItem="MVM-vl-ICy" firstAttribute="height" secondItem="eLa-Wd-uFN" secondAttribute="height" multiplier="480:1000" id="JHS-rt-EdC"/>
                                     <constraint firstItem="lVp-uI-vcl" firstAttribute="height" secondItem="eLa-Wd-uFN" secondAttribute="height" multiplier="480:1000" id="Jze-Eq-CNO"/>
                                     <constraint firstItem="MVM-vl-ICy" firstAttribute="width" secondItem="eLa-Wd-uFN" secondAttribute="width" id="Nny-oj-7G7"/>
                                     <constraint firstItem="MVM-vl-ICy" firstAttribute="height" secondItem="eLa-Wd-uFN" secondAttribute="height" multiplier="480:1000" id="eKX-6a-Cba"/>
                                     <constraint firstItem="MVM-vl-ICy" firstAttribute="top" secondItem="eLa-Wd-uFN" secondAttribute="top" id="mRH-z7-6cN"/>
+                                    <constraint firstItem="lVp-uI-vcl" firstAttribute="height" secondItem="eLa-Wd-uFN" secondAttribute="height" multiplier="480:1000" id="wHP-i8-bnC"/>
                                     <constraint firstItem="lVp-uI-vcl" firstAttribute="height" secondItem="eLa-Wd-uFN" secondAttribute="height" multiplier="480:1000" id="yFg-Bp-fwz"/>
                                 </constraints>
                                 <variation key="default">
                                     <mask key="constraints">
+                                        <exclude reference="JHS-rt-EdC"/>
                                         <exclude reference="Nny-oj-7G7"/>
                                         <exclude reference="eKX-6a-Cba"/>
                                         <exclude reference="7iV-QS-PJn"/>
                                         <exclude reference="Jze-Eq-CNO"/>
+                                        <exclude reference="wHP-i8-bnC"/>
                                     </mask>
                                 </variation>
                                 <variation key="widthClass=compact">
                                     <mask key="constraints">
+                                        <exclude reference="4rh-jK-7kS"/>
+                                        <include reference="JHS-rt-EdC"/>
                                         <include reference="Nny-oj-7G7"/>
-                                        <include reference="eKX-6a-Cba"/>
+                                        <exclude reference="eKX-6a-Cba"/>
                                         <include reference="7iV-QS-PJn"/>
-                                        <include reference="Jze-Eq-CNO"/>
+                                        <exclude reference="Jze-Eq-CNO"/>
+                                        <include reference="wHP-i8-bnC"/>
+                                        <exclude reference="yFg-Bp-fwz"/>
                                     </mask>
                                 </variation>
                             </stackView>
+                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="popo.png" translatesAutoresizingMaskIntoConstraints="NO" id="Kfm-dM-NL7">
+                                <rect key="frame" x="-20" y="0.0" width="640" height="210"/>
+                            </imageView>
                         </subviews>
                         <color key="backgroundColor" red="0.2627450980392157" green="0.76470588235294112" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                         <constraints>
                             <constraint firstItem="aez-C7-ZMf" firstAttribute="top" secondItem="Ll2-p2-3P8" secondAttribute="bottom" constant="8" id="1w9-LX-U4F"/>
                             <constraint firstItem="aez-C7-ZMf" firstAttribute="centerX" secondItem="BH2-bi-2yt" secondAttribute="centerX" id="2oj-yY-9er"/>
                             <constraint firstItem="nsW-vq-69g" firstAttribute="centerX" secondItem="BH2-bi-2yt" secondAttribute="centerX" id="2zW-A0-jKw"/>
+                            <constraint firstItem="Ll2-p2-3P8" firstAttribute="top" secondItem="nsW-vq-69g" secondAttribute="bottom" constant="16" id="5fs-e6-xN3"/>
+                            <constraint firstItem="Ll2-p2-3P8" firstAttribute="top" secondItem="nsW-vq-69g" secondAttribute="bottom" constant="16" id="7zT-KD-jWE"/>
                             <constraint firstItem="nsW-vq-69g" firstAttribute="top" secondItem="QUA-nU-9fU" secondAttribute="bottom" constant="123" id="93k-Rv-eVU"/>
+                            <constraint firstItem="J35-3i-lvV" firstAttribute="top" secondItem="aez-C7-ZMf" secondAttribute="bottom" constant="217" id="Au7-g9-pR0"/>
+                            <constraint firstItem="aez-C7-ZMf" firstAttribute="height" secondItem="eLa-Wd-uFN" secondAttribute="height" id="Bag-sX-eW0"/>
+                            <constraint firstItem="aez-C7-ZMf" firstAttribute="height" secondItem="Ll2-p2-3P8" secondAttribute="height" multiplier="400:1000" id="Bqa-5K-t3t"/>
                             <constraint firstItem="eLa-Wd-uFN" firstAttribute="top" secondItem="nsW-vq-69g" secondAttribute="bottom" constant="16" id="C6a-Xf-7MG"/>
-                            <constraint firstItem="Ll2-p2-3P8" firstAttribute="top" secondItem="nsW-vq-69g" secondAttribute="bottom" constant="14" id="EIz-rT-7Do"/>
+                            <constraint firstItem="Ll2-p2-3P8" firstAttribute="top" secondItem="nsW-vq-69g" secondAttribute="bottom" constant="14" id="EIz-rT-7Do">
+                                <variation key="widthClass=compact" constant="16"/>
+                            </constraint>
+                            <constraint firstItem="Ll2-p2-3P8" firstAttribute="top" secondItem="eLa-Wd-uFN" secondAttribute="top" id="J2w-Z6-McG"/>
                             <constraint firstItem="aez-C7-ZMf" firstAttribute="width" secondItem="Ll2-p2-3P8" secondAttribute="width" id="JJI-aD-agj"/>
                             <constraint firstItem="eLa-Wd-uFN" firstAttribute="width" secondItem="Ll2-p2-3P8" secondAttribute="height" multiplier="160:43" id="Jxo-a2-hR2"/>
                             <constraint firstItem="Kfm-dM-NL7" firstAttribute="centerX" secondItem="BH2-bi-2yt" secondAttribute="centerX" id="MbV-V7-3cR"/>
                             <constraint firstItem="eLa-Wd-uFN" firstAttribute="width" secondItem="Ll2-p2-3P8" secondAttribute="width" multiplier="850:1000" id="Sh9-b9-OjP"/>
                             <constraint firstItem="aez-C7-ZMf" firstAttribute="leading" secondItem="Ll2-p2-3P8" secondAttribute="leading" id="T1u-cE-UkB"/>
                             <constraint firstItem="eLa-Wd-uFN" firstAttribute="height" secondItem="Ll2-p2-3P8" secondAttribute="height" id="TOs-6a-3TU"/>
+                            <constraint firstItem="aez-C7-ZMf" firstAttribute="height" secondItem="Ll2-p2-3P8" secondAttribute="height" multiplier="500:1000" id="Vmk-E4-yDT"/>
                             <constraint firstItem="aez-C7-ZMf" firstAttribute="leading" secondItem="Ll2-p2-3P8" secondAttribute="trailing" constant="-320" id="bbO-Uz-Z11"/>
+                            <constraint firstItem="eLa-Wd-uFN" firstAttribute="top" secondItem="nsW-vq-69g" secondAttribute="bottom" constant="16" id="dKD-id-c6k"/>
                             <constraint firstItem="eLa-Wd-uFN" firstAttribute="width" secondItem="Ll2-p2-3P8" secondAttribute="width" multiplier="850:1000" id="gBS-WC-Al0"/>
-                            <constraint firstItem="aez-C7-ZMf" firstAttribute="top" secondItem="Ll2-p2-3P8" secondAttribute="bottom" constant="15" id="gNa-Jg-YCd"/>
                             <constraint firstItem="Ll2-p2-3P8" firstAttribute="centerX" secondItem="BH2-bi-2yt" secondAttribute="centerX" id="h0s-hQ-Eep"/>
                             <constraint firstItem="eLa-Wd-uFN" firstAttribute="width" secondItem="Ll2-p2-3P8" secondAttribute="width" id="lxO-gd-bSN"/>
                             <constraint firstItem="Kfm-dM-NL7" firstAttribute="top" secondItem="QUA-nU-9fU" secondAttribute="bottom" constant="-20" id="noX-hK-7Lu"/>
@@ -122,29 +153,45 @@
                         </constraints>
                         <variation key="default">
                             <mask key="constraints">
+                                <exclude reference="5fs-e6-xN3"/>
+                                <exclude reference="7zT-KD-jWE"/>
+                                <exclude reference="J2w-Z6-McG"/>
                                 <exclude reference="C6a-Xf-7MG"/>
                                 <exclude reference="Jxo-a2-hR2"/>
+                                <exclude reference="dKD-id-c6k"/>
                                 <exclude reference="gBS-WC-Al0"/>
                                 <exclude reference="lxO-gd-bSN"/>
                                 <exclude reference="tz3-nA-N5k"/>
                                 <exclude reference="x2n-c7-AM7"/>
                                 <exclude reference="xHa-6Y-8GJ"/>
+                                <exclude reference="Bag-sX-eW0"/>
+                                <exclude reference="Bqa-5K-t3t"/>
                                 <exclude reference="T1u-cE-UkB"/>
+                                <exclude reference="Vmk-E4-yDT"/>
                                 <exclude reference="bbO-Uz-Z11"/>
-                                <exclude reference="gNa-Jg-YCd"/>
                                 <exclude reference="tYc-Jk-Wbd"/>
+                                <exclude reference="Au7-g9-pR0"/>
                             </mask>
                         </variation>
                         <variation key="widthClass=compact">
                             <mask key="constraints">
-                                <include reference="C6a-Xf-7MG"/>
+                                <exclude reference="5fs-e6-xN3"/>
+                                <include reference="7zT-KD-jWE"/>
+                                <exclude reference="EIz-rT-7Do"/>
+                                <include reference="J2w-Z6-McG"/>
+                                <exclude reference="C6a-Xf-7MG"/>
+                                <exclude reference="dKD-id-c6k"/>
                                 <include reference="gBS-WC-Al0"/>
+                                <exclude reference="v8a-uP-Dfm"/>
                                 <include reference="x2n-c7-AM7"/>
                                 <include reference="xHa-6Y-8GJ"/>
-                                <include reference="T1u-cE-UkB"/>
+                                <exclude reference="Bag-sX-eW0"/>
+                                <include reference="Bqa-5K-t3t"/>
+                                <exclude reference="T1u-cE-UkB"/>
+                                <exclude reference="Vmk-E4-yDT"/>
                                 <include reference="bbO-Uz-Z11"/>
-                                <include reference="gNa-Jg-YCd"/>
-                                <include reference="tYc-Jk-Wbd"/>
+                                <exclude reference="tYc-Jk-Wbd"/>
+                                <exclude reference="Au7-g9-pR0"/>
                             </mask>
                         </variation>
                     </view>
@@ -261,24 +308,6 @@
             </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"/>

+ 1 - 1
SocketChat/LoginViewController.swift

@@ -82,7 +82,7 @@ class LoginViewController: UIViewController{
                 let LoginMSG:LoginMsg = LoginMsg(fromStringarr: tmpmsg)
                 //sendArr[1] = LoginMSG.toDictionary()
                 let parm = LoginMSG.toDictionary()as! [String : AnyObject!]
-                let url = (USER_SOCKET_SERVER as! String) + "/v1/user/login"
+                let url = (GET_SOCKET_SERVER as! String) + "/v1/user/login"
                 print("################ parm ###############")
                 
                 

+ 11 - 3
SocketChat/RecentViewController.swift

@@ -7,7 +7,7 @@
 //
 
 import UIKit
-
+var mysocket:TCPClient?
 class RecentViewController: UIViewController {
     @IBOutlet weak var lab: UILabel!
     
@@ -16,8 +16,16 @@ class RecentViewController: UIViewController {
         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)
+        
+        TCPClient.shareInstance.connect(GET_APP_SERVER! as! String)
+        let params:[String] = ["serverID = \(GET_SERVER_ID as! String)",
+                               "loginName = \(GET_USER_NAME as! String)",
+                               "password = a12345678",
+                               "type = 1 ",
+                               "clientType = 1",
+                               "deviceToken = \(GET_USER_TOKEN as! String)"]
+        mysocket?.send("user.auth", data: params)
+        TCPClient.shareInstance.recived("user.auth")
         //self.presentViewController(RecentVC, animated: true, completion: { () -> Void in
         
         //})

+ 3 - 3
SocketChat/SMSViewController.swift

@@ -11,9 +11,9 @@ import Alamofire
 class SMSViewController: UIViewController {
     @IBOutlet weak var mobile: UITextField!
     @IBOutlet weak var smscode: UITextField!
-    let serverid = USER_SERVER_ID as! String
-    let userid = DEFAULT_USER_ID as! Int
-    let loginname = DEFAULT_USER_NAME as! String
+    let serverid = GET_SERVER_ID as! String
+    let userid = GET_USER_ID as! Int
+    let loginname = GET_USER_NAME as! String
     var afmobile:String?
     @IBAction func requireCode(sender: UIButton) {
         var remainingSeconds: Int = 60

+ 11 - 8
SocketChat/TCPClient.swift

@@ -34,6 +34,7 @@ class TCPClient{
     //发送消息
     func send(event:String,data:AnyObject){
         socket?.emit(event, data)
+        
     }
     
     
@@ -41,19 +42,21 @@ class TCPClient{
     func recived(event:String){
         socket?.on(event, callback: { (data, Ack) in
             switch (event){
-            case "zhuxunserver.response": break
+            case "zhuxunserver.response":
+                print(data)
                 //收到消息后具体处理
                 
-            case "zhuxunserver.chat.message":break
+            case "zhuxunserver.chat.message":
                 //收到消息后具体处理
-                
-            case "zhuxunserver.users.state":break
+                print(data)
+            case "zhuxunserver.users.state":
                 //收到消息后具体处理
-                
-            case "zhuxunserver.login.locked":break
+                print(data)
+            case "zhuxunserver.login.locked":
                 //收到消息后具体处理
-            case "zhuxunserver.chatmessage.sync":break
-                
+                print(data)
+            case "zhuxunserver.chatmessage.sync":
+                print(data)
             default:
                 print("Unrecognized event")
             }

+ 0 - 62
SocketChat/zhuxun.xcdatamodel/.svn/entries

@@ -1,62 +0,0 @@
-10
-
-dir
-98
-http://wlf@101.71.251.190:18080/svn/ios/branches/150512_file/zhuxun/Model/zhuxun.xcdatamodeld/zhuxun%202.xcdatamodel
-http://wlf@101.71.251.190:18080/svn/ios
-
-
-
-2015-04-10T09:32:42.076826Z
-55
-zjw
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-d6d01364-c14c-4f4e-b8b5-2b265cae8b81
-
-contents
-file
-
-
-
-
-2015-08-13T01:23:52.000000Z
-0c7acb978262636da13495a450b4f4f0
-2015-04-10T09:32:42.076826Z
-55
-zjw
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-10577
-

+ 13 - 13
func.swift

@@ -37,14 +37,14 @@ let SERVER_ID = "SERVER_ID"
 let SOCKET_SERVER = "SOCKET_SERVER"
 
 
-let USER_CENTER_SERVER = ManagerUserDefault().SelectUserDefault(CENTER_SERVER)
-let USER_APP_SERVER = ManagerUserDefault().SelectUserDefault(APP_SERVER)
-let USER_CHAT_SERVER = ManagerUserDefault().SelectUserDefault(CHAT_SERVER)
-let USER_FILE_UP_SERVER = ManagerUserDefault().SelectUserDefault(FILE_UP_SERVER)
-let USER_FILE_DOWN_SERVER = ManagerUserDefault().SelectUserDefault(FILE_DOWN_SERVER)
-let USER_SERVER_ID = ManagerUserDefault().SelectUserDefault(SERVER_ID)
-let USER_SOCKET_SERVER = USER_APP_SERVER
-var USER_SOCKET_SERVER_URI = ((USER_APP_SERVER as! NSString).componentsSeparatedByString(":"))
+let GET_CENTER_SERVER = ManagerUserDefault().SelectUserDefault(CENTER_SERVER)
+let GET_APP_SERVER = ManagerUserDefault().SelectUserDefault(APP_SERVER)
+let GET_CHAT_SERVER = ManagerUserDefault().SelectUserDefault(CHAT_SERVER)
+let GET_FILE_UP_SERVER = ManagerUserDefault().SelectUserDefault(FILE_UP_SERVER)
+let GET_FILE_DOWN_SERVER = ManagerUserDefault().SelectUserDefault(FILE_DOWN_SERVER)
+let GET_SERVER_ID = ManagerUserDefault().SelectUserDefault(SERVER_ID)
+let GET_SOCKET_SERVER = GET_APP_SERVER
+var USER_SOCKET_SERVER_URI = ((GET_APP_SERVER as! NSString).componentsSeparatedByString(":"))
 let SOCKET_HOST = USER_SOCKET_SERVER_URI[0]
 let SOCKET_PORT = Int(USER_SOCKET_SERVER_URI[1])
 //################## About LoginMsg
@@ -56,12 +56,12 @@ let USERDEFAULT_SERVER_ID = "USERDEFAULT_SERVER_ID"
 let USERDEFAULT_APP_TOKEN = "USERDEFAULT_APP_TOKEN"
 
 
-let DEFAULT_USER_NAME = ManagerUserDefault().SelectUserDefault(USERDEFAULT_USER_NAME)
-let DEFAULT_USER_ID = ManagerUserDefault().SelectUserDefault(USERDEFAULT_USER_ID)
-
+let GET_USER_NAME = ManagerUserDefault().SelectUserDefault(USERDEFAULT_USER_NAME)
+let GET_USER_ID = ManagerUserDefault().SelectUserDefault(USERDEFAULT_USER_ID)
+let GET_USER_TOKEN = ManagerUserDefault().SelectUserDefault(USERDEFAULT_APP_TOKEN)
 //############### Check SMS ###############
-let RequireSMSURL = (USER_APP_SERVER as! String) + "/zhuxunserver/sms/sendCode"
-let CheckSMSURL =  (USER_APP_SERVER as! String) + "/zhuxunserver/sms/authCode"
+let RequireSMSURL = (GET_APP_SERVER as! String) + "/zhuxunserver/sms/sendCode"
+let CheckSMSURL =  (GET_APP_SERVER as! String) + "/zhuxunserver/sms/authCode"
 
 
 

+ 8 - 0
zhuxun.xcdatamodeld/.xccurrentversion

@@ -0,0 +1,8 @@
+<?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>_XCCurrentVersionName</key>
+	<string>zhuxun.xcdatamodel</string>
+</dict>
+</plist>

+ 109 - 0
zhuxun.xcdatamodeld/zhuxun.xcdatamodel/contents

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="10174" systemVersion="15F34" minimumToolsVersion="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="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="isdeleted" optional="YES" attributeType="Integer 16" 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>