├── .gitignore ├── .gitmodules ├── Chat ├── Chat.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcuserdata │ │ └── honcheng.xcuserdatad │ │ └── xcschemes │ │ ├── Chat.xcscheme │ │ └── xcschememanagement.plist └── Chat │ ├── Chat-Info.plist │ ├── Chat-Prefix.pch │ ├── ChatAppDelegate.h │ ├── ChatAppDelegate.m │ ├── ChatClient │ ├── ChatTableViewCell.h │ ├── ChatTableViewCell.m │ ├── ChatViewController.h │ ├── ChatViewController.m │ ├── GenericViewController.h │ ├── GenericViewController.m │ ├── LoginViewController.h │ ├── LoginViewController.m │ ├── StatusTableViewCell.h │ ├── StatusTableViewCell.m │ ├── WebViewController.h │ └── WebViewController.m │ ├── Location │ ├── CoreLocationManager.h │ ├── CoreLocationManager.m │ ├── LocationInfo.h │ └── LocationInfo.m │ ├── Resources │ ├── Default-Landscape.png │ ├── Default-Landscape.psd │ ├── Default-Portrait.png │ ├── Default-Portrait.psd │ ├── Default.png │ ├── Default.psd │ ├── Default@2x.png │ ├── Icon-72.png │ ├── Icon.png │ ├── Icon.psd │ ├── Icon@2x.png │ ├── back_button.png │ ├── back_button.psd │ ├── back_button@2x.png │ ├── button.psd │ ├── button_black.png │ ├── button_black@2x.png │ ├── button_gray.png │ ├── button_gray@2x.png │ ├── button_white.png │ ├── button_white@2x.png │ ├── font │ │ └── HelveticaNeue.ttc │ ├── input_bg.png │ ├── input_bg.psd │ └── input_bg@2x.png │ ├── en.lproj │ └── InfoPlist.strings │ ├── iPad │ ├── ChatAppDelegate_iPad.h │ ├── ChatAppDelegate_iPad.m │ └── en.lproj │ │ └── MainWindow_iPad.xib │ ├── iPhone │ ├── ChatAppDelegate_iPhone.h │ ├── ChatAppDelegate_iPhone.m │ └── en.lproj │ │ └── MainWindow_iPhone.xib │ └── main.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | Chat/.DS_Store 2 | Chat/Chat.xcodeproj/project.xcworkspace/xcuserdata/honcheng.xcuserdatad/UserInterfaceState.xcuserstate 3 | Chat/Chat/.DS_Store 4 | Chat/Chat/Resources/.DS_Store -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Chat/JSONKit"] 2 | path = Chat/JSONKit 3 | url = https://github.com/johnezang/JSONKit.git 4 | [submodule "Chat/fpotter-socketio-cocoa"] 5 | path = Chat/fpotter-socketio-cocoa 6 | url = https://github.com/fpotter/socketio-cocoa.git 7 | [submodule "Chat/RTLabel"] 8 | path = Chat/RTLabel 9 | url = git@github.com:honcheng/RTLabel.git 10 | -------------------------------------------------------------------------------- /Chat/Chat.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F827B315137547D3005A87FE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F827B314137547D3005A87FE /* UIKit.framework */; }; 11 | F827B317137547D3005A87FE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F827B316137547D3005A87FE /* Foundation.framework */; }; 12 | F827B319137547D3005A87FE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F827B318137547D3005A87FE /* CoreGraphics.framework */; }; 13 | F827B31F137547D3005A87FE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F827B31D137547D3005A87FE /* InfoPlist.strings */; }; 14 | F827B322137547D3005A87FE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B321137547D3005A87FE /* main.m */; }; 15 | F827B325137547D3005A87FE /* ChatAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B324137547D3005A87FE /* ChatAppDelegate.m */; }; 16 | F827B329137547D3005A87FE /* ChatAppDelegate_iPhone.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B328137547D3005A87FE /* ChatAppDelegate_iPhone.m */; }; 17 | F827B32C137547D3005A87FE /* MainWindow_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = F827B32A137547D3005A87FE /* MainWindow_iPhone.xib */; }; 18 | F827B330137547D3005A87FE /* ChatAppDelegate_iPad.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B32F137547D3005A87FE /* ChatAppDelegate_iPad.m */; }; 19 | F827B333137547D3005A87FE /* MainWindow_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = F827B331137547D3005A87FE /* MainWindow_iPad.xib */; }; 20 | F827B34413754AF8005A87FE /* RTLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B34313754AF8005A87FE /* RTLabel.m */; }; 21 | F827B34913754B02005A87FE /* CHANGELOG.md in Resources */ = {isa = PBXBuildFile; fileRef = F827B34513754B02005A87FE /* CHANGELOG.md */; }; 22 | F827B34A13754B02005A87FE /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B34713754B02005A87FE /* JSONKit.m */; }; 23 | F827B34B13754B02005A87FE /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = F827B34813754B02005A87FE /* README.md */; }; 24 | F827B35513754B96005A87FE /* SocketIoClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B35313754B96005A87FE /* SocketIoClient.m */; }; 25 | F827B35613754B96005A87FE /* ZLIB-LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = F827B35413754B96005A87FE /* ZLIB-LICENSE */; }; 26 | F827B35A13754BE8005A87FE /* AsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B35913754BE8005A87FE /* AsyncSocket.m */; }; 27 | F827B35E13754BF3005A87FE /* WebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B35C13754BF3005A87FE /* WebSocket.m */; }; 28 | F827B35F13754BF3005A87FE /* ZLIB-LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = F827B35D13754BF3005A87FE /* ZLIB-LICENSE */; }; 29 | F827B36113754C22005A87FE /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F827B36013754C22005A87FE /* CoreText.framework */; }; 30 | F827B36313754C28005A87FE /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F827B36213754C28005A87FE /* CoreLocation.framework */; }; 31 | F827B36513754C32005A87FE /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F827B36413754C32005A87FE /* CFNetwork.framework */; }; 32 | F827B36B13754C6D005A87FE /* CoreLocationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B36813754C6D005A87FE /* CoreLocationManager.m */; }; 33 | F827B36C13754C6D005A87FE /* LocationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B36A13754C6D005A87FE /* LocationInfo.m */; }; 34 | F827B39113754E05005A87FE /* back_button.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38013754E05005A87FE /* back_button.png */; }; 35 | F827B39213754E05005A87FE /* back_button@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38113754E05005A87FE /* back_button@2x.png */; }; 36 | F827B39313754E05005A87FE /* button_black.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38213754E05005A87FE /* button_black.png */; }; 37 | F827B39413754E05005A87FE /* button_black@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38313754E05005A87FE /* button_black@2x.png */; }; 38 | F827B39513754E05005A87FE /* button_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38413754E05005A87FE /* button_gray.png */; }; 39 | F827B39613754E05005A87FE /* button_gray@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38513754E05005A87FE /* button_gray@2x.png */; }; 40 | F827B39713754E05005A87FE /* button_white.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38613754E05005A87FE /* button_white.png */; }; 41 | F827B39813754E05005A87FE /* button_white@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38713754E05005A87FE /* button_white@2x.png */; }; 42 | F827B39913754E05005A87FE /* Default-Landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38813754E05005A87FE /* Default-Landscape.png */; }; 43 | F827B39A13754E05005A87FE /* Default-Portrait.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38913754E05005A87FE /* Default-Portrait.png */; }; 44 | F827B39B13754E05005A87FE /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38A13754E05005A87FE /* Default.png */; }; 45 | F827B39C13754E05005A87FE /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38B13754E05005A87FE /* Default@2x.png */; }; 46 | F827B39D13754E05005A87FE /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38C13754E05005A87FE /* Icon-72.png */; }; 47 | F827B39E13754E05005A87FE /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38D13754E05005A87FE /* Icon.png */; }; 48 | F827B39F13754E05005A87FE /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38E13754E05005A87FE /* Icon@2x.png */; }; 49 | F827B3A013754E05005A87FE /* input_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B38F13754E05005A87FE /* input_bg.png */; }; 50 | F827B3A113754E05005A87FE /* input_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F827B39013754E05005A87FE /* input_bg@2x.png */; }; 51 | F827B3A413754E14005A87FE /* HelveticaNeue.ttc in Resources */ = {isa = PBXBuildFile; fileRef = F827B3A313754E14005A87FE /* HelveticaNeue.ttc */; }; 52 | F827B3B213754E94005A87FE /* ChatTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B3A713754E94005A87FE /* ChatTableViewCell.m */; }; 53 | F827B3B313754E94005A87FE /* ChatViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B3A913754E94005A87FE /* ChatViewController.m */; }; 54 | F827B3B413754E94005A87FE /* GenericViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B3AB13754E94005A87FE /* GenericViewController.m */; }; 55 | F827B3B513754E94005A87FE /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B3AD13754E94005A87FE /* LoginViewController.m */; }; 56 | F827B3B613754E94005A87FE /* StatusTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B3AF13754E94005A87FE /* StatusTableViewCell.m */; }; 57 | F827B3B713754E94005A87FE /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F827B3B113754E94005A87FE /* WebViewController.m */; }; 58 | /* End PBXBuildFile section */ 59 | 60 | /* Begin PBXFileReference section */ 61 | F827B310137547D2005A87FE /* Chat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Chat.app; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | F827B314137547D3005A87FE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 63 | F827B316137547D3005A87FE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 64 | F827B318137547D3005A87FE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 65 | F827B31C137547D3005A87FE /* Chat-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Chat-Info.plist"; sourceTree = ""; }; 66 | F827B31E137547D3005A87FE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 67 | F827B320137547D3005A87FE /* Chat-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Chat-Prefix.pch"; sourceTree = ""; }; 68 | F827B321137547D3005A87FE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 69 | F827B323137547D3005A87FE /* ChatAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChatAppDelegate.h; sourceTree = ""; }; 70 | F827B324137547D3005A87FE /* ChatAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ChatAppDelegate.m; sourceTree = ""; }; 71 | F827B327137547D3005A87FE /* ChatAppDelegate_iPhone.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ChatAppDelegate_iPhone.h; path = iPhone/ChatAppDelegate_iPhone.h; sourceTree = ""; }; 72 | F827B328137547D3005A87FE /* ChatAppDelegate_iPhone.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ChatAppDelegate_iPhone.m; path = iPhone/ChatAppDelegate_iPhone.m; sourceTree = ""; }; 73 | F827B32B137547D3005A87FE /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = iPhone/en.lproj/MainWindow_iPhone.xib; sourceTree = ""; }; 74 | F827B32E137547D3005A87FE /* ChatAppDelegate_iPad.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ChatAppDelegate_iPad.h; path = iPad/ChatAppDelegate_iPad.h; sourceTree = ""; }; 75 | F827B32F137547D3005A87FE /* ChatAppDelegate_iPad.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ChatAppDelegate_iPad.m; path = iPad/ChatAppDelegate_iPad.m; sourceTree = ""; }; 76 | F827B332137547D3005A87FE /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = iPad/en.lproj/MainWindow_iPad.xib; sourceTree = ""; }; 77 | F827B34213754AF8005A87FE /* RTLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RTLabel.h; path = RTLabel/RTLabelProject/Classes/RTLabel.h; sourceTree = SOURCE_ROOT; }; 78 | F827B34313754AF8005A87FE /* RTLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RTLabel.m; path = RTLabel/RTLabelProject/Classes/RTLabel.m; sourceTree = SOURCE_ROOT; }; 79 | F827B34513754B02005A87FE /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CHANGELOG.md; path = JSONKit/CHANGELOG.md; sourceTree = SOURCE_ROOT; }; 80 | F827B34613754B02005A87FE /* JSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSONKit.h; path = JSONKit/JSONKit.h; sourceTree = SOURCE_ROOT; }; 81 | F827B34713754B02005A87FE /* JSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSONKit.m; path = JSONKit/JSONKit.m; sourceTree = SOURCE_ROOT; }; 82 | F827B34813754B02005A87FE /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = JSONKit/README.md; sourceTree = SOURCE_ROOT; }; 83 | F827B35213754B96005A87FE /* SocketIoClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocketIoClient.h; path = "fpotter-socketio-cocoa/SocketIoClient.h"; sourceTree = SOURCE_ROOT; }; 84 | F827B35313754B96005A87FE /* SocketIoClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SocketIoClient.m; path = "fpotter-socketio-cocoa/SocketIoClient.m"; sourceTree = SOURCE_ROOT; }; 85 | F827B35413754B96005A87FE /* ZLIB-LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "ZLIB-LICENSE"; path = "fpotter-socketio-cocoa/ZLIB-LICENSE"; sourceTree = SOURCE_ROOT; }; 86 | F827B35813754BE8005A87FE /* AsyncSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsyncSocket.h; path = "fpotter-socketio-cocoa/cocoa-websocket/AsyncSocket/AsyncSocket.h"; sourceTree = SOURCE_ROOT; }; 87 | F827B35913754BE8005A87FE /* AsyncSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AsyncSocket.m; path = "fpotter-socketio-cocoa/cocoa-websocket/AsyncSocket/AsyncSocket.m"; sourceTree = SOURCE_ROOT; }; 88 | F827B35B13754BF3005A87FE /* WebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocket.h; path = "fpotter-socketio-cocoa/cocoa-websocket/WebSocket.h"; sourceTree = SOURCE_ROOT; }; 89 | F827B35C13754BF3005A87FE /* WebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WebSocket.m; path = "fpotter-socketio-cocoa/cocoa-websocket/WebSocket.m"; sourceTree = SOURCE_ROOT; }; 90 | F827B35D13754BF3005A87FE /* ZLIB-LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "ZLIB-LICENSE"; path = "fpotter-socketio-cocoa/cocoa-websocket/ZLIB-LICENSE"; sourceTree = SOURCE_ROOT; }; 91 | F827B36013754C22005A87FE /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; 92 | F827B36213754C28005A87FE /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 93 | F827B36413754C32005A87FE /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; 94 | F827B36713754C6D005A87FE /* CoreLocationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoreLocationManager.h; path = Location/CoreLocationManager.h; sourceTree = ""; }; 95 | F827B36813754C6D005A87FE /* CoreLocationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CoreLocationManager.m; path = Location/CoreLocationManager.m; sourceTree = ""; }; 96 | F827B36913754C6D005A87FE /* LocationInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LocationInfo.h; path = Location/LocationInfo.h; sourceTree = ""; }; 97 | F827B36A13754C6D005A87FE /* LocationInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LocationInfo.m; path = Location/LocationInfo.m; sourceTree = ""; }; 98 | F827B38013754E05005A87FE /* back_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = back_button.png; path = Resources/back_button.png; sourceTree = ""; }; 99 | F827B38113754E05005A87FE /* back_button@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "back_button@2x.png"; path = "Resources/back_button@2x.png"; sourceTree = ""; }; 100 | F827B38213754E05005A87FE /* button_black.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = button_black.png; path = Resources/button_black.png; sourceTree = ""; }; 101 | F827B38313754E05005A87FE /* button_black@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "button_black@2x.png"; path = "Resources/button_black@2x.png"; sourceTree = ""; }; 102 | F827B38413754E05005A87FE /* button_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = button_gray.png; path = Resources/button_gray.png; sourceTree = ""; }; 103 | F827B38513754E05005A87FE /* button_gray@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "button_gray@2x.png"; path = "Resources/button_gray@2x.png"; sourceTree = ""; }; 104 | F827B38613754E05005A87FE /* button_white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = button_white.png; path = Resources/button_white.png; sourceTree = ""; }; 105 | F827B38713754E05005A87FE /* button_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "button_white@2x.png"; path = "Resources/button_white@2x.png"; sourceTree = ""; }; 106 | F827B38813754E05005A87FE /* Default-Landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-Landscape.png"; path = "Resources/Default-Landscape.png"; sourceTree = ""; }; 107 | F827B38913754E05005A87FE /* Default-Portrait.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-Portrait.png"; path = "Resources/Default-Portrait.png"; sourceTree = ""; }; 108 | F827B38A13754E05005A87FE /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/Default.png; sourceTree = ""; }; 109 | F827B38B13754E05005A87FE /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Resources/Default@2x.png"; sourceTree = ""; }; 110 | F827B38C13754E05005A87FE /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "Resources/Icon-72.png"; sourceTree = ""; }; 111 | F827B38D13754E05005A87FE /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = Resources/Icon.png; sourceTree = ""; }; 112 | F827B38E13754E05005A87FE /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "Resources/Icon@2x.png"; sourceTree = ""; }; 113 | F827B38F13754E05005A87FE /* input_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = input_bg.png; path = Resources/input_bg.png; sourceTree = ""; }; 114 | F827B39013754E05005A87FE /* input_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "input_bg@2x.png"; path = "Resources/input_bg@2x.png"; sourceTree = ""; }; 115 | F827B3A313754E14005A87FE /* HelveticaNeue.ttc */ = {isa = PBXFileReference; lastKnownFileType = file; name = HelveticaNeue.ttc; path = Resources/font/HelveticaNeue.ttc; sourceTree = ""; }; 116 | F827B3A613754E94005A87FE /* ChatTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChatTableViewCell.h; path = ChatClient/ChatTableViewCell.h; sourceTree = ""; }; 117 | F827B3A713754E94005A87FE /* ChatTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ChatTableViewCell.m; path = ChatClient/ChatTableViewCell.m; sourceTree = ""; }; 118 | F827B3A813754E94005A87FE /* ChatViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChatViewController.h; path = ChatClient/ChatViewController.h; sourceTree = ""; }; 119 | F827B3A913754E94005A87FE /* ChatViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ChatViewController.m; path = ChatClient/ChatViewController.m; sourceTree = ""; }; 120 | F827B3AA13754E94005A87FE /* GenericViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GenericViewController.h; path = ChatClient/GenericViewController.h; sourceTree = ""; }; 121 | F827B3AB13754E94005A87FE /* GenericViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GenericViewController.m; path = ChatClient/GenericViewController.m; sourceTree = ""; }; 122 | F827B3AC13754E94005A87FE /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoginViewController.h; path = ChatClient/LoginViewController.h; sourceTree = ""; }; 123 | F827B3AD13754E94005A87FE /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LoginViewController.m; path = ChatClient/LoginViewController.m; sourceTree = ""; }; 124 | F827B3AE13754E94005A87FE /* StatusTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatusTableViewCell.h; path = ChatClient/StatusTableViewCell.h; sourceTree = ""; }; 125 | F827B3AF13754E94005A87FE /* StatusTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatusTableViewCell.m; path = ChatClient/StatusTableViewCell.m; sourceTree = ""; }; 126 | F827B3B013754E94005A87FE /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebViewController.h; path = ChatClient/WebViewController.h; sourceTree = ""; }; 127 | F827B3B113754E94005A87FE /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WebViewController.m; path = ChatClient/WebViewController.m; sourceTree = ""; }; 128 | /* End PBXFileReference section */ 129 | 130 | /* Begin PBXFrameworksBuildPhase section */ 131 | F827B30D137547D2005A87FE /* Frameworks */ = { 132 | isa = PBXFrameworksBuildPhase; 133 | buildActionMask = 2147483647; 134 | files = ( 135 | F827B36513754C32005A87FE /* CFNetwork.framework in Frameworks */, 136 | F827B36313754C28005A87FE /* CoreLocation.framework in Frameworks */, 137 | F827B36113754C22005A87FE /* CoreText.framework in Frameworks */, 138 | F827B315137547D3005A87FE /* UIKit.framework in Frameworks */, 139 | F827B317137547D3005A87FE /* Foundation.framework in Frameworks */, 140 | F827B319137547D3005A87FE /* CoreGraphics.framework in Frameworks */, 141 | ); 142 | runOnlyForDeploymentPostprocessing = 0; 143 | }; 144 | /* End PBXFrameworksBuildPhase section */ 145 | 146 | /* Begin PBXGroup section */ 147 | F827B305137547D2005A87FE = { 148 | isa = PBXGroup; 149 | children = ( 150 | F827B31A137547D3005A87FE /* Chat */, 151 | F827B313137547D2005A87FE /* Frameworks */, 152 | F827B311137547D2005A87FE /* Products */, 153 | ); 154 | sourceTree = ""; 155 | }; 156 | F827B311137547D2005A87FE /* Products */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | F827B310137547D2005A87FE /* Chat.app */, 160 | ); 161 | name = Products; 162 | sourceTree = ""; 163 | }; 164 | F827B313137547D2005A87FE /* Frameworks */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | F827B36413754C32005A87FE /* CFNetwork.framework */, 168 | F827B36213754C28005A87FE /* CoreLocation.framework */, 169 | F827B36013754C22005A87FE /* CoreText.framework */, 170 | F827B314137547D3005A87FE /* UIKit.framework */, 171 | F827B316137547D3005A87FE /* Foundation.framework */, 172 | F827B318137547D3005A87FE /* CoreGraphics.framework */, 173 | ); 174 | name = Frameworks; 175 | sourceTree = ""; 176 | }; 177 | F827B31A137547D3005A87FE /* Chat */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | F827B323137547D3005A87FE /* ChatAppDelegate.h */, 181 | F827B324137547D3005A87FE /* ChatAppDelegate.m */, 182 | F827B3A513754E72005A87FE /* ChatClient */, 183 | F827B36613754C5F005A87FE /* Location */, 184 | F827B35713754BC6005A87FE /* cocoa-websocket */, 185 | F827B34113754ADB005A87FE /* fpotter-socketio-cocoa */, 186 | F827B34013754AD4005A87FE /* JSONKit */, 187 | F827B33F13754ACD005A87FE /* RTLabel */, 188 | F827B326137547D3005A87FE /* iPhone */, 189 | F827B32D137547D3005A87FE /* iPad */, 190 | F827B31B137547D3005A87FE /* Supporting Files */, 191 | ); 192 | path = Chat; 193 | sourceTree = ""; 194 | }; 195 | F827B31B137547D3005A87FE /* Supporting Files */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | F827B3A213754E09005A87FE /* Fonts */, 199 | F827B37F13754DF0005A87FE /* Resources */, 200 | F827B31C137547D3005A87FE /* Chat-Info.plist */, 201 | F827B31D137547D3005A87FE /* InfoPlist.strings */, 202 | F827B320137547D3005A87FE /* Chat-Prefix.pch */, 203 | F827B321137547D3005A87FE /* main.m */, 204 | ); 205 | name = "Supporting Files"; 206 | sourceTree = ""; 207 | }; 208 | F827B326137547D3005A87FE /* iPhone */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | F827B327137547D3005A87FE /* ChatAppDelegate_iPhone.h */, 212 | F827B328137547D3005A87FE /* ChatAppDelegate_iPhone.m */, 213 | F827B32A137547D3005A87FE /* MainWindow_iPhone.xib */, 214 | ); 215 | name = iPhone; 216 | sourceTree = ""; 217 | }; 218 | F827B32D137547D3005A87FE /* iPad */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | F827B32E137547D3005A87FE /* ChatAppDelegate_iPad.h */, 222 | F827B32F137547D3005A87FE /* ChatAppDelegate_iPad.m */, 223 | F827B331137547D3005A87FE /* MainWindow_iPad.xib */, 224 | ); 225 | name = iPad; 226 | sourceTree = ""; 227 | }; 228 | F827B33F13754ACD005A87FE /* RTLabel */ = { 229 | isa = PBXGroup; 230 | children = ( 231 | F827B34213754AF8005A87FE /* RTLabel.h */, 232 | F827B34313754AF8005A87FE /* RTLabel.m */, 233 | ); 234 | name = RTLabel; 235 | sourceTree = ""; 236 | }; 237 | F827B34013754AD4005A87FE /* JSONKit */ = { 238 | isa = PBXGroup; 239 | children = ( 240 | F827B34513754B02005A87FE /* CHANGELOG.md */, 241 | F827B34613754B02005A87FE /* JSONKit.h */, 242 | F827B34713754B02005A87FE /* JSONKit.m */, 243 | F827B34813754B02005A87FE /* README.md */, 244 | ); 245 | name = JSONKit; 246 | sourceTree = ""; 247 | }; 248 | F827B34113754ADB005A87FE /* fpotter-socketio-cocoa */ = { 249 | isa = PBXGroup; 250 | children = ( 251 | F827B35213754B96005A87FE /* SocketIoClient.h */, 252 | F827B35313754B96005A87FE /* SocketIoClient.m */, 253 | F827B35413754B96005A87FE /* ZLIB-LICENSE */, 254 | ); 255 | name = "fpotter-socketio-cocoa"; 256 | sourceTree = ""; 257 | }; 258 | F827B35713754BC6005A87FE /* cocoa-websocket */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | F827B35813754BE8005A87FE /* AsyncSocket.h */, 262 | F827B35913754BE8005A87FE /* AsyncSocket.m */, 263 | F827B35B13754BF3005A87FE /* WebSocket.h */, 264 | F827B35C13754BF3005A87FE /* WebSocket.m */, 265 | F827B35D13754BF3005A87FE /* ZLIB-LICENSE */, 266 | ); 267 | name = "cocoa-websocket"; 268 | sourceTree = ""; 269 | }; 270 | F827B36613754C5F005A87FE /* Location */ = { 271 | isa = PBXGroup; 272 | children = ( 273 | F827B36713754C6D005A87FE /* CoreLocationManager.h */, 274 | F827B36813754C6D005A87FE /* CoreLocationManager.m */, 275 | F827B36913754C6D005A87FE /* LocationInfo.h */, 276 | F827B36A13754C6D005A87FE /* LocationInfo.m */, 277 | ); 278 | name = Location; 279 | sourceTree = ""; 280 | }; 281 | F827B37F13754DF0005A87FE /* Resources */ = { 282 | isa = PBXGroup; 283 | children = ( 284 | F827B38013754E05005A87FE /* back_button.png */, 285 | F827B38113754E05005A87FE /* back_button@2x.png */, 286 | F827B38213754E05005A87FE /* button_black.png */, 287 | F827B38313754E05005A87FE /* button_black@2x.png */, 288 | F827B38413754E05005A87FE /* button_gray.png */, 289 | F827B38513754E05005A87FE /* button_gray@2x.png */, 290 | F827B38613754E05005A87FE /* button_white.png */, 291 | F827B38713754E05005A87FE /* button_white@2x.png */, 292 | F827B38813754E05005A87FE /* Default-Landscape.png */, 293 | F827B38913754E05005A87FE /* Default-Portrait.png */, 294 | F827B38A13754E05005A87FE /* Default.png */, 295 | F827B38B13754E05005A87FE /* Default@2x.png */, 296 | F827B38C13754E05005A87FE /* Icon-72.png */, 297 | F827B38D13754E05005A87FE /* Icon.png */, 298 | F827B38E13754E05005A87FE /* Icon@2x.png */, 299 | F827B38F13754E05005A87FE /* input_bg.png */, 300 | F827B39013754E05005A87FE /* input_bg@2x.png */, 301 | ); 302 | name = Resources; 303 | sourceTree = ""; 304 | }; 305 | F827B3A213754E09005A87FE /* Fonts */ = { 306 | isa = PBXGroup; 307 | children = ( 308 | F827B3A313754E14005A87FE /* HelveticaNeue.ttc */, 309 | ); 310 | name = Fonts; 311 | sourceTree = ""; 312 | }; 313 | F827B3A513754E72005A87FE /* ChatClient */ = { 314 | isa = PBXGroup; 315 | children = ( 316 | F827B3A613754E94005A87FE /* ChatTableViewCell.h */, 317 | F827B3A713754E94005A87FE /* ChatTableViewCell.m */, 318 | F827B3A813754E94005A87FE /* ChatViewController.h */, 319 | F827B3A913754E94005A87FE /* ChatViewController.m */, 320 | F827B3AA13754E94005A87FE /* GenericViewController.h */, 321 | F827B3AB13754E94005A87FE /* GenericViewController.m */, 322 | F827B3AC13754E94005A87FE /* LoginViewController.h */, 323 | F827B3AD13754E94005A87FE /* LoginViewController.m */, 324 | F827B3AE13754E94005A87FE /* StatusTableViewCell.h */, 325 | F827B3AF13754E94005A87FE /* StatusTableViewCell.m */, 326 | F827B3B013754E94005A87FE /* WebViewController.h */, 327 | F827B3B113754E94005A87FE /* WebViewController.m */, 328 | ); 329 | name = ChatClient; 330 | sourceTree = ""; 331 | }; 332 | /* End PBXGroup section */ 333 | 334 | /* Begin PBXNativeTarget section */ 335 | F827B30F137547D2005A87FE /* Chat */ = { 336 | isa = PBXNativeTarget; 337 | buildConfigurationList = F827B336137547D3005A87FE /* Build configuration list for PBXNativeTarget "Chat" */; 338 | buildPhases = ( 339 | F827B30C137547D2005A87FE /* Sources */, 340 | F827B30D137547D2005A87FE /* Frameworks */, 341 | F827B30E137547D2005A87FE /* Resources */, 342 | ); 343 | buildRules = ( 344 | ); 345 | dependencies = ( 346 | ); 347 | name = Chat; 348 | productName = Chat; 349 | productReference = F827B310137547D2005A87FE /* Chat.app */; 350 | productType = "com.apple.product-type.application"; 351 | }; 352 | /* End PBXNativeTarget section */ 353 | 354 | /* Begin PBXProject section */ 355 | F827B307137547D2005A87FE /* Project object */ = { 356 | isa = PBXProject; 357 | attributes = { 358 | ORGANIZATIONNAME = "BuUuK Pte Ltd"; 359 | }; 360 | buildConfigurationList = F827B30A137547D2005A87FE /* Build configuration list for PBXProject "Chat" */; 361 | compatibilityVersion = "Xcode 3.2"; 362 | developmentRegion = English; 363 | hasScannedForEncodings = 0; 364 | knownRegions = ( 365 | en, 366 | ); 367 | mainGroup = F827B305137547D2005A87FE; 368 | productRefGroup = F827B311137547D2005A87FE /* Products */; 369 | projectDirPath = ""; 370 | projectRoot = ""; 371 | targets = ( 372 | F827B30F137547D2005A87FE /* Chat */, 373 | ); 374 | }; 375 | /* End PBXProject section */ 376 | 377 | /* Begin PBXResourcesBuildPhase section */ 378 | F827B30E137547D2005A87FE /* Resources */ = { 379 | isa = PBXResourcesBuildPhase; 380 | buildActionMask = 2147483647; 381 | files = ( 382 | F827B31F137547D3005A87FE /* InfoPlist.strings in Resources */, 383 | F827B32C137547D3005A87FE /* MainWindow_iPhone.xib in Resources */, 384 | F827B333137547D3005A87FE /* MainWindow_iPad.xib in Resources */, 385 | F827B34913754B02005A87FE /* CHANGELOG.md in Resources */, 386 | F827B34B13754B02005A87FE /* README.md in Resources */, 387 | F827B35613754B96005A87FE /* ZLIB-LICENSE in Resources */, 388 | F827B35F13754BF3005A87FE /* ZLIB-LICENSE in Resources */, 389 | F827B39113754E05005A87FE /* back_button.png in Resources */, 390 | F827B39213754E05005A87FE /* back_button@2x.png in Resources */, 391 | F827B39313754E05005A87FE /* button_black.png in Resources */, 392 | F827B39413754E05005A87FE /* button_black@2x.png in Resources */, 393 | F827B39513754E05005A87FE /* button_gray.png in Resources */, 394 | F827B39613754E05005A87FE /* button_gray@2x.png in Resources */, 395 | F827B39713754E05005A87FE /* button_white.png in Resources */, 396 | F827B39813754E05005A87FE /* button_white@2x.png in Resources */, 397 | F827B39913754E05005A87FE /* Default-Landscape.png in Resources */, 398 | F827B39A13754E05005A87FE /* Default-Portrait.png in Resources */, 399 | F827B39B13754E05005A87FE /* Default.png in Resources */, 400 | F827B39C13754E05005A87FE /* Default@2x.png in Resources */, 401 | F827B39D13754E05005A87FE /* Icon-72.png in Resources */, 402 | F827B39E13754E05005A87FE /* Icon.png in Resources */, 403 | F827B39F13754E05005A87FE /* Icon@2x.png in Resources */, 404 | F827B3A013754E05005A87FE /* input_bg.png in Resources */, 405 | F827B3A113754E05005A87FE /* input_bg@2x.png in Resources */, 406 | F827B3A413754E14005A87FE /* HelveticaNeue.ttc in Resources */, 407 | ); 408 | runOnlyForDeploymentPostprocessing = 0; 409 | }; 410 | /* End PBXResourcesBuildPhase section */ 411 | 412 | /* Begin PBXSourcesBuildPhase section */ 413 | F827B30C137547D2005A87FE /* Sources */ = { 414 | isa = PBXSourcesBuildPhase; 415 | buildActionMask = 2147483647; 416 | files = ( 417 | F827B322137547D3005A87FE /* main.m in Sources */, 418 | F827B325137547D3005A87FE /* ChatAppDelegate.m in Sources */, 419 | F827B329137547D3005A87FE /* ChatAppDelegate_iPhone.m in Sources */, 420 | F827B330137547D3005A87FE /* ChatAppDelegate_iPad.m in Sources */, 421 | F827B34413754AF8005A87FE /* RTLabel.m in Sources */, 422 | F827B34A13754B02005A87FE /* JSONKit.m in Sources */, 423 | F827B35513754B96005A87FE /* SocketIoClient.m in Sources */, 424 | F827B35A13754BE8005A87FE /* AsyncSocket.m in Sources */, 425 | F827B35E13754BF3005A87FE /* WebSocket.m in Sources */, 426 | F827B36B13754C6D005A87FE /* CoreLocationManager.m in Sources */, 427 | F827B36C13754C6D005A87FE /* LocationInfo.m in Sources */, 428 | F827B3B213754E94005A87FE /* ChatTableViewCell.m in Sources */, 429 | F827B3B313754E94005A87FE /* ChatViewController.m in Sources */, 430 | F827B3B413754E94005A87FE /* GenericViewController.m in Sources */, 431 | F827B3B513754E94005A87FE /* LoginViewController.m in Sources */, 432 | F827B3B613754E94005A87FE /* StatusTableViewCell.m in Sources */, 433 | F827B3B713754E94005A87FE /* WebViewController.m in Sources */, 434 | ); 435 | runOnlyForDeploymentPostprocessing = 0; 436 | }; 437 | /* End PBXSourcesBuildPhase section */ 438 | 439 | /* Begin PBXVariantGroup section */ 440 | F827B31D137547D3005A87FE /* InfoPlist.strings */ = { 441 | isa = PBXVariantGroup; 442 | children = ( 443 | F827B31E137547D3005A87FE /* en */, 444 | ); 445 | name = InfoPlist.strings; 446 | sourceTree = ""; 447 | }; 448 | F827B32A137547D3005A87FE /* MainWindow_iPhone.xib */ = { 449 | isa = PBXVariantGroup; 450 | children = ( 451 | F827B32B137547D3005A87FE /* en */, 452 | ); 453 | name = MainWindow_iPhone.xib; 454 | sourceTree = ""; 455 | }; 456 | F827B331137547D3005A87FE /* MainWindow_iPad.xib */ = { 457 | isa = PBXVariantGroup; 458 | children = ( 459 | F827B332137547D3005A87FE /* en */, 460 | ); 461 | name = MainWindow_iPad.xib; 462 | sourceTree = ""; 463 | }; 464 | /* End PBXVariantGroup section */ 465 | 466 | /* Begin XCBuildConfiguration section */ 467 | F827B334137547D3005A87FE /* Debug */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 471 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 472 | GCC_C_LANGUAGE_STANDARD = gnu99; 473 | GCC_OPTIMIZATION_LEVEL = 0; 474 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 475 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 476 | GCC_VERSION = com.apple.compilers.llvmgcc42; 477 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 478 | GCC_WARN_UNUSED_VARIABLE = YES; 479 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 480 | SDKROOT = iphoneos; 481 | TARGETED_DEVICE_FAMILY = "1,2"; 482 | }; 483 | name = Debug; 484 | }; 485 | F827B335137547D3005A87FE /* Release */ = { 486 | isa = XCBuildConfiguration; 487 | buildSettings = { 488 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 489 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 490 | GCC_C_LANGUAGE_STANDARD = gnu99; 491 | GCC_VERSION = com.apple.compilers.llvmgcc42; 492 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 493 | GCC_WARN_UNUSED_VARIABLE = YES; 494 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 495 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 496 | SDKROOT = iphoneos; 497 | TARGETED_DEVICE_FAMILY = "1,2"; 498 | }; 499 | name = Release; 500 | }; 501 | F827B337137547D3005A87FE /* Debug */ = { 502 | isa = XCBuildConfiguration; 503 | buildSettings = { 504 | ALWAYS_SEARCH_USER_PATHS = NO; 505 | COPY_PHASE_STRIP = NO; 506 | GCC_DYNAMIC_NO_PIC = NO; 507 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 508 | GCC_PREFIX_HEADER = "Chat/Chat-Prefix.pch"; 509 | INFOPLIST_FILE = "Chat/Chat-Info.plist"; 510 | PRODUCT_NAME = "$(TARGET_NAME)"; 511 | WRAPPER_EXTENSION = app; 512 | }; 513 | name = Debug; 514 | }; 515 | F827B338137547D3005A87FE /* Release */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | ALWAYS_SEARCH_USER_PATHS = NO; 519 | COPY_PHASE_STRIP = YES; 520 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 521 | GCC_PREFIX_HEADER = "Chat/Chat-Prefix.pch"; 522 | INFOPLIST_FILE = "Chat/Chat-Info.plist"; 523 | PRODUCT_NAME = "$(TARGET_NAME)"; 524 | VALIDATE_PRODUCT = YES; 525 | WRAPPER_EXTENSION = app; 526 | }; 527 | name = Release; 528 | }; 529 | /* End XCBuildConfiguration section */ 530 | 531 | /* Begin XCConfigurationList section */ 532 | F827B30A137547D2005A87FE /* Build configuration list for PBXProject "Chat" */ = { 533 | isa = XCConfigurationList; 534 | buildConfigurations = ( 535 | F827B334137547D3005A87FE /* Debug */, 536 | F827B335137547D3005A87FE /* Release */, 537 | ); 538 | defaultConfigurationIsVisible = 0; 539 | defaultConfigurationName = Release; 540 | }; 541 | F827B336137547D3005A87FE /* Build configuration list for PBXNativeTarget "Chat" */ = { 542 | isa = XCConfigurationList; 543 | buildConfigurations = ( 544 | F827B337137547D3005A87FE /* Debug */, 545 | F827B338137547D3005A87FE /* Release */, 546 | ); 547 | defaultConfigurationIsVisible = 0; 548 | }; 549 | /* End XCConfigurationList section */ 550 | }; 551 | rootObject = F827B307137547D2005A87FE /* Project object */; 552 | } 553 | -------------------------------------------------------------------------------- /Chat/Chat.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chat/Chat.xcodeproj/xcuserdata/honcheng.xcuserdatad/xcschemes/Chat.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Chat/Chat.xcodeproj/xcuserdata/honcheng.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Chat.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F827B30F137547D2005A87FE 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chat/Chat/Chat-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.honcheng.chat.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow_iPhone 31 | NSMainNibFile~ipad 32 | MainWindow_iPad 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIAppFonts 45 | 46 | HelveticaNeue.ttc 47 | 48 | UIPrerenderedIcon 49 | 50 | UIStatusBarStyle 51 | UIStatusBarStyleBlackOpaque 52 | 53 | 54 | -------------------------------------------------------------------------------- /Chat/Chat/Chat-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Chat' target in the 'Chat' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | 16 | #define SOCKETIO_HOST @"hostname.com" 17 | #define SOCKETIO_PORT 8888 18 | -------------------------------------------------------------------------------- /Chat/Chat/ChatAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatAppDelegate.h 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import 39 | #import "ChatViewController.h" 40 | 41 | @interface ChatAppDelegate : NSObject { 42 | ChatViewController *chatViewController; 43 | } 44 | 45 | @property (nonatomic, retain) ChatViewController *chatViewController; 46 | @property (nonatomic, retain) IBOutlet UIWindow *window; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Chat/Chat/ChatAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChatAppDelegate.m 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import "ChatAppDelegate.h" 39 | #import "CoreLocationManager.h" 40 | 41 | @interface UINavigationBar (CustomNavBar) 42 | @end 43 | @implementation UINavigationBar (CustomNavBar) 44 | - (void) drawRect:(CGRect)rect 45 | { 46 | CGContextRef context = UIGraphicsGetCurrentContext(); 47 | CGContextSetRGBFillColor(context, 0.3,0.3,0.3,1.0); 48 | CGContextFillRect(context, CGRectMake(0,0,self.frame.size.width,44)); 49 | } 50 | @end 51 | 52 | @implementation ChatAppDelegate 53 | @synthesize chatViewController; 54 | 55 | @synthesize window=_window; 56 | 57 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 58 | { 59 | // Override point for customization after application launch. 60 | self.chatViewController = [[ChatViewController alloc] init]; 61 | UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.chatViewController]; 62 | [self.chatViewController release]; 63 | [self.window addSubview:navController.view]; 64 | 65 | [self.window setBackgroundColor:[UIColor blackColor]]; 66 | [self.window makeKeyAndVisible]; 67 | 68 | [self.chatViewController connect]; 69 | 70 | return YES; 71 | } 72 | 73 | - (void)applicationWillResignActive:(UIApplication *)application 74 | { 75 | /* 76 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 77 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 78 | */ 79 | } 80 | 81 | - (void)applicationDidEnterBackground:(UIApplication *)application 82 | { 83 | /* 84 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 85 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 86 | */ 87 | 88 | [self.chatViewController disconnect]; 89 | } 90 | 91 | - (void)applicationWillEnterForeground:(UIApplication *)application 92 | { 93 | /* 94 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 95 | */ 96 | [self.chatViewController connect]; 97 | } 98 | 99 | - (void)applicationDidBecomeActive:(UIApplication *)application 100 | { 101 | /* 102 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 103 | */ 104 | 105 | if (![CLLocationManager locationServicesEnabled]) 106 | { 107 | NSLog(@"User disabled location services"); 108 | } 109 | else 110 | { 111 | NSLog(@"User enabled location services"); 112 | [[CoreLocationManager defaultManager].locationManager startUpdatingLocation]; 113 | } 114 | } 115 | 116 | - (void)applicationWillTerminate:(UIApplication *)application 117 | { 118 | /* 119 | Called when the application is about to terminate. 120 | Save data if appropriate. 121 | See also applicationDidEnterBackground:. 122 | */ 123 | 124 | [self.chatViewController disconnect]; 125 | } 126 | 127 | - (void)dealloc 128 | { 129 | [self.chatViewController release]; 130 | [_window release]; 131 | [super dealloc]; 132 | } 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/ChatTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ConversationTableViewCell.h 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import 39 | #import "RTLabel.h" 40 | 41 | @interface ChatTableViewCell : UITableViewCell { 42 | RTLabel *contentLabel; 43 | } 44 | 45 | @property (nonatomic, retain) RTLabel *contentLabel; 46 | + (RTLabel*)label; 47 | - (void)setCellContent:(NSMutableDictionary*)content; 48 | @end 49 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/ChatTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ConversationTableViewCell.m 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import "ChatTableViewCell.h" 39 | 40 | 41 | @implementation ChatTableViewCell 42 | @synthesize contentLabel; 43 | 44 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 45 | { 46 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 47 | if (self) { 48 | // Initialization code 49 | self.contentLabel = [ChatTableViewCell label]; 50 | [self.contentView addSubview:self.contentLabel]; 51 | //[self.contentLabel setNumberOfLines:0]; 52 | 53 | [self setSelectionStyle:UITableViewCellSelectionStyleNone]; 54 | } 55 | return self; 56 | } 57 | 58 | - (void)setCellContent:(NSMutableDictionary*)content 59 | { 60 | [self.contentLabel setText:[content objectForKey:@"text"]]; 61 | 62 | CGRect frame = [self.contentLabel frame]; 63 | frame.size.height = [[content objectForKey:@"content_height"] intValue]; 64 | [self.contentLabel setFrame:frame]; 65 | } 66 | 67 | + (RTLabel*)label 68 | { 69 | RTLabel *label; 70 | if ([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad) 71 | { 72 | label = [[RTLabel alloc] initWithFrame:CGRectMake(10,5,768-20,100)]; 73 | [label setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:24]]; 74 | } 75 | else 76 | { 77 | label = [[RTLabel alloc] initWithFrame:CGRectMake(10,5,300,100)]; 78 | [label setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:16]]; 79 | } 80 | [label setTextColor:[UIColor colorWithWhite:0.4 alpha:1]]; 81 | [label setParagraphReplacement:@""]; 82 | 83 | NSMutableDictionary *linkAttributes = [NSMutableDictionary dictionary]; 84 | //[linkAttributes setObject:@"italic" forKey:@"style"]; 85 | [linkAttributes setObject:@"#111111" forKey:@"color"]; 86 | [linkAttributes setObject:@"HelveticaNeue-CondensedBold" forKey:@"face"]; 87 | [linkAttributes setObject:@"1" forKey:@"underline"]; 88 | 89 | NSMutableDictionary *selectedLinkAttributes = [NSMutableDictionary dictionary]; 90 | //[selectedLinkAttributes setObject:@"italic" forKey:@"style"]; 91 | [selectedLinkAttributes setObject:@"#333333" forKey:@"color"]; 92 | [selectedLinkAttributes setObject:@"HelveticaNeue-CondensedBold" forKey:@"face"]; 93 | [selectedLinkAttributes setObject:@"2" forKey:@"underline"]; 94 | 95 | [label setLinkAttributes:linkAttributes]; 96 | [label setSelectedLinkAttributes:selectedLinkAttributes]; 97 | 98 | return [label autorelease]; 99 | } 100 | 101 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 102 | { 103 | [super setSelected:selected animated:animated]; 104 | 105 | // Configure the view for the selected state 106 | } 107 | 108 | - (void)dealloc 109 | { 110 | [super dealloc]; 111 | } 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/ChatViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatViewController.h 3 | // TestSocketIO 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import 39 | #import "SocketIoClient.h" 40 | #import "JSONKit.h" 41 | #import "LoginViewController.h" 42 | #import "RTLabel.h" 43 | 44 | typedef enum 45 | { 46 | CellType_Status = 0, 47 | CellType_Chat = 1 48 | } CellType; 49 | 50 | @interface ChatViewController : UIViewController < RTLabelDelegate ,UITableViewDataSource, UITableViewDelegate,UITextFieldDelegate, SocketIoClientDelegate, LoginViewControllerDelegate>{ 51 | UITextField *inputField; 52 | UITableView *tableView; 53 | NSMutableArray *conversationArray; 54 | SocketIoClient *client; 55 | UIImageView *inputBarBg; 56 | BOOL hasLoggedIn; 57 | LoginViewController *loginViewController; 58 | UIBarButtonItem *loginButtonItem, *logoutButtonItem; 59 | } 60 | @property (nonatomic, retain) UITextField *inputField; 61 | @property (nonatomic, retain) UITableView *tableView; 62 | @property (nonatomic, retain) NSMutableArray *conversationArray; 63 | @property (nonatomic, retain) SocketIoClient *client; 64 | @property (nonatomic, retain) UIImageView *inputBarBg; 65 | @property (nonatomic, retain) LoginViewController *loginViewController; 66 | @property (nonatomic, retain) UIBarButtonItem *loginButtonItem, *logoutButtonItem; 67 | 68 | - (void)loginWithUsername:(NSString*)username password:(NSString*)password; 69 | - (void)connect; 70 | - (void)disconnect; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/ChatViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChatViewController.m 3 | // TestSocketIO 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import "ChatViewController.h" 39 | #import "LocationInfo.h" 40 | #import "CoreLocationManager.h" 41 | #import "ChatTableViewCell.h" 42 | #import "RTLabel.h" 43 | #import "WebViewController.h" 44 | #import "StatusTableViewCell.h" 45 | 46 | @interface ChatViewController() 47 | - (void)registerForKeyboardNotifications; 48 | - (void)unregisterForKeyboardNotifications; 49 | - (void)onLoginButtonPressed:(id)sender; 50 | - (void)onLogoutButtonPressed:(id)sender; 51 | - (void)checkInToLocation; 52 | @end 53 | 54 | @implementation ChatViewController 55 | @synthesize inputField, tableView, conversationArray, client; 56 | @synthesize inputBarBg, loginViewController, loginButtonItem, logoutButtonItem; 57 | 58 | #define INPUTFIELD_HEIGHT 44 59 | 60 | - (void)dealloc { 61 | 62 | [self.logoutButtonItem release]; 63 | [self.loginButtonItem release]; 64 | [self.loginViewController release]; 65 | [self.inputBarBg release]; 66 | [self.tableView release]; 67 | [self.conversationArray release]; 68 | [self.inputView release]; 69 | [self.client release]; 70 | [super dealloc]; 71 | } 72 | 73 | - (id)init 74 | { 75 | self = [super init]; 76 | if (self) 77 | { 78 | [self.view setBackgroundColor:[UIColor whiteColor]]; 79 | 80 | UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,150,30)]; 81 | [titleLabel setBackgroundColor:[UIColor clearColor]]; 82 | [titleLabel setTextColor:[UIColor whiteColor]]; 83 | [titleLabel setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:20]]; 84 | [titleLabel setText:@"ChatLah"]; 85 | [self.navigationItem setTitleView:titleLabel]; 86 | [titleLabel release]; 87 | [titleLabel setTextAlignment:UITextAlignmentCenter]; 88 | 89 | self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,[self.view bounds].size.width,[self.view bounds].size.height-INPUTFIELD_HEIGHT)]; 90 | [self.tableView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight]; 91 | [self.view addSubview:self.tableView]; 92 | [self.tableView release]; 93 | [self.tableView setDelegate:self]; 94 | [self.tableView setDataSource:self]; 95 | [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; 96 | 97 | self.inputBarBg = [[UIImageView alloc] initWithFrame:CGRectMake(0,self.tableView.frame.origin.y+self.tableView.frame.size.height,[self.view bounds].size.width,INPUTFIELD_HEIGHT)]; 98 | [self.inputBarBg setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleWidth]; 99 | [self.view addSubview:self.inputBarBg]; 100 | [self.inputBarBg release]; 101 | [self.inputBarBg setImage:[[UIImage imageNamed:@"input_bg.png"] stretchableImageWithLeftCapWidth:22 topCapHeight:22]]; 102 | [self.inputBarBg setUserInteractionEnabled:YES]; 103 | 104 | self.inputField = [[UITextField alloc] initWithFrame:CGRectMake(22,0,[self.view bounds].size.width-30,INPUTFIELD_HEIGHT)]; 105 | [self.inputBarBg addSubview:self.inputField]; 106 | [self.inputField release]; 107 | [self.inputField setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; 108 | [self.inputField setReturnKeyType:UIReturnKeySend]; 109 | [self.inputField setDelegate:self]; 110 | [self.inputField setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:20]]; 111 | [self.inputField setTextColor:[UIColor colorWithWhite:0.15 alpha:1]]; 112 | [self.inputField setClearButtonMode:UITextFieldViewModeWhileEditing]; 113 | [self.inputField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter]; 114 | [self.inputField setKeyboardAppearance:UIKeyboardAppearanceAlert]; 115 | 116 | UIButton *loginButton = [[UIButton alloc] initWithFrame:CGRectMake(0,0,61,36)]; 117 | [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 118 | [loginButton setTitleColor:[UIColor colorWithWhite:0.15 alpha:1] forState:UIControlStateHighlighted]; 119 | [loginButton setBackgroundImage:[[UIImage imageNamed:@"button_gray.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateNormal]; 120 | [loginButton setBackgroundImage:[[UIImage imageNamed:@"button_white.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateHighlighted]; 121 | [[loginButton titleLabel] setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:14]]; 122 | [loginButton setTitleEdgeInsets:UIEdgeInsetsMake(1, 0, 0, 0)]; 123 | self.loginButtonItem = [[UIBarButtonItem alloc] initWithCustomView:loginButton]; 124 | [loginButton release]; 125 | [loginButton setTitle:@"Login" forState:UIControlStateNormal]; 126 | [loginButton addTarget:self action:@selector(onLoginButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 127 | 128 | UIButton *logoutButton = [[UIButton alloc] initWithFrame:CGRectMake(0,0,61,36)]; 129 | [logoutButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 130 | [logoutButton setTitleColor:[UIColor colorWithWhite:0.15 alpha:1] forState:UIControlStateHighlighted]; 131 | [logoutButton setBackgroundImage:[[UIImage imageNamed:@"button_gray.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateNormal]; 132 | [logoutButton setBackgroundImage:[[UIImage imageNamed:@"button_white.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateHighlighted]; 133 | [[logoutButton titleLabel] setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:14]]; 134 | [logoutButton setTitleEdgeInsets:UIEdgeInsetsMake(1, 0, 0, 0)]; 135 | self.logoutButtonItem = [[UIBarButtonItem alloc] initWithCustomView:logoutButton]; 136 | [logoutButton release]; 137 | [logoutButton setTitle:@"Logout" forState:UIControlStateNormal]; 138 | [logoutButton addTarget:self action:@selector(onLogoutButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 139 | 140 | self.conversationArray = [NSMutableArray array]; 141 | 142 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onLocationUpdated:) name:@"kNotif_NewLocationUpdated" object:nil]; 143 | 144 | } 145 | return self; 146 | } 147 | 148 | #pragma mark connection 149 | 150 | - (void)connect 151 | { 152 | if (!self.client) 153 | { 154 | self.client = [[SocketIoClient alloc] initWithHost:SOCKETIO_HOST port:SOCKETIO_PORT]; 155 | [self.client setDelegate:self]; 156 | } 157 | [self.client connect]; 158 | } 159 | 160 | - (void)disconnect 161 | { 162 | [self.client disconnect]; 163 | } 164 | 165 | - (void)loginWithUsername:(NSString*)username password:(NSString*)password 166 | { 167 | 168 | 169 | NSMutableDictionary *command = [NSMutableDictionary dictionary]; 170 | [command setObject:@"login" forKey:@"command"]; 171 | [command setObject:username forKey:@"username"]; 172 | [command setObject:password forKey:@"password"]; 173 | 174 | NSString *commandString = [command JSONString]; //[self.jsonParser stringWithObject:command]; 175 | [client send:commandString isJSON:NO]; 176 | //[client send:@"Hello Socket.IO" isJSON:NO]; 177 | } 178 | 179 | - (void)viewWillDisappear:(BOOL)animated 180 | { 181 | [self unregisterForKeyboardNotifications]; 182 | } 183 | 184 | - (void)viewWillAppear:(BOOL)animated 185 | { 186 | [self registerForKeyboardNotifications]; 187 | if (!hasLoggedIn) 188 | { 189 | //[self onLoginButtonPressed:nil]; 190 | } 191 | } 192 | 193 | #pragma mark login/logout 194 | 195 | - (void)onLoginButtonPressed:(id)sender 196 | { 197 | if (!self.loginViewController) 198 | { 199 | self.loginViewController = [[LoginViewController alloc] init]; 200 | [self.loginViewController setDelegate:self]; 201 | } 202 | UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.loginViewController]; 203 | 204 | if ([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad) 205 | { 206 | [navController setModalPresentationStyle:UIModalPresentationFormSheet]; 207 | } 208 | 209 | [self.navigationController presentModalViewController:navController animated:YES]; 210 | 211 | } 212 | 213 | - (void)onLogoutButtonPressed:(id)sender 214 | { 215 | NSMutableDictionary *command = [NSMutableDictionary dictionary]; 216 | [command setObject:@"message" forKey:@"command"]; 217 | [command setObject:@"/logout" forKey:@"message"]; 218 | NSString *commandString = [command JSONString]; //[jsonParser stringWithObject:command]; 219 | [self.client send:commandString isJSON:NO]; 220 | 221 | [self.navigationItem setRightBarButtonItem:loginButtonItem animated:YES]; 222 | } 223 | 224 | - (BOOL)textFieldShouldReturn:(UITextField *)textField 225 | { 226 | if (hasLoggedIn) 227 | { 228 | NSString *text = [textField text]; 229 | 230 | NSMutableDictionary *command = [NSMutableDictionary dictionary]; 231 | [command setObject:@"message" forKey:@"command"]; 232 | [command setObject:text forKey:@"message"]; 233 | NSString *commandString = [command JSONString]; //[jsonParser stringWithObject:command]; 234 | [self.client send:commandString isJSON:NO]; 235 | 236 | [textField setText:@""]; 237 | } 238 | else 239 | { 240 | UIAlertView *alertView = [[UIAlertView alloc] init]; 241 | [alertView setTitle:@"Login required"]; 242 | [alertView addButtonWithTitle:@"OK"]; 243 | [alertView show]; 244 | [alertView release]; 245 | } 246 | 247 | 248 | return YES; 249 | } 250 | 251 | #pragma mark location 252 | 253 | - (void)onLocationUpdated:(NSNotification*)note 254 | { 255 | [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(checkInToLocation) object:nil]; 256 | [self performSelector:@selector(checkInToLocation) withObject:nil afterDelay:3]; 257 | } 258 | 259 | - (void)checkInToLocation 260 | { 261 | LocationInfo *locationInfo = [[CoreLocationManager defaultManager] locationInfo]; 262 | if ([locationInfo locAvailable]) 263 | { 264 | NSString *checkinString = [NSString stringWithFormat:@"%f,%f", locationInfo.coordinate.latitude, locationInfo.coordinate.longitude]; 265 | 266 | NSMutableDictionary *command = [NSMutableDictionary dictionary]; 267 | [command setObject:@"checkin" forKey:@"command"]; 268 | [command setObject:checkinString forKey:@"latlng"]; 269 | NSString *commandString = [command JSONString];//[jsonParser stringWithObject:command]; 270 | [self.client send:commandString isJSON:NO]; 271 | } 272 | } 273 | 274 | #pragma mark socket IO delegates 275 | 276 | - (void)socketIoClientDidConnect:(SocketIoClient *)client 277 | { 278 | NSLog(@"Connected."); 279 | 280 | if (hasLoggedIn) 281 | { 282 | [self.navigationItem setRightBarButtonItem:logoutButtonItem animated:YES]; 283 | } 284 | else 285 | { 286 | [self.navigationItem setRightBarButtonItem:loginButtonItem animated:YES]; 287 | } 288 | 289 | NSString *text = @">>>> connected"; 290 | NSMutableDictionary *newContent = [NSMutableDictionary dictionary]; 291 | [newContent setObject:text forKey:@"text"]; 292 | [self.conversationArray addObject:newContent]; 293 | [self.tableView reloadData]; 294 | [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[self.conversationArray count]-1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; 295 | 296 | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"username"] && [[NSUserDefaults standardUserDefaults] objectForKey:@"password"]) 297 | { 298 | NSString *username = [[NSUserDefaults standardUserDefaults] objectForKey:@"username"]; 299 | NSString *password = [[NSUserDefaults standardUserDefaults] objectForKey:@"password"]; 300 | [self loginWithUsername:username password:password]; 301 | } 302 | 303 | } 304 | 305 | - (void)socketIoClientDidDisconnect:(SocketIoClient *)client 306 | { 307 | NSLog(@"Disconnected."); 308 | 309 | NSString *text = @">>>> disconnected"; 310 | NSMutableDictionary *newContent = [NSMutableDictionary dictionary]; 311 | [newContent setObject:text forKey:@"text"]; 312 | [self.conversationArray addObject:newContent]; 313 | [self.tableView reloadData]; 314 | 315 | 316 | [self.navigationItem setRightBarButtonItem:nil]; 317 | [self.client connect]; 318 | } 319 | 320 | - (void)socketIoClient:(SocketIoClient *)client didReceiveMessage:(NSString *)message isJSON:(BOOL)isJSON 321 | { 322 | NSLog(@"Received: %@", message); 323 | if (message) 324 | { 325 | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"username"]) 326 | { 327 | NSString *loginMessage = [NSString stringWithFormat:@"%@ meow meow!", [[NSUserDefaults standardUserDefaults] objectForKey:@"username"]]; 328 | if ([message rangeOfString:loginMessage].location!=NSNotFound) 329 | { 330 | hasLoggedIn = YES; 331 | if (self.navigationController.visibleViewController==self.loginViewController) 332 | { 333 | [self.loginViewController connected]; 334 | } 335 | 336 | [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(checkInToLocation) object:nil]; 337 | [self performSelector:@selector(checkInToLocation) withObject:nil afterDelay:6]; 338 | 339 | if (self.navigationController.visibleViewController==self) 340 | { 341 | [inputField becomeFirstResponder]; 342 | } 343 | 344 | 345 | [self.navigationItem setRightBarButtonItem:logoutButtonItem animated:YES]; 346 | } 347 | } 348 | 349 | NSArray *words = [message componentsSeparatedByString:@" "]; 350 | BOOL isSpeech = NO; 351 | for (NSString *word in words) 352 | { 353 | if ([word rangeOfString:@"@"].location==0) 354 | { 355 | isSpeech = YES; 356 | NSString *newWord = [NSString stringWithFormat:@"%@", word]; 357 | message = [message stringByReplacingOccurrencesOfString:word withString:newWord]; 358 | } 359 | } 360 | 361 | // parse iframe 362 | if ([message rangeOfString:@""].location+2; 367 | 368 | NSString *link = nil; 369 | NSString *iframe = [message substringWithRange:NSMakeRange(start, end)]; 370 | if ([iframe rangeOfString:@"src"].location!=NSNotFound) 371 | { 372 | NSArray *parts = [iframe componentsSeparatedByString:@" "]; 373 | for (NSString *part in parts) 374 | { 375 | if ([part rangeOfString:@"src"].location!=NSNotFound) 376 | { 377 | NSArray *moreparts = [part componentsSeparatedByString:@"'"]; 378 | link = [moreparts objectAtIndex:1]; 379 | } 380 | } 381 | } 382 | if (link) 383 | { 384 | NSString *newLink = [NSString stringWithFormat:@"%@", link, link]; 385 | message = [message stringByReplacingOccurrencesOfString:iframe withString:newLink]; 386 | } 387 | } 388 | 389 | /* 390 | if (!isSpeech) 391 | { 392 | if ([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad) 393 | { 394 | message = [NSString stringWithFormat:@"%@", message]; 395 | } 396 | else 397 | { 398 | message = [NSString stringWithFormat:@"%@", message]; 399 | } 400 | 401 | }*/ 402 | 403 | 404 | NSMutableDictionary *newContent = [NSMutableDictionary dictionary]; 405 | [newContent setObject:message forKey:@"text"]; 406 | if (isSpeech) 407 | { 408 | [newContent setObject:[NSNumber numberWithInt:CellType_Chat] forKey:@"cell_type"]; 409 | } 410 | 411 | [self.conversationArray addObject:newContent]; 412 | [self.tableView reloadData]; 413 | [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[self.conversationArray count]-1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; 414 | } 415 | 416 | } 417 | 418 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 419 | // Overriden to allow any orientation. 420 | return YES; //UIInterfaceOrientationIsPortrait(interfaceOrientation); 421 | } 422 | 423 | 424 | - (void)didReceiveMemoryWarning { 425 | // Releases the view if it doesn't have a superview. 426 | [super didReceiveMemoryWarning]; 427 | 428 | // Release any cached data, images, etc. that aren't in use. 429 | } 430 | 431 | 432 | - (void)viewDidUnload { 433 | [super viewDidUnload]; 434 | // Release any retained subviews of the main view. 435 | // e.g. self.myOutlet = nil; 436 | } 437 | 438 | #pragma mark keyboard 439 | 440 | - (void)keyboardWillShow:(NSNotification*)note 441 | { 442 | NSDictionary* info = [note userInfo]; 443 | NSTimeInterval animationDuration; 444 | UIViewAnimationCurve animationCurve; 445 | CGRect keyboardEndFrame; 446 | 447 | [[info objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&animationCurve]; 448 | [[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; 449 | [[info objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardEndFrame]; 450 | keyboardEndFrame = [self.view convertRect:keyboardEndFrame fromView:nil]; 451 | 452 | [UIView beginAnimations:nil context:nil]; 453 | [UIView setAnimationDuration:animationDuration]; 454 | [UIView setAnimationCurve:animationCurve]; 455 | 456 | [self.tableView setScrollIndicatorInsets:UIEdgeInsetsMake(0, 0, keyboardEndFrame.size.height, 0)]; 457 | [self.tableView setContentInset:UIEdgeInsetsMake(0, 0, keyboardEndFrame.size.height, 0)]; 458 | [self.inputBarBg setTransform:CGAffineTransformMakeTranslation(0, -1*keyboardEndFrame.size.height)]; 459 | 460 | [UIView commitAnimations]; 461 | } 462 | 463 | - (void)keyboardWillBeHidden:(NSNotification*)note 464 | { 465 | NSDictionary* info = [note userInfo]; 466 | NSTimeInterval animationDuration; 467 | UIViewAnimationCurve animationCurve; 468 | [[info objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&animationCurve]; 469 | [[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; 470 | 471 | [UIView beginAnimations:nil context:nil]; 472 | [UIView setAnimationCurve:animationCurve]; 473 | [UIView setAnimationDuration:animationDuration]; 474 | 475 | [self.tableView setScrollIndicatorInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; 476 | [self.tableView setContentInset:UIEdgeInsetsMake(0, 0, 0, 0)]; 477 | [self.inputBarBg setTransform:CGAffineTransformMakeTranslation(0,0)]; 478 | [UIView commitAnimations]; 479 | } 480 | 481 | - (void)registerForKeyboardNotifications 482 | { 483 | [[NSNotificationCenter defaultCenter] addObserver:self 484 | selector:@selector(keyboardWillShow:) 485 | name:UIKeyboardWillShowNotification object:nil]; 486 | 487 | [[NSNotificationCenter defaultCenter] addObserver:self 488 | selector:@selector(keyboardWillBeHidden:) 489 | name:UIKeyboardWillHideNotification object:nil]; 490 | 491 | } 492 | 493 | - (void)unregisterForKeyboardNotifications 494 | { 495 | [[NSNotificationCenter defaultCenter] removeObserver:self 496 | name:UIKeyboardWillShowNotification object:nil]; 497 | 498 | [[NSNotificationCenter defaultCenter] removeObserver:self 499 | name:UIKeyboardWillHideNotification object:nil]; 500 | 501 | } 502 | 503 | #pragma mark table view 504 | 505 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 506 | { 507 | return [self.conversationArray count]; 508 | } 509 | 510 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 511 | { 512 | NSMutableDictionary *info = [self.conversationArray objectAtIndex:indexPath.row]; 513 | CellType cellType = [[info objectForKey:@"cell_type"] intValue]; 514 | if ([info objectForKey:@"content_height"]) 515 | { 516 | return [[info objectForKey:@"content_height"] intValue] + 10; 517 | } 518 | else 519 | { 520 | RTLabel *label; 521 | if (cellType==CellType_Chat) 522 | { 523 | label = [ChatTableViewCell label]; 524 | } 525 | else 526 | { 527 | label = [StatusTableViewCell label]; 528 | } 529 | //CGSize optimumSize = [[info objectForKey:@"text"] sizeWithFont:label.font constrainedToSize:CGSizeMake(label.frame.size.width,1000)]; 530 | [label setText:[info objectForKey:@"text"]]; 531 | CGSize optimumSize = [label optimumSize]; 532 | [info setObject:[NSNumber numberWithInt:optimumSize.height+5] forKey:@"content_height"]; 533 | //NSLog(@".%@........ %i",[info objectForKey:@"text"], [[info objectForKey:@"content_height"] intValue] + 10); 534 | return [[info objectForKey:@"content_height"] intValue] + 10; 535 | 536 | } 537 | } 538 | 539 | - (UITableViewCell*)tableView:(UITableView *)tableView_ cellForRowAtIndexPath:(NSIndexPath *)indexPath 540 | { 541 | NSMutableDictionary *info = [self.conversationArray objectAtIndex:indexPath.row]; 542 | CellType cellType = [[info objectForKey:@"cell_type"] intValue]; 543 | if (cellType==CellType_Chat) 544 | { 545 | static NSString *identifier = @"ChatTableViewCell"; 546 | ChatTableViewCell *cell = (ChatTableViewCell*)[tableView dequeueReusableCellWithIdentifier:identifier]; 547 | if (!cell) 548 | { 549 | cell = [[ChatTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; 550 | [cell.contentLabel setDelegate:self]; 551 | } 552 | 553 | [cell setCellContent:info]; 554 | return cell; 555 | } 556 | else 557 | { 558 | static NSString *identifier = @"StatusTableViewCell"; 559 | StatusTableViewCell *cell = (StatusTableViewCell*)[tableView dequeueReusableCellWithIdentifier:identifier]; 560 | if (!cell) 561 | { 562 | cell = [[StatusTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; 563 | [cell.contentLabel setDelegate:self]; 564 | } 565 | 566 | [cell setCellContent:info]; 567 | return cell; 568 | } 569 | 570 | 571 | } 572 | 573 | - (void)rtLabel:(id)rtLabel didSelectLinkWithURL:(NSURL*)url 574 | { 575 | NSString *urlString = [url absoluteString]; 576 | if ([urlString rangeOfString:@"http"].location==NSNotFound) 577 | { 578 | urlString = [NSString stringWithFormat:@"http://take.my/chattodo/%@", urlString]; 579 | } 580 | WebViewController *webViewController = [[WebViewController alloc] init]; 581 | [webViewController.titleLabel setText:urlString]; 582 | [webViewController.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]]; 583 | if ([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad) 584 | { 585 | UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:webViewController]; 586 | [navController setModalPresentationStyle:UIModalPresentationFormSheet]; 587 | [self.navigationController presentModalViewController:navController animated:YES]; 588 | } 589 | else 590 | { 591 | [self.navigationController pushViewController:webViewController animated:YES]; 592 | } 593 | 594 | } 595 | 596 | @end 597 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/GenericViewController.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Muh Hon Cheng 3 | * Created by honcheng on 12/11/10. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject 11 | * to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 17 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 18 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 20 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 25 | * IN CONNECTION WITH THE SOFTWARE OR 26 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | * @author Muh Hon Cheng 29 | * @copyright 2011 Muh Hon Cheng 30 | * @version 31 | * 32 | */ 33 | 34 | #import 35 | 36 | 37 | @interface GenericViewController : UIViewController { 38 | UILabel *titleLabel; 39 | } 40 | @property (nonatomic, retain) UILabel *titleLabel; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/GenericViewController.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Muh Hon Cheng 3 | * Created by honcheng on 12/11/10. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject 11 | * to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 17 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 18 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 20 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 25 | * IN CONNECTION WITH THE SOFTWARE OR 26 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | * @author Muh Hon Cheng 29 | * @copyright 2011 Muh Hon Cheng 30 | * @version 31 | * 32 | */ 33 | 34 | #import "GenericViewController.h" 35 | 36 | 37 | @implementation GenericViewController 38 | @synthesize titleLabel; 39 | 40 | - (id)init 41 | { 42 | self = [super init]; 43 | if (self) 44 | { 45 | 46 | self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,150,30)]; 47 | [self.titleLabel setBackgroundColor:[UIColor clearColor]]; 48 | [self.titleLabel setTextColor:[UIColor whiteColor]]; 49 | [self.titleLabel setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:20]]; 50 | [self.navigationItem setTitleView:self.titleLabel]; 51 | [self.titleLabel release]; 52 | [self.titleLabel setTextAlignment:UITextAlignmentCenter]; 53 | 54 | UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0,0,60,40)]; 55 | [backButton setBackgroundImage:[UIImage imageNamed:@"back_button.png"] forState:UIControlStateNormal]; 56 | [backButton setTitle:@"Back" forState:UIControlStateNormal]; 57 | [[backButton titleLabel] setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:12]]; 58 | [backButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)]; 59 | UIBarButtonItem *backButtonitem = [[UIBarButtonItem alloc] initWithCustomView:backButton]; 60 | [backButton release]; 61 | [self.navigationItem setLeftBarButtonItem:backButtonitem]; 62 | [backButtonitem release]; 63 | [backButton addTarget:self action:@selector(onBackButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 64 | [backButton setAutoresizingMask:UIViewAutoresizingFlexibleHeight]; 65 | } 66 | return self; 67 | } 68 | 69 | - (void)onBackButtonPressed:(id)sender 70 | { 71 | [self.navigationController popViewControllerAnimated:YES]; 72 | } 73 | 74 | /* 75 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 76 | - (void)loadView { 77 | } 78 | */ 79 | 80 | /* 81 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 82 | - (void)viewDidLoad { 83 | [super viewDidLoad]; 84 | } 85 | */ 86 | 87 | 88 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 89 | // Overriden to allow any orientation. 90 | return YES; 91 | } 92 | 93 | 94 | - (void)didReceiveMemoryWarning { 95 | // Releases the view if it doesn't have a superview. 96 | [super didReceiveMemoryWarning]; 97 | 98 | // Release any cached data, images, etc. that aren't in use. 99 | } 100 | 101 | 102 | - (void)viewDidUnload { 103 | [super viewDidUnload]; 104 | // Release any retained subviews of the main view. 105 | // e.g. self.myOutlet = nil; 106 | } 107 | 108 | 109 | - (void)dealloc { 110 | [self.titleLabel release]; 111 | [super dealloc]; 112 | } 113 | 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/LoginViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.h 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | #import 38 | 39 | @protocol LoginViewControllerDelegate 40 | - (void)loginWithUsername:(NSString*)username password:(NSString*)password; 41 | @end 42 | 43 | @interface LoginViewController : UIViewController { 44 | UITextField *usernameField, *passwordField; 45 | id delegate; 46 | UIActivityIndicatorView *activityIndicatorView; 47 | UIBarButtonItem *activityButtonItem, *loginButtonItem; 48 | } 49 | 50 | @property (nonatomic, retain) UIBarButtonItem *activityButtonItem, *loginButtonItem; 51 | @property (nonatomic, retain) UIActivityIndicatorView *activityIndicatorView; 52 | @property (nonatomic, assign) id delegate; 53 | @property (nonatomic, retain) UITextField *usernameField, *passwordField; 54 | - (void)connected; 55 | @end 56 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/LoginViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.m 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import "LoginViewController.h" 39 | 40 | @implementation LoginViewController 41 | @synthesize usernameField, passwordField, delegate; 42 | @synthesize activityIndicatorView; 43 | @synthesize activityButtonItem, loginButtonItem; 44 | 45 | - (void)dealloc 46 | { 47 | [self.loginButtonItem release]; 48 | [self.activityButtonItem release]; 49 | [self.activityIndicatorView release]; 50 | [self.usernameField release]; 51 | [self.passwordField release]; 52 | [super dealloc]; 53 | } 54 | 55 | - (id)init 56 | { 57 | self = [super init]; 58 | if (self) { 59 | // Custom initialization 60 | 61 | [self.view setBackgroundColor:[UIColor colorWithWhite:0.5 alpha:1]]; 62 | 63 | UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,150,30)]; 64 | [titleLabel setBackgroundColor:[UIColor clearColor]]; 65 | [titleLabel setTextColor:[UIColor whiteColor]]; 66 | [titleLabel setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:20]]; 67 | [titleLabel setText:@"ChatLah"]; 68 | [self.navigationItem setTitleView:titleLabel]; 69 | [titleLabel release]; 70 | [titleLabel setTextAlignment:UITextAlignmentCenter]; 71 | 72 | UIButton *loginButton = [[UIButton alloc] initWithFrame:CGRectMake(0,0,61,36)]; 73 | [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 74 | [loginButton setTitleColor:[UIColor colorWithWhite:0.15 alpha:1] forState:UIControlStateHighlighted]; 75 | [loginButton setTitle:@"Login" forState:UIControlStateNormal]; 76 | [loginButton setBackgroundImage:[[UIImage imageNamed:@"button_black.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateNormal]; 77 | [loginButton setBackgroundImage:[[UIImage imageNamed:@"button_white.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateHighlighted]; 78 | [[loginButton titleLabel] setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:14]]; 79 | [loginButton setTitleEdgeInsets:UIEdgeInsetsMake(1, 0, 0, 0)]; 80 | self.loginButtonItem = [[UIBarButtonItem alloc] initWithCustomView:loginButton]; 81 | [loginButton release]; 82 | [self.navigationItem setRightBarButtonItem:self.loginButtonItem]; 83 | [loginButton addTarget:self action:@selector(onLoginButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 84 | 85 | UIButton *cancelButton = [[UIButton alloc] initWithFrame:CGRectMake(0,0,61,36)]; 86 | [cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 87 | [cancelButton setTitleColor:[UIColor colorWithWhite:0.15 alpha:1] forState:UIControlStateHighlighted]; 88 | [cancelButton setTitle:@"Cancel" forState:UIControlStateNormal]; 89 | [cancelButton setBackgroundImage:[[UIImage imageNamed:@"button_gray.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateNormal]; 90 | [cancelButton setBackgroundImage:[[UIImage imageNamed:@"button_white.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateHighlighted]; 91 | [[cancelButton titleLabel] setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:14]]; 92 | [cancelButton setTitleEdgeInsets:UIEdgeInsetsMake(1, 0, 0, 0)]; 93 | UIBarButtonItem *cancelButtonItem = [[UIBarButtonItem alloc] initWithCustomView:cancelButton]; 94 | [cancelButton release]; 95 | [self.navigationItem setLeftBarButtonItem:cancelButtonItem]; 96 | [cancelButton addTarget:self action:@selector(onCancelButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 97 | 98 | 99 | self.activityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0,0,20,20)]; 100 | [self.activityIndicatorView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite]; 101 | self.activityButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.activityIndicatorView]; 102 | [self.activityIndicatorView release]; 103 | 104 | self.usernameField = [[UITextField alloc] initWithFrame:CGRectMake(20,50,[self.view bounds].size.width-40,40)]; 105 | [self.usernameField setBorderStyle:UITextBorderStyleRoundedRect]; 106 | [self.usernameField setReturnKeyType:UIReturnKeyNext]; 107 | [self.usernameField setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:16]]; 108 | [self.view addSubview:self.usernameField]; 109 | [self.usernameField release]; 110 | [self.usernameField setContentVerticalAlignment:UIControlContentHorizontalAlignmentCenter]; 111 | [self.usernameField setClearButtonMode:UITextFieldViewModeWhileEditing]; 112 | [self.usernameField setPlaceholder:@"Title"]; 113 | [self.usernameField setKeyboardAppearance:UIKeyboardAppearanceAlert]; 114 | [self.usernameField setDelegate:self]; 115 | [self.usernameField setTextColor:[UIColor colorWithWhite:0.15 alpha:1]]; 116 | [self.usernameField setAutocorrectionType:UITextAutocorrectionTypeNo]; 117 | [self.usernameField setAutocapitalizationType:UITextAutocapitalizationTypeNone]; 118 | [self.usernameField setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; 119 | 120 | self.passwordField = [[UITextField alloc] initWithFrame:CGRectMake(20,100,[self.view bounds].size.width-40,40)]; 121 | [self.passwordField setBorderStyle:UITextBorderStyleRoundedRect]; 122 | [self.passwordField setReturnKeyType:UIReturnKeyDone]; 123 | [self.passwordField setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:16]]; 124 | [self.view addSubview:self.passwordField]; 125 | [self.passwordField release]; 126 | [self.passwordField setContentVerticalAlignment:UIControlContentHorizontalAlignmentCenter]; 127 | [self.passwordField setClearButtonMode:UITextFieldViewModeWhileEditing]; 128 | [self.passwordField setPlaceholder:@"Subtitle"]; 129 | [self.passwordField setKeyboardAppearance:UIKeyboardAppearanceAlert]; 130 | [self.passwordField setDelegate:self]; 131 | [self.passwordField setSecureTextEntry:YES]; 132 | [self.passwordField setTextColor:[UIColor colorWithWhite:0.15 alpha:1]]; 133 | [self.passwordField setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; 134 | 135 | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"username"]) 136 | { 137 | [self.usernameField setText:[[NSUserDefaults standardUserDefaults] objectForKey:@"username"]]; 138 | } 139 | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"password"]) 140 | { 141 | [self.passwordField setText:[[NSUserDefaults standardUserDefaults] objectForKey:@"password"]]; 142 | } 143 | 144 | } 145 | 146 | return self; 147 | } 148 | 149 | - (void)onCancelButtonPressed:(id)sender 150 | { 151 | [self.navigationController dismissModalViewControllerAnimated:YES]; 152 | } 153 | 154 | - (void)onLoginButtonPressed:(id)sender 155 | { 156 | NSString *username = [self.usernameField text]; 157 | NSString *password = [self.passwordField text]; 158 | 159 | if ([username length]>0 && [password length]>0) 160 | { 161 | [self.activityIndicatorView startAnimating]; 162 | [self.navigationItem setRightBarButtonItem:self.activityButtonItem]; 163 | [self.usernameField resignFirstResponder]; 164 | [self.passwordField resignFirstResponder]; 165 | 166 | NSString *username = [self.usernameField text]; 167 | [[NSUserDefaults standardUserDefaults] setObject:username forKey:@"username"]; 168 | [[NSUserDefaults standardUserDefaults] synchronize]; 169 | 170 | [delegate loginWithUsername:username password:password]; 171 | } 172 | else 173 | { 174 | UIAlertView *alertView = [[UIAlertView alloc] init]; 175 | [alertView setTitle:@"Missing required field"]; 176 | [alertView setMessage:@"Please enter a username and password"]; 177 | [alertView addButtonWithTitle:@"OK"]; 178 | [alertView show]; 179 | [alertView release]; 180 | } 181 | } 182 | 183 | - (void)connected 184 | { 185 | [self.activityIndicatorView stopAnimating]; 186 | [self.navigationItem setRightBarButtonItem:self.loginButtonItem]; 187 | 188 | NSString *username = [self.usernameField text]; 189 | NSString *password = [self.passwordField text]; 190 | [[NSUserDefaults standardUserDefaults] setObject:username forKey:@"username"]; 191 | [[NSUserDefaults standardUserDefaults] setObject:password forKey:@"password"]; 192 | [[NSUserDefaults standardUserDefaults] synchronize]; 193 | 194 | [self.navigationController dismissModalViewControllerAnimated:YES]; 195 | } 196 | 197 | - (void)viewWillAppear:(BOOL)animated 198 | { 199 | [self.usernameField becomeFirstResponder]; 200 | 201 | /* 202 | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"username"] && [[NSUserDefaults standardUserDefaults] objectForKey:@"password"]) 203 | { 204 | [self onLoginButtonPressed:nil]; 205 | }*/ 206 | } 207 | 208 | - (BOOL)textFieldShouldReturn:(UITextField *)textField 209 | { 210 | if (textField==self.usernameField) 211 | { 212 | [self.passwordField becomeFirstResponder]; 213 | } 214 | else 215 | { 216 | [self onLoginButtonPressed:textField]; 217 | } 218 | return YES; 219 | } 220 | 221 | - (void)didReceiveMemoryWarning 222 | { 223 | // Releases the view if it doesn't have a superview. 224 | [super didReceiveMemoryWarning]; 225 | 226 | // Release any cached data, images, etc that aren't in use. 227 | } 228 | 229 | #pragma mark - View lifecycle 230 | 231 | /* 232 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 233 | - (void)loadView 234 | { 235 | } 236 | */ 237 | 238 | /* 239 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 240 | - (void)viewDidLoad 241 | { 242 | [super viewDidLoad]; 243 | } 244 | */ 245 | 246 | - (void)viewDidUnload 247 | { 248 | [super viewDidUnload]; 249 | // Release any retained subviews of the main view. 250 | // e.g. self.myOutlet = nil; 251 | } 252 | 253 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 254 | { 255 | // Return YES for supported orientations 256 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 257 | } 258 | 259 | @end 260 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/StatusTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // StatusTableViewCell.h 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import 39 | #import "RTLabel.h" 40 | 41 | @interface StatusTableViewCell : UITableViewCell { 42 | RTLabel *contentLabel; 43 | //UIImageView *typeIndicatorView; 44 | } 45 | 46 | @property (nonatomic, retain) RTLabel *contentLabel; 47 | + (RTLabel*)label; 48 | - (void)setCellContent:(NSMutableDictionary*)content; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/StatusTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // StatusTableViewCell.m 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import "StatusTableViewCell.h" 39 | 40 | 41 | @implementation StatusTableViewCell 42 | @synthesize contentLabel; 43 | 44 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 45 | { 46 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 47 | if (self) { 48 | // Initialization code 49 | self.contentLabel = [StatusTableViewCell label]; 50 | [self.contentView addSubview:self.contentLabel]; 51 | //[self.contentLabel setNumberOfLines:0]; 52 | /* 53 | typeIndicatorView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,10,30)]; 54 | [typeIndicatorView setBackgroundColor:[UIColor colorWithWhite:0.8 alpha:1]]; 55 | [self.contentView addSubview:typeIndicatorView]; 56 | [typeIndicatorView release]; 57 | */ 58 | //[self.contentView setBackgroundColor:[UIColor colorWithWhite:0.5 alpha:1]]; 59 | [self setSelectionStyle:UITableViewCellSelectionStyleNone]; 60 | } 61 | return self; 62 | } 63 | 64 | - (void)setCellContent:(NSMutableDictionary*)content 65 | { 66 | [self.contentLabel setText:[content objectForKey:@"text"]]; 67 | 68 | CGRect frame = [self.contentLabel frame]; 69 | frame.size.height = [[content objectForKey:@"content_height"] intValue]; 70 | [self.contentLabel setFrame:frame]; 71 | 72 | 73 | } 74 | 75 | - (void)layoutSubviews 76 | { 77 | [super layoutSubviews]; 78 | 79 | /* 80 | CGRect frame2 = [typeIndicatorView frame]; 81 | frame2.size.height = self.frame.size.height; 82 | [typeIndicatorView setFrame:frame2];*/ 83 | } 84 | 85 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 86 | { 87 | [super setSelected:selected animated:animated]; 88 | 89 | // Configure the view for the selected state 90 | } 91 | 92 | - (void)dealloc 93 | { 94 | [super dealloc]; 95 | } 96 | 97 | + (RTLabel*)label 98 | { 99 | RTLabel *label; 100 | if ([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad) 101 | { 102 | label = [[RTLabel alloc] initWithFrame:CGRectMake(10,5,768-20,100)]; 103 | [label setFont:[UIFont fontWithName:@"HelveticaNeue-Italic" size:20]]; 104 | } 105 | else 106 | { 107 | label = [[RTLabel alloc] initWithFrame:CGRectMake(10,5,300,100)]; 108 | [label setFont:[UIFont fontWithName:@"HelveticaNeue-Italic" size:14]]; 109 | } 110 | [label setTextColor:[UIColor colorWithWhite:0 alpha:1]]; 111 | 112 | NSMutableDictionary *linkAttributes = [NSMutableDictionary dictionary]; 113 | [linkAttributes setObject:@"#111111" forKey:@"color"]; 114 | [linkAttributes setObject:@"HelveticaNeue-Italic" forKey:@"face"]; 115 | [linkAttributes setObject:@"1" forKey:@"underline"]; 116 | 117 | NSMutableDictionary *selectedLinkAttributes = [NSMutableDictionary dictionary]; 118 | [selectedLinkAttributes setObject:@"#333333" forKey:@"color"]; 119 | [selectedLinkAttributes setObject:@"HelveticaNeue-Italic" forKey:@"face"]; 120 | [selectedLinkAttributes setObject:@"2" forKey:@"underline"]; 121 | 122 | [label setLinkAttributes:linkAttributes]; 123 | [label setSelectedLinkAttributes:selectedLinkAttributes]; 124 | 125 | return [label autorelease]; 126 | } 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/WebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WebViewController.h 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import 39 | #import "GenericViewController.h" 40 | 41 | @interface WebViewController : GenericViewController { 42 | UIWebView *webView; 43 | } 44 | @property (nonatomic, retain) UIWebView *webView; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Chat/Chat/ChatClient/WebViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WebViewController.m 3 | // Chat 4 | // 5 | /** 6 | * Copyright (c) 2010 Muh Hon Cheng 7 | * Created by honcheng on 1/6/11. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject 15 | * to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT 21 | * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR 24 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT 25 | * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 29 | * IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | * 32 | * @author Muh Hon Cheng 33 | * @copyright 2011 Muh Hon Cheng 34 | * @version 35 | * 36 | */ 37 | 38 | #import "WebViewController.h" 39 | 40 | 41 | @implementation WebViewController 42 | @synthesize webView; 43 | 44 | - (id)init 45 | { 46 | self = [super init]; 47 | if (self) { 48 | // Custom initialization 49 | 50 | self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,[self.view bounds].size.width,[self.view bounds].size.height)]; 51 | [self.webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight]; 52 | [self.view addSubview:self.webView]; 53 | [self.webView release]; 54 | 55 | if ([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad) 56 | { 57 | UIButton *doneButton = [[UIButton alloc] initWithFrame:CGRectMake(0,0,61,36)]; 58 | [doneButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 59 | [doneButton setTitleColor:[UIColor colorWithWhite:0.15 alpha:1] forState:UIControlStateHighlighted]; 60 | [doneButton setTitle:@"Done" forState:UIControlStateNormal]; 61 | [doneButton setBackgroundImage:[[UIImage imageNamed:@"button_black.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateNormal]; 62 | [doneButton setBackgroundImage:[[UIImage imageNamed:@"button_white.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:15] forState:UIControlStateHighlighted]; 63 | [[doneButton titleLabel] setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:14]]; 64 | [doneButton setTitleEdgeInsets:UIEdgeInsetsMake(1, 0, 0, 0)]; 65 | UIBarButtonItem *doneButtonItem = [[UIBarButtonItem alloc] initWithCustomView:doneButton]; 66 | [doneButton release]; 67 | [self.navigationItem setRightBarButtonItem:doneButtonItem]; 68 | [doneButton addTarget:self action:@selector(onDoneButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 69 | 70 | [self.navigationItem setLeftBarButtonItem:nil]; 71 | } 72 | } 73 | return self; 74 | } 75 | 76 | - (void)onDoneButtonPressed:(id)sender 77 | { 78 | [self.navigationController dismissModalViewControllerAnimated:YES]; 79 | } 80 | 81 | - (void)dealloc 82 | { 83 | [self.webView release]; 84 | [super dealloc]; 85 | } 86 | 87 | - (void)didReceiveMemoryWarning 88 | { 89 | // Releases the view if it doesn't have a superview. 90 | [super didReceiveMemoryWarning]; 91 | 92 | // Release any cached data, images, etc that aren't in use. 93 | } 94 | 95 | #pragma mark - View lifecycle 96 | 97 | /* 98 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 99 | - (void)loadView 100 | { 101 | } 102 | */ 103 | 104 | /* 105 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 106 | - (void)viewDidLoad 107 | { 108 | [super viewDidLoad]; 109 | } 110 | */ 111 | 112 | - (void)viewDidUnload 113 | { 114 | [super viewDidUnload]; 115 | // Release any retained subviews of the main view. 116 | // e.g. self.myOutlet = nil; 117 | } 118 | 119 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 120 | { 121 | // Return YES for supported orientations 122 | return YES; //(interfaceOrientation == UIInterfaceOrientationPortrait); 123 | } 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /Chat/Chat/Location/CoreLocationManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreLocationManager.h 3 | // Chat 4 | // 5 | // Created by honcheng on 10/26/09. 6 | // Copyright 2009 honcheng. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "LocationInfo.h" 12 | 13 | @protocol CoreLocationManagerDelegate 14 | @optional 15 | - (void)newLocationUpdate:(LocationInfo *)locationInfo; 16 | - (void)newLocationUpdateError:(NSString *)text; 17 | - (void)newError:(NSString *)text; 18 | @end 19 | 20 | @interface CoreLocationManager : NSObject { 21 | CLLocationManager *locationManager; 22 | id delegate; 23 | LocationInfo *locationInfo; 24 | } 25 | 26 | @property (nonatomic, retain) CLLocationManager *locationManager; 27 | @property (nonatomic, assign) id delegate; 28 | @property (nonatomic, retain) LocationInfo *locationInfo; 29 | 30 | + (CoreLocationManager *)defaultManager; 31 | 32 | - (void)locationManager:(CLLocationManager *)manager 33 | didUpdateToLocation:(CLLocation *)newLocation 34 | fromLocation:(CLLocation *)oldLocation; 35 | 36 | - (void)locationManager:(CLLocationManager *)manager 37 | didFailWithError:(NSError *)error; 38 | 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Chat/Chat/Location/CoreLocationManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // CoreLocationManager.m 3 | // LocationAlert 4 | // 5 | // Created by honcheng on 10/26/09. 6 | // Copyright 2009 honcheng. All rights reserved. 7 | // 8 | 9 | #import "CoreLocationManager.h" 10 | 11 | @implementation CoreLocationManager 12 | @synthesize locationManager, delegate; 13 | @synthesize locationInfo; 14 | 15 | static CoreLocationManager *defaultManager = nil; 16 | 17 | - (id) init { 18 | self = [super init]; 19 | if (self != nil) { 20 | self.locationManager = [[[CLLocationManager alloc] init] autorelease]; 21 | self.locationManager.delegate = self; 22 | [self.locationManager setDistanceFilter:500]; 23 | self.locationInfo = [[[LocationInfo alloc] init] autorelease]; 24 | } 25 | return self; 26 | } 27 | 28 | + (CoreLocationManager *)defaultManager { 29 | @synchronized(self) { 30 | if (defaultManager == nil) { 31 | [[self alloc] init]; // assignment not done here 32 | } 33 | } 34 | return defaultManager; 35 | } 36 | 37 | + (id)allocWithZone:(NSZone *)zone 38 | { 39 | @synchronized(self) 40 | { 41 | if (defaultManager==nil) 42 | { 43 | defaultManager = [super allocWithZone:zone]; 44 | return defaultManager; 45 | } 46 | } 47 | return nil; 48 | } 49 | 50 | - (id)copyWithZone:(NSZone *)zone 51 | { 52 | return self; 53 | } 54 | 55 | 56 | - (id)retain { 57 | return self; 58 | } 59 | 60 | - (unsigned)retainCount 61 | { 62 | return UINT_MAX; 63 | } 64 | 65 | - (void)release 66 | { 67 | } 68 | 69 | - (id)autorelease 70 | { 71 | return self; 72 | } 73 | 74 | - (void)dealloc { 75 | self.locationManager = nil; 76 | self.locationInfo = nil; 77 | [super dealloc]; 78 | } 79 | 80 | #pragma mark location delegate 81 | 82 | - (void)locationManager:(CLLocationManager *)manager 83 | didUpdateToLocation:(CLLocation *)newLocation 84 | fromLocation:(CLLocation *)oldLocation 85 | { 86 | if (oldLocation!=nil) 87 | { 88 | self.locationInfo.distance_travelled = [newLocation distanceFromLocation:oldLocation]; 89 | } 90 | else 91 | { 92 | self.locationInfo.distance_travelled = -1; 93 | } 94 | 95 | self.locationInfo.coordinate = newLocation.coordinate; 96 | self.locationInfo.altitude = newLocation.altitude; 97 | self.locationInfo.horizontal_accuracy = newLocation.horizontalAccuracy; 98 | self.locationInfo.vertical_accuracy = newLocation.verticalAccuracy; 99 | 100 | 101 | NSMutableString *eventText = [NSMutableString stringWithFormat:@"\nlatitude: %f\nlongitude: %f\naltitutde: %f",self.locationInfo.coordinate.latitude,self.locationInfo.coordinate.longitude,self.locationInfo.altitude]; 102 | [eventText appendFormat:@"\nhorizontal accuracy: %f\nvertical accuracy: %f",self.locationInfo.horizontal_accuracy,self.locationInfo.vertical_accuracy]; 103 | 104 | NSTimeInterval interval = [[newLocation timestamp] timeIntervalSinceNow]; 105 | if (interval>-15 && interval<0) 106 | { 107 | [self.locationInfo setLocAvailable:YES]; 108 | if ([delegate respondsToSelector:@selector(newLocationUpdate:)]) 109 | { 110 | [self.delegate newLocationUpdate:self.locationInfo]; 111 | } 112 | NSLog(@"new location found : %@", eventText); 113 | [[NSNotificationCenter defaultCenter] postNotificationName:@"kNotif_NewLocationUpdated" object:self.locationInfo]; 114 | } 115 | else 116 | { 117 | NSLog(@"old location found : %@", eventText); 118 | [self.locationInfo setLocAvailable:YES]; 119 | [[NSNotificationCenter defaultCenter] postNotificationName:@"kNotif_OldLocationUpdated" object:self.locationInfo]; 120 | 121 | } 122 | 123 | } 124 | 125 | - (void)locationManager:(CLLocationManager *)manager 126 | didFailWithError:(NSError *)error 127 | { 128 | 129 | } 130 | 131 | 132 | 133 | @end -------------------------------------------------------------------------------- /Chat/Chat/Location/LocationInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // LocationInfo.h 3 | // LocationAlert 4 | // 5 | // Created by honcheng on 10/26/09. 6 | // Copyright 2009 honcheng. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface LocationInfo : NSObject { 13 | CLLocationCoordinate2D coordinate; 14 | float altitude; 15 | float horizontal_accuracy; 16 | float vertical_accuracy; 17 | float distance_travelled; 18 | bool locAvailable; 19 | bool locServiceEnabled; 20 | } 21 | 22 | @property (nonatomic, assign) CLLocationCoordinate2D coordinate; 23 | @property (nonatomic, assign) float altitude; 24 | @property (nonatomic, assign) float horizontal_accuracy; 25 | @property (nonatomic, assign) float vertical_accuracy; 26 | @property (nonatomic, assign) float distance_travelled; 27 | @property (nonatomic, assign) bool locAvailable; 28 | @property (nonatomic, assign) bool locServiceEnabled; 29 | 30 | - (CLLocation*)location; 31 | - (void)setLatitude:(float)latitude; 32 | - (void)setLongitude:(float)longitude; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Chat/Chat/Location/LocationInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // LocationInfo.m 3 | // LocationAlert 4 | // 5 | // Created by honcheng on 10/26/09. 6 | // Copyright 2009 honcheng. All rights reserved. 7 | // 8 | 9 | #import "LocationInfo.h" 10 | 11 | 12 | @implementation LocationInfo 13 | 14 | @synthesize coordinate, altitude, horizontal_accuracy, vertical_accuracy, distance_travelled, locAvailable, locServiceEnabled; 15 | 16 | - (void)setLatitude:(float)latitude 17 | { 18 | coordinate.latitude = latitude; 19 | } 20 | 21 | - (void)setLongitude:(float)longitude 22 | { 23 | coordinate.longitude = longitude; 24 | } 25 | 26 | - (CLLocation*)location 27 | { 28 | CLLocation *location = [[[CLLocation alloc] initWithLatitude:coordinate.latitude longitude:coordinate.longitude] autorelease]; 29 | return location; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Chat/Chat/Resources/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Default-Landscape.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/Default-Landscape.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Default-Landscape.psd -------------------------------------------------------------------------------- /Chat/Chat/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/Default-Portrait.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Default-Portrait.psd -------------------------------------------------------------------------------- /Chat/Chat/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Default.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/Default.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Default.psd -------------------------------------------------------------------------------- /Chat/Chat/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Default@2x.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Icon-72.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Icon.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/Icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Icon.psd -------------------------------------------------------------------------------- /Chat/Chat/Resources/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/Icon@2x.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/back_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/back_button.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/back_button.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/back_button.psd -------------------------------------------------------------------------------- /Chat/Chat/Resources/back_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/back_button@2x.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/button.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/button.psd -------------------------------------------------------------------------------- /Chat/Chat/Resources/button_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/button_black.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/button_black@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/button_black@2x.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/button_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/button_gray.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/button_gray@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/button_gray@2x.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/button_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/button_white.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/button_white@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/button_white@2x.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/font/HelveticaNeue.ttc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/font/HelveticaNeue.ttc -------------------------------------------------------------------------------- /Chat/Chat/Resources/input_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/input_bg.png -------------------------------------------------------------------------------- /Chat/Chat/Resources/input_bg.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/input_bg.psd -------------------------------------------------------------------------------- /Chat/Chat/Resources/input_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honcheng/iOS-nodechat/e675180f615a34de295ffbed7258d19375182692/Chat/Chat/Resources/input_bg@2x.png -------------------------------------------------------------------------------- /Chat/Chat/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Chat/Chat/iPad/ChatAppDelegate_iPad.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatAppDelegate_iPad.h 3 | // Chat 4 | // 5 | // Created by honcheng on 5/7/11. 6 | // Copyright 2011 BuUuK Pte Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ChatAppDelegate.h" 11 | 12 | @interface ChatAppDelegate_iPad : ChatAppDelegate { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Chat/Chat/iPad/ChatAppDelegate_iPad.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChatAppDelegate_iPad.m 3 | // Chat 4 | // 5 | // Created by honcheng on 5/7/11. 6 | // Copyright 2011 BuUuK Pte Ltd. All rights reserved. 7 | // 8 | 9 | #import "ChatAppDelegate_iPad.h" 10 | 11 | @implementation ChatAppDelegate_iPad 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Chat/Chat/iPad/en.lproj/MainWindow_iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D573 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBIPadFramework 35 | 36 | 37 | IBFirstResponder 38 | IBIPadFramework 39 | 40 | 41 | 42 | 292 43 | 44 | YES 45 | 46 | 47 | 301 48 | {{284, 501}, {200, 22}} 49 | 50 | NO 51 | YES 52 | 7 53 | NO 54 | IBIPadFramework 55 | My Universal App on iPad 56 | 57 | 1 58 | MCAwIDAAA 59 | 60 | 61 | 1 62 | 10 63 | 64 | 65 | {768, 1024} 66 | 67 | 68 | 1 69 | MSAxIDEAA 70 | 71 | NO 72 | NO 73 | 74 | 2 75 | 76 | IBIPadFramework 77 | YES 78 | 79 | 80 | IBIPadFramework 81 | 82 | 83 | 84 | 85 | YES 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 7 93 | 94 | 95 | 96 | delegate 97 | 98 | 99 | 100 | 8 101 | 102 | 103 | 104 | 105 | YES 106 | 107 | 0 108 | 109 | 110 | 111 | 112 | 113 | -1 114 | 115 | 116 | File's Owner 117 | 118 | 119 | -2 120 | 121 | 122 | 123 | 124 | 2 125 | 126 | 127 | YES 128 | 129 | 130 | 131 | 132 | 133 | 6 134 | 135 | 136 | 137 | 138 | 11 139 | 140 | 141 | 142 | 143 | 144 | 145 | YES 146 | 147 | YES 148 | -1.CustomClassName 149 | -2.CustomClassName 150 | 11.IBPluginDependency 151 | 2.IBEditorWindowLastContentRect 152 | 2.IBPluginDependency 153 | 6.CustomClassName 154 | 6.IBPluginDependency 155 | 156 | 157 | YES 158 | UIApplication 159 | UIResponder 160 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 161 | {{202, 84}, {783, 772}} 162 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 163 | ChatAppDelegate_iPad 164 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 165 | 166 | 167 | 168 | YES 169 | 170 | 171 | YES 172 | 173 | 174 | 175 | 176 | YES 177 | 178 | 179 | YES 180 | 181 | 182 | 183 | 11 184 | 185 | 186 | 187 | YES 188 | 189 | ChatAppDelegate 190 | NSObject 191 | 192 | window 193 | UIWindow 194 | 195 | 196 | window 197 | 198 | window 199 | UIWindow 200 | 201 | 202 | 203 | IBProjectSource 204 | Shared/ChatAppDelegate.h 205 | 206 | 207 | 208 | ChatAppDelegate_iPad 209 | ChatAppDelegate 210 | 211 | IBProjectSource 212 | iPad/ChatAppDelegate_iPad.h 213 | 214 | 215 | 216 | 217 | YES 218 | 219 | NSObject 220 | 221 | IBFrameworkSource 222 | Foundation.framework/Headers/NSError.h 223 | 224 | 225 | 226 | NSObject 227 | 228 | IBFrameworkSource 229 | Foundation.framework/Headers/NSFileManager.h 230 | 231 | 232 | 233 | NSObject 234 | 235 | IBFrameworkSource 236 | Foundation.framework/Headers/NSKeyValueCoding.h 237 | 238 | 239 | 240 | NSObject 241 | 242 | IBFrameworkSource 243 | Foundation.framework/Headers/NSKeyValueObserving.h 244 | 245 | 246 | 247 | NSObject 248 | 249 | IBFrameworkSource 250 | Foundation.framework/Headers/NSKeyedArchiver.h 251 | 252 | 253 | 254 | NSObject 255 | 256 | IBFrameworkSource 257 | Foundation.framework/Headers/NSObject.h 258 | 259 | 260 | 261 | NSObject 262 | 263 | IBFrameworkSource 264 | Foundation.framework/Headers/NSRunLoop.h 265 | 266 | 267 | 268 | NSObject 269 | 270 | IBFrameworkSource 271 | Foundation.framework/Headers/NSThread.h 272 | 273 | 274 | 275 | NSObject 276 | 277 | IBFrameworkSource 278 | Foundation.framework/Headers/NSURL.h 279 | 280 | 281 | 282 | NSObject 283 | 284 | IBFrameworkSource 285 | Foundation.framework/Headers/NSURLConnection.h 286 | 287 | 288 | 289 | NSObject 290 | 291 | IBFrameworkSource 292 | UIKit.framework/Headers/UIAccessibility.h 293 | 294 | 295 | 296 | NSObject 297 | 298 | IBFrameworkSource 299 | UIKit.framework/Headers/UINibLoading.h 300 | 301 | 302 | 303 | NSObject 304 | 305 | IBFrameworkSource 306 | UIKit.framework/Headers/UIResponder.h 307 | 308 | 309 | 310 | UIApplication 311 | UIResponder 312 | 313 | IBFrameworkSource 314 | UIKit.framework/Headers/UIApplication.h 315 | 316 | 317 | 318 | UIResponder 319 | NSObject 320 | 321 | 322 | 323 | UIView 324 | 325 | IBFrameworkSource 326 | UIKit.framework/Headers/UITextField.h 327 | 328 | 329 | 330 | UIView 331 | UIResponder 332 | 333 | IBFrameworkSource 334 | UIKit.framework/Headers/UIView.h 335 | 336 | 337 | 338 | UIWindow 339 | UIView 340 | 341 | IBFrameworkSource 342 | UIKit.framework/Headers/UIWindow.h 343 | 344 | 345 | 346 | 347 | 0 348 | IBIPadFramework 349 | 350 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 351 | 352 | 353 | 354 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 355 | 356 | 357 | YES 358 | ../Chat.xcodeproj 359 | 3 360 | 112 361 | 362 | 363 | -------------------------------------------------------------------------------- /Chat/Chat/iPhone/ChatAppDelegate_iPhone.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatAppDelegate_iPhone.h 3 | // Chat 4 | // 5 | // Created by honcheng on 5/7/11. 6 | // Copyright 2011 BuUuK Pte Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ChatAppDelegate.h" 11 | 12 | @interface ChatAppDelegate_iPhone : ChatAppDelegate { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Chat/Chat/iPhone/ChatAppDelegate_iPhone.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChatAppDelegate_iPhone.m 3 | // Chat 4 | // 5 | // Created by honcheng on 5/7/11. 6 | // Copyright 2011 BuUuK Pte Ltd. All rights reserved. 7 | // 8 | 9 | #import "ChatAppDelegate_iPhone.h" 10 | 11 | @implementation ChatAppDelegate_iPhone 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Chat/Chat/iPhone/en.lproj/MainWindow_iPhone.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D573 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | 45 | 1316 46 | 47 | YES 48 | 49 | 50 | 1325 51 | {{51, 229}, {218, 22}} 52 | 53 | NO 54 | YES 55 | 7 56 | NO 57 | IBCocoaTouchFramework 58 | My Universal App on iPhone 59 | 60 | 1 61 | MCAwIDAAA 62 | 63 | 64 | 1 65 | 10 66 | 67 | 68 | 69 | {320, 480} 70 | 71 | 72 | 1 73 | MSAxIDEAA 74 | 75 | NO 76 | NO 77 | 78 | IBCocoaTouchFramework 79 | YES 80 | 81 | 82 | 83 | 84 | YES 85 | 86 | 87 | delegate 88 | 89 | 90 | 91 | 5 92 | 93 | 94 | 95 | window 96 | 97 | 98 | 99 | 6 100 | 101 | 102 | 103 | 104 | YES 105 | 106 | 0 107 | 108 | 109 | 110 | 111 | 112 | 2 113 | 114 | 115 | YES 116 | 117 | 118 | 119 | 120 | 121 | -1 122 | 123 | 124 | File's Owner 125 | 126 | 127 | 4 128 | 129 | 130 | App Delegate 131 | 132 | 133 | -2 134 | 135 | 136 | 137 | 138 | 8 139 | 140 | 141 | 142 | 143 | 144 | 145 | YES 146 | 147 | YES 148 | -1.CustomClassName 149 | -2.CustomClassName 150 | 2.IBAttributePlaceholdersKey 151 | 2.IBEditorWindowLastContentRect 152 | 2.IBPluginDependency 153 | 2.UIWindow.visibleAtLaunch 154 | 4.CustomClassName 155 | 4.IBPluginDependency 156 | 8.IBPluginDependency 157 | 158 | 159 | YES 160 | UIApplication 161 | UIResponder 162 | 163 | YES 164 | 165 | 166 | YES 167 | 168 | 169 | {{520, 376}, {320, 480}} 170 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 171 | 172 | ChatAppDelegate_iPhone 173 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 174 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 175 | 176 | 177 | 178 | YES 179 | 180 | 181 | YES 182 | 183 | 184 | 185 | 186 | YES 187 | 188 | 189 | YES 190 | 191 | 192 | 193 | 8 194 | 195 | 196 | 197 | YES 198 | 199 | ChatAppDelegate 200 | NSObject 201 | 202 | window 203 | UIWindow 204 | 205 | 206 | window 207 | 208 | window 209 | UIWindow 210 | 211 | 212 | 213 | IBProjectSource 214 | Shared/ChatAppDelegate.h 215 | 216 | 217 | 218 | ChatAppDelegate_iPhone 219 | ChatAppDelegate 220 | 221 | IBProjectSource 222 | iPhone/ChatAppDelegate_iPhone.h 223 | 224 | 225 | 226 | 227 | YES 228 | 229 | NSObject 230 | 231 | IBFrameworkSource 232 | Foundation.framework/Headers/NSError.h 233 | 234 | 235 | 236 | NSObject 237 | 238 | IBFrameworkSource 239 | Foundation.framework/Headers/NSFileManager.h 240 | 241 | 242 | 243 | NSObject 244 | 245 | IBFrameworkSource 246 | Foundation.framework/Headers/NSKeyValueCoding.h 247 | 248 | 249 | 250 | NSObject 251 | 252 | IBFrameworkSource 253 | Foundation.framework/Headers/NSKeyValueObserving.h 254 | 255 | 256 | 257 | NSObject 258 | 259 | IBFrameworkSource 260 | Foundation.framework/Headers/NSKeyedArchiver.h 261 | 262 | 263 | 264 | NSObject 265 | 266 | IBFrameworkSource 267 | Foundation.framework/Headers/NSObject.h 268 | 269 | 270 | 271 | NSObject 272 | 273 | IBFrameworkSource 274 | Foundation.framework/Headers/NSRunLoop.h 275 | 276 | 277 | 278 | NSObject 279 | 280 | IBFrameworkSource 281 | Foundation.framework/Headers/NSThread.h 282 | 283 | 284 | 285 | NSObject 286 | 287 | IBFrameworkSource 288 | Foundation.framework/Headers/NSURL.h 289 | 290 | 291 | 292 | NSObject 293 | 294 | IBFrameworkSource 295 | Foundation.framework/Headers/NSURLConnection.h 296 | 297 | 298 | 299 | NSObject 300 | 301 | IBFrameworkSource 302 | UIKit.framework/Headers/UIAccessibility.h 303 | 304 | 305 | 306 | NSObject 307 | 308 | IBFrameworkSource 309 | UIKit.framework/Headers/UINibLoading.h 310 | 311 | 312 | 313 | NSObject 314 | 315 | IBFrameworkSource 316 | UIKit.framework/Headers/UIResponder.h 317 | 318 | 319 | 320 | UIApplication 321 | UIResponder 322 | 323 | IBFrameworkSource 324 | UIKit.framework/Headers/UIApplication.h 325 | 326 | 327 | 328 | UIResponder 329 | NSObject 330 | 331 | 332 | 333 | UIView 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UITextField.h 337 | 338 | 339 | 340 | UIView 341 | UIResponder 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIView.h 345 | 346 | 347 | 348 | UIWindow 349 | UIView 350 | 351 | IBFrameworkSource 352 | UIKit.framework/Headers/UIWindow.h 353 | 354 | 355 | 356 | 357 | 0 358 | IBCocoaTouchFramework 359 | 360 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 361 | 362 | 363 | 364 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 365 | 366 | 367 | YES 368 | ../Chat.xcodeproj 369 | 3 370 | 112 371 | 372 | 373 | -------------------------------------------------------------------------------- /Chat/Chat/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Chat 4 | // 5 | // Created by honcheng on 5/7/11. 6 | // Copyright 2011 BuUuK Pte Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | iOS-nodechat 2 | ============= 3 | 4 | This is a simple iOS chat client for socket.io & node.js backend. 5 | 6 | #### Socket.io implementation in the app is based on 7 | * [socketio-cocoa](https://github.com/fpotter/socketio-cocoa) 8 | * [cocoa-websocket](https://github.com/erichocean/cocoa-websocket) 9 | 10 | #### Rich text formatting in the is based on RTLabel 11 | * [RTLabel](https://github.com/honcheng/RTLabel) 12 | 13 | #### The code for the chatroom backend is provided by [alvinSJ](http://github.com/alvinsj) 14 | * [nodechat](https://github.com/alvinsj/nodechat) 15 | 16 | About the app 17 | ------------- 18 | 19 | This is a simple chat client we made for fun for internal use in [buUuk](http://buuuk.com). 20 | Check out [@alvinsj](http://github.com/alvinsj) for the backend source code. More updates coming soon. 21 | 22 | [twitter.com/honcheng](http://twitter.com/honcheng) 23 | 24 | --------------------------------------------------------------------------------