Skip to content

Commit 81cec07

Browse files
committed
ios web socket
ios web socket
0 parents  commit 81cec07

File tree

935 files changed

+238369
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

935 files changed

+238369
-0
lines changed

.DS_Store

12 KB
Binary file not shown.

ClientWebSocket/.DS_Store

6 KB
Binary file not shown.
6 KB
Binary file not shown.

ClientWebSocket/WebSocketDemo/WebSocketDemo.xcodeproj/project.pbxproj

+630
Large diffs are not rendered by default.

ClientWebSocket/WebSocketDemo/WebSocketDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "1.0">
5+
</Bucket>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0460"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "FE975F8717977E270003818E"
18+
BuildableName = "WebSocketDemo.app"
19+
BlueprintName = "WebSocketDemo"
20+
ReferencedContainer = "container:WebSocketDemo.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28+
shouldUseLaunchSchemeArgsEnv = "YES"
29+
buildConfiguration = "Debug">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "FE975F8717977E270003818E"
36+
BuildableName = "WebSocketDemo.app"
37+
BlueprintName = "WebSocketDemo"
38+
ReferencedContainer = "container:WebSocketDemo.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
</TestAction>
42+
<LaunchAction
43+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
44+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
45+
launchStyle = "0"
46+
useCustomWorkingDirectory = "NO"
47+
buildConfiguration = "Debug"
48+
ignoresPersistentStateOnLaunch = "NO"
49+
debugDocumentVersioning = "YES"
50+
allowLocationSimulation = "YES">
51+
<BuildableProductRunnable>
52+
<BuildableReference
53+
BuildableIdentifier = "primary"
54+
BlueprintIdentifier = "FE975F8717977E270003818E"
55+
BuildableName = "WebSocketDemo.app"
56+
BlueprintName = "WebSocketDemo"
57+
ReferencedContainer = "container:WebSocketDemo.xcodeproj">
58+
</BuildableReference>
59+
</BuildableProductRunnable>
60+
<AdditionalOptions>
61+
</AdditionalOptions>
62+
</LaunchAction>
63+
<ProfileAction
64+
shouldUseLaunchSchemeArgsEnv = "YES"
65+
savedToolIdentifier = ""
66+
useCustomWorkingDirectory = "NO"
67+
buildConfiguration = "Release"
68+
debugDocumentVersioning = "YES">
69+
<BuildableProductRunnable>
70+
<BuildableReference
71+
BuildableIdentifier = "primary"
72+
BlueprintIdentifier = "FE975F8717977E270003818E"
73+
BuildableName = "WebSocketDemo.app"
74+
BlueprintName = "WebSocketDemo"
75+
ReferencedContainer = "container:WebSocketDemo.xcodeproj">
76+
</BuildableReference>
77+
</BuildableProductRunnable>
78+
</ProfileAction>
79+
<AnalyzeAction
80+
buildConfiguration = "Debug">
81+
</AnalyzeAction>
82+
<ArchiveAction
83+
buildConfiguration = "Release"
84+
revealArchiveInOrganizer = "YES">
85+
</ArchiveAction>
86+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>WebSocketDemo.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>FE975F8717977E270003818E</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
</dict>
21+
</dict>
22+
</plist>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// AppDelegate.h
3+
// WebSocketDemo
4+
//
5+
// Created by da zhan on 13-7-18.
6+
// Copyright (c) 2013年 da zhan. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@class ViewController;
12+
13+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
14+
15+
@property (strong, nonatomic) UIWindow *window;
16+
17+
@property (strong, nonatomic) ViewController *viewController;
18+
19+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//
2+
// AppDelegate.m
3+
// WebSocketDemo
4+
//
5+
// Created by da zhan on 13-7-18.
6+
// Copyright (c) 2013年 da zhan. All rights reserved.
7+
//
8+
9+
#import "AppDelegate.h"
10+
11+
#import "ViewController.h"
12+
13+
@implementation AppDelegate
14+
15+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
16+
{
17+
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
18+
19+
// Override point for customization after application launch.
20+
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
21+
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:self.viewController];
22+
self.window.rootViewController = nc ;
23+
[self.window makeKeyAndVisible];
24+
return YES;
25+
}
26+
27+
- (void)applicationWillResignActive:(UIApplication *)application
28+
{
29+
// 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.
30+
// 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.
31+
}
32+
33+
- (void)applicationDidEnterBackground:(UIApplication *)application
34+
{
35+
// 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.
36+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
37+
}
38+
39+
- (void)applicationWillEnterForeground:(UIApplication *)application
40+
{
41+
// 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.
42+
}
43+
44+
- (void)applicationDidBecomeActive:(UIApplication *)application
45+
{
46+
// 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.
47+
}
48+
49+
- (void)applicationWillTerminate:(UIApplication *)application
50+
{
51+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
52+
}
53+
54+
@end
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// BubbleMessageCell.h
3+
//
4+
// Created by Jesse Squires on 2/12/13.
5+
// Copyright (c) 2013 Hexed Bits. All rights reserved.
6+
//
7+
//
8+
// Largely based on work by Sam Soffes
9+
// https://github.com/soffes
10+
//
11+
// SSMessagesViewController
12+
// https://github.com/soffes/ssmessagesviewcontroller
13+
//
14+
//
15+
// The MIT License
16+
// Copyright (c) 2013 Jesse Squires
17+
//
18+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
19+
// associated documentation files (the "Software"), to deal in the Software without restriction, including
20+
// without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21+
// copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
22+
// following conditions:
23+
//
24+
// The above copyright notice and this permission notice shall be included in
25+
// all copies or substantial portions of the Software.
26+
//
27+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
28+
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
29+
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
30+
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
31+
// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32+
//
33+
34+
#import <UIKit/UIKit.h>
35+
#import "BubbleView.h"
36+
37+
@interface BubbleMessageCell : UITableViewCell
38+
39+
@property (strong, nonatomic) BubbleView *bubbleView;
40+
41+
- (id)initWithBubbleStyle:(BubbleMessageStyle)style
42+
reuseIdentifier:(NSString *)reuseIdentifier;
43+
44+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
//
2+
// BubbleMessageCell.m
3+
//
4+
// Created by Jesse Squires on 2/12/13.
5+
// Copyright (c) 2013 Hexed Bits. All rights reserved.
6+
//
7+
//
8+
// Largely based on work by Sam Soffes
9+
// https://github.com/soffes
10+
//
11+
// SSMessagesViewController
12+
// https://github.com/soffes/ssmessagesviewcontroller
13+
//
14+
//
15+
// The MIT License
16+
// Copyright (c) 2013 Jesse Squires
17+
//
18+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
19+
// associated documentation files (the "Software"), to deal in the Software without restriction, including
20+
// without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21+
// copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
22+
// following conditions:
23+
//
24+
// The above copyright notice and this permission notice shall be included in
25+
// all copies or substantial portions of the Software.
26+
//
27+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
28+
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
29+
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
30+
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
31+
// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32+
//
33+
34+
#import "BubbleMessageCell.h"
35+
36+
@interface BubbleMessageCell()
37+
38+
- (void)setup;
39+
40+
@end
41+
42+
43+
44+
@implementation BubbleMessageCell
45+
46+
#pragma mark - Initialization
47+
- (void)setup
48+
{
49+
self.backgroundColor = [UIColor clearColor];
50+
self.selectionStyle = UITableViewCellSelectionStyleNone;
51+
self.accessoryType = UITableViewCellAccessoryNone;
52+
self.accessoryView = nil;
53+
54+
self.imageView.image = nil;
55+
self.imageView.hidden = YES;
56+
self.textLabel.text = nil;
57+
self.textLabel.hidden = YES;
58+
self.detailTextLabel.text = nil;
59+
self.detailTextLabel.hidden = YES;
60+
61+
self.bubbleView = [[BubbleView alloc] initWithFrame:CGRectMake(0.0f,
62+
0.0f,
63+
self.contentView.frame.size.width,
64+
self.contentView.frame.size.height)];
65+
66+
self.bubbleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
67+
68+
[self.contentView addSubview:self.bubbleView];
69+
[self.contentView sendSubviewToBack:self.bubbleView];
70+
}
71+
72+
- (id)initWithBubbleStyle:(BubbleMessageStyle)style reuseIdentifier:(NSString *)reuseIdentifier
73+
{
74+
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
75+
if(self) {
76+
[self setup];
77+
[self.bubbleView setStyle:style];
78+
}
79+
return self;
80+
}
81+
82+
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
83+
{
84+
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
85+
if(self) {
86+
[self setup];
87+
}
88+
return self;
89+
}
90+
91+
- (id)initWithFrame:(CGRect)frame
92+
{
93+
self = [super initWithFrame:frame];
94+
if(self) {
95+
[self setup];
96+
}
97+
return self;
98+
}
99+
100+
#pragma mark - Setters
101+
- (void)setBackgroundColor:(UIColor *)backgroundColor
102+
{
103+
[super setBackgroundColor:backgroundColor];
104+
[self.bubbleView setBackgroundColor:backgroundColor];
105+
}
106+
107+
@end

0 commit comments

Comments
 (0)