Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40faa17
commit 29b5a46
Showing
592 changed files
with
75,482 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
059-windows-azure-mobile-services/nsscreencast-chat-starting/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.DS_Store | ||
*.swp | ||
*~ | ||
*~.nib | ||
*.orig | ||
build/ | ||
deliapp.build | ||
Debug-iphonesimulator | ||
|
||
*.pbxuser | ||
*.perspective | ||
*.perspectivev3 | ||
*.mode1v3 | ||
*.mode2v3 | ||
xcuserdata | ||
project.xcworkspace | ||
.idea | ||
pkg | ||
build.output | ||
test-reports | ||
kif-screenshots | ||
kif.error | ||
tags |
1 change: 1 addition & 0 deletions
1
...services/nsscreencast-chat-starting/NSScreencastChat.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+12 KB
...-azure-mobile-services/nsscreencast-chat-starting/NSScreencastChat/Icon-144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.38 KB
...s-azure-mobile-services/nsscreencast-chat-starting/NSScreencastChat/Icon-72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.15 KB
...dows-azure-mobile-services/nsscreencast-chat-starting/NSScreencastChat/Icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.49 KB
...s-azure-mobile-services/nsscreencast-chat-starting/NSScreencastChat/Icon@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
399 changes: 399 additions & 0 deletions
399
...es/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+18.2 KB
...sscreencast-chat-starting/NSScreencastChat/NSScreencastChat/Default-568h@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.39 KB
...rvices/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.7 KB
...ces/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/Default@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
...le-services/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCAppDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// NSCAppDelegate.h | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/9/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface NSCAppDelegate : UIResponder <UIApplicationDelegate> | ||
|
||
@property (strong, nonatomic) UIWindow *window; | ||
|
||
@end |
44 changes: 44 additions & 0 deletions
44
...le-services/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCAppDelegate.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// NSCAppDelegate.m | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/9/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import "NSCAppDelegate.h" | ||
|
||
@implementation NSCAppDelegate | ||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | ||
return YES; | ||
} | ||
|
||
- (void)applicationWillResignActive:(UIApplication *)application | ||
{ | ||
// 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. | ||
// 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. | ||
} | ||
|
||
- (void)applicationDidEnterBackground:(UIApplication *)application | ||
{ | ||
// 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. | ||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | ||
} | ||
|
||
- (void)applicationWillEnterForeground:(UIApplication *)application | ||
{ | ||
// 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. | ||
} | ||
|
||
- (void)applicationDidBecomeActive:(UIApplication *)application | ||
{ | ||
// 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. | ||
} | ||
|
||
- (void)applicationWillTerminate:(UIApplication *)application | ||
{ | ||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | ||
} | ||
|
||
@end |
21 changes: 21 additions & 0 deletions
21
...ices/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCChatViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// NSCChatViewController.h | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/10/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "MessagesViewController.h" | ||
#import "WindowsAzureMobileServices.h" | ||
#import "NSCRoom.h" | ||
#import "NSCUser.h" | ||
|
||
@interface NSCChatViewController : MessagesViewController | ||
|
||
@property (nonatomic, strong) MSClient *client; | ||
@property (nonatomic, strong) NSCUser *user; | ||
@property (nonatomic, strong) NSCRoom *room; | ||
|
||
@end |
42 changes: 42 additions & 0 deletions
42
...ices/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCChatViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// NSCChatViewController.m | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/10/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import "NSCChatViewController.h" | ||
#import "MessageInputView.h" | ||
#import "NSCMessage.h" | ||
|
||
@interface NSCChatViewController () | ||
|
||
@property (nonatomic, strong) NSMutableArray *messages; | ||
@property (nonatomic, strong) NSTimer *fetchTimer; | ||
@property (nonatomic, strong) NSDate *lastFetchDate; | ||
|
||
@end | ||
|
||
@implementation NSCChatViewController | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
self.title = self.room.name; | ||
|
||
// TODO | ||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated { | ||
[super viewDidAppear:animated]; | ||
} | ||
|
||
- (void)viewWillDisappear:(BOOL)animated { | ||
[super viewWillDisappear:animated]; | ||
} | ||
|
||
- (void)fetchMessages { | ||
// TODO | ||
} | ||
|
||
@end |
13 changes: 13 additions & 0 deletions
13
...ces/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCLobbyViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// NSCLobbyViewController.h | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/9/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface NSCLobbyViewController : UITableViewController | ||
|
||
@end |
93 changes: 93 additions & 0 deletions
93
...ces/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCLobbyViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// | ||
// NSCLobbyViewController.m | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/9/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import "NSCLobbyViewController.h" | ||
#import "WindowsAzureMobileServices.h" | ||
#import "NSCRoom.h" | ||
#import "NSCSignInViewController.h" | ||
#import "NSCChatViewController.h" | ||
|
||
typedef void (^RoomNameBlock)(NSString *name); | ||
|
||
@interface NSCLobbyViewController () <UIAlertViewDelegate> | ||
|
||
@property (nonatomic, strong) RoomNameBlock roomNameBlock; | ||
@property (nonatomic, strong) NSCRoom *selectedRoom; | ||
@property (nonatomic, strong) MSClient *client; | ||
@property (nonatomic, strong) NSMutableArray *rooms; | ||
|
||
@end | ||
|
||
@implementation NSCLobbyViewController | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
|
||
self.refreshControl = [[UIRefreshControl alloc] init]; | ||
[self.refreshControl addTarget:self action:@selector(onRefresh:) forControlEvents:UIControlEventValueChanged]; | ||
|
||
[self setupClient]; | ||
[self onRefresh:nil]; | ||
} | ||
|
||
- (void)onRefresh:(id)sender { | ||
[self.refreshControl beginRefreshing]; | ||
[self fetchRooms]; | ||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated { | ||
[super viewDidAppear:animated]; | ||
} | ||
|
||
|
||
- (void)setupClient { | ||
// TODO | ||
} | ||
|
||
- (IBAction)addRoomTapped:(id)sender { | ||
// TODO | ||
} | ||
|
||
- (void)fetchRooms { | ||
// TODO | ||
} | ||
|
||
|
||
#pragma mark - Table view data source | ||
|
||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | ||
return 1; | ||
} | ||
|
||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | ||
return self.rooms.count; | ||
} | ||
|
||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
static NSString *CellIdentifier = @"Cell"; | ||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; | ||
|
||
NSCRoom *room = self.rooms[indexPath.row]; | ||
cell.textLabel.text = room.name; | ||
|
||
NSString *participantText = [NSString stringWithFormat:@"%d participant%@", room.participantCount, (room.participantCount == 1 ? @"" : @"s")]; | ||
cell.detailTextLabel.text = participantText; | ||
|
||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; | ||
|
||
return cell; | ||
} | ||
|
||
|
||
#pragma mark - Table view delegate | ||
|
||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | ||
[tableView deselectRowAtIndexPath:indexPath animated:YES]; | ||
} | ||
|
||
@end |
22 changes: 22 additions & 0 deletions
22
...mobile-services/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCMessage.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// NSCMessage.h | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/23/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSCMessage : NSObject | ||
|
||
@property (nonatomic, assign) NSInteger messageId; | ||
@property (nonatomic, assign) NSInteger roomId; | ||
@property (nonatomic, copy) NSString *author; | ||
@property (nonatomic, copy) NSString *userId; | ||
@property (nonatomic, copy) NSString *text; | ||
|
||
+ (NSCMessage *)messageWithDictionary:(NSDictionary *)dictionary; | ||
- (NSDictionary *)attributes; | ||
|
||
@end |
43 changes: 43 additions & 0 deletions
43
...mobile-services/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCMessage.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// NSCMessage.m | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/23/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import "NSCMessage.h" | ||
|
||
@implementation NSCMessage | ||
|
||
+ (NSCMessage *)messageWithDictionary:(NSDictionary *)dictionary { | ||
NSCMessage *msg = [[NSCMessage alloc] init]; | ||
msg.messageId = [dictionary[@"id"] intValue]; | ||
msg.roomId = [dictionary[@"roomId"] intValue]; | ||
msg.text = dictionary[@"text"]; | ||
msg.author = dictionary[@"author"]; | ||
msg.userId = dictionary[@"userId"]; | ||
return msg; | ||
} | ||
|
||
- (NSDictionary *)attributes { | ||
return @{ | ||
@"text": self.text, | ||
@"roomId": @(self.roomId), | ||
}; | ||
} | ||
|
||
- (NSUInteger)hash { | ||
return [[NSString stringWithFormat:@"NSCRMessage:%d", self.messageId] hash]; | ||
} | ||
|
||
- (BOOL)isEqual:(id)object { | ||
if (![object isKindOfClass:[NSCMessage class]]) { | ||
return NO; | ||
} | ||
|
||
NSCMessage *other = (NSCMessage *)object; | ||
return other.messageId == self.messageId; | ||
} | ||
|
||
@end |
19 changes: 19 additions & 0 deletions
19
...re-mobile-services/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCRoom.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// NSCRoom.h | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/10/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSCRoom : NSObject | ||
|
||
@property (nonatomic, assign) NSUInteger roomId; | ||
@property (nonatomic, copy) NSString *name; | ||
@property (nonatomic, assign) NSUInteger participantCount; | ||
|
||
- (id)initWithDictionary:(NSDictionary *)dictionary; | ||
|
||
@end |
28 changes: 28 additions & 0 deletions
28
...re-mobile-services/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCRoom.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// NSCRoom.m | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/10/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import "NSCRoom.h" | ||
|
||
@implementation NSCRoom | ||
|
||
- (id)initWithDictionary:(NSDictionary *)dictionary { | ||
self = [super init]; | ||
if (self) { | ||
self.roomId = [dictionary[@"id"] intValue]; | ||
self.name = dictionary[@"name"]; | ||
self.participantCount = [dictionary[@"participantCount"] intValue]; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (NSDictionary *)attributes { | ||
return @{@"name": self.name}; | ||
} | ||
|
||
@end |
17 changes: 17 additions & 0 deletions
17
...es/nsscreencast-chat-starting/NSScreencastChat/NSScreencastChat/NSCSignInViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// NSCSignInViewController.h | ||
// NSScreencastChat | ||
// | ||
// Created by ben on 3/10/13. | ||
// Copyright (c) 2013 NSScreencast. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "WindowsAzureMobileServices.h" | ||
|
||
@interface NSCSignInViewController : UIViewController | ||
|
||
/* Required to be set by the presenting view controller before view controller is presented. */ | ||
@property (nonatomic, strong) MSClient *client; | ||
|
||
@end |
Oops, something went wrong.