Skip to content

Commit 1e6a3fb

Browse files
committed
initial commit
0 parents  commit 1e6a3fb

File tree

336 files changed

+34627
-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.

336 files changed

+34627
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
iOS/Broadcasts/Constants.h
2+
parse/cloud/config.js

iOS/Broadcasts.xcodeproj/project.pbxproj

+445
Large diffs are not rendered by default.

iOS/Broadcasts.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,10 @@
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>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
6+
<true/>
7+
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
8+
<true/>
9+
</dict>
10+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "1.0">
5+
<FileBreakpoints>
6+
<FileBreakpoint
7+
shouldBeEnabled = "Yes"
8+
ignoreCount = "0"
9+
continueAfterRunningActions = "No"
10+
filePath = "Broadcasts/BroadcastCreationViewController.m"
11+
timestampString = "377560384.026648"
12+
startingColumnNumber = "9223372036854775807"
13+
endingColumnNumber = "9223372036854775807"
14+
startingLineNumber = "53"
15+
endingLineNumber = "53"
16+
landmarkName = "-done:"
17+
landmarkType = "5">
18+
</FileBreakpoint>
19+
</FileBreakpoints>
20+
</Bucket>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0450"
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 = "9208C9B316664D95000EC072"
18+
BuildableName = "Broadcasts.app"
19+
BlueprintName = "Broadcasts"
20+
ReferencedContainer = "container:Broadcasts.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+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "9208C9DD16664D95000EC072"
36+
BuildableName = "OpenTokParseSampleTests.octest"
37+
BlueprintName = "OpenTokParseSampleTests"
38+
ReferencedContainer = "container:Broadcasts.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "9208C9B316664D95000EC072"
46+
BuildableName = "Broadcasts.app"
47+
BlueprintName = "Broadcasts"
48+
ReferencedContainer = "container:Broadcasts.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
</TestAction>
52+
<LaunchAction
53+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
54+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
55+
launchStyle = "0"
56+
useCustomWorkingDirectory = "NO"
57+
buildConfiguration = "Debug"
58+
ignoresPersistentStateOnLaunch = "NO"
59+
debugDocumentVersioning = "YES"
60+
allowLocationSimulation = "YES">
61+
<BuildableProductRunnable>
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "9208C9B316664D95000EC072"
65+
BuildableName = "Broadcasts.app"
66+
BlueprintName = "Broadcasts"
67+
ReferencedContainer = "container:Broadcasts.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
<AdditionalOptions>
71+
</AdditionalOptions>
72+
</LaunchAction>
73+
<ProfileAction
74+
shouldUseLaunchSchemeArgsEnv = "YES"
75+
savedToolIdentifier = ""
76+
useCustomWorkingDirectory = "NO"
77+
buildConfiguration = "Release"
78+
debugDocumentVersioning = "YES">
79+
<BuildableProductRunnable>
80+
<BuildableReference
81+
BuildableIdentifier = "primary"
82+
BlueprintIdentifier = "9208C9B316664D95000EC072"
83+
BuildableName = "Broadcasts.app"
84+
BlueprintName = "Broadcasts"
85+
ReferencedContainer = "container:Broadcasts.xcodeproj">
86+
</BuildableReference>
87+
</BuildableProductRunnable>
88+
</ProfileAction>
89+
<AnalyzeAction
90+
buildConfiguration = "Debug">
91+
</AnalyzeAction>
92+
<ArchiveAction
93+
buildConfiguration = "Release"
94+
revealArchiveInOrganizer = "YES">
95+
</ArchiveAction>
96+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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>Broadcasts.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>9208C9B316664D95000EC072</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
<key>9208C9DD16664D95000EC072</key>
21+
<dict>
22+
<key>primary</key>
23+
<true/>
24+
</dict>
25+
</dict>
26+
</dict>
27+
</plist>

iOS/Broadcasts/BroadcastCell.h

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// OTPSBroadcastCell.h
3+
// OpenTokParseSample
4+
//
5+
// Created by Ankur Oberoi on 12/4/12.
6+
// Copyright (c) 2012 Ankur Oberoi. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
#import <Parse/Parse.h>
11+
12+
@interface BroadcastCell : PFTableViewCell
13+
14+
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
15+
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
16+
@property (weak, nonatomic) IBOutlet UILabel *ownerLabel;
17+
18+
@end

iOS/Broadcasts/BroadcastCell.m

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// OTPSBroadcastCell.m
3+
// OpenTokParseSample
4+
//
5+
// Created by Ankur Oberoi on 12/4/12.
6+
// Copyright (c) 2012 Ankur Oberoi. All rights reserved.
7+
//
8+
9+
#import "BroadcastCell.h"
10+
11+
@implementation BroadcastCell
12+
13+
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
14+
{
15+
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
16+
if (self) {
17+
// Initialization code
18+
}
19+
return self;
20+
}
21+
22+
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
23+
{
24+
[super setSelected:selected animated:animated];
25+
26+
// Configure the view for the selected state
27+
}
28+
29+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//
2+
// OTPSCreateConversationViewController.h
3+
// OpenTokParseSample
4+
//
5+
// Created by Ankur Oberoi on 11/30/12.
6+
// Copyright (c) 2012 Ankur Oberoi. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
#import <Parse/Parse.h>
11+
12+
@class BroadcastCreationViewController;
13+
14+
@protocol OTPSCreateBroadcastDelegate <NSObject>
15+
16+
- (void)createBroadcastController:(BroadcastCreationViewController *)createBroadcastViewController didAddBroadcast:(PFObject *)broadcast;
17+
18+
@end
19+
20+
@interface BroadcastCreationViewController : UITableViewController
21+
22+
@property (weak, nonatomic) IBOutlet UITextField *titleField;
23+
@property (weak, nonatomic) IBOutlet UIBarButtonItem *cancelButton;
24+
@property (weak, nonatomic) IBOutlet UIBarButtonItem *doneButton;
25+
26+
@property (weak, nonatomic) IBOutlet id <OTPSCreateBroadcastDelegate> delegate;
27+
28+
- (IBAction)done:(id)sender;
29+
- (IBAction)cancel:(id)sender;
30+
31+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
//
2+
// OTPSCreateConversationViewController.m
3+
// OpenTokParseSample
4+
//
5+
// Created by Ankur Oberoi on 11/30/12.
6+
// Copyright (c) 2012 Ankur Oberoi. All rights reserved.
7+
//
8+
9+
#import "BroadcastCreationViewController.h"
10+
11+
@interface BroadcastCreationViewController ()
12+
13+
@end
14+
15+
@implementation BroadcastCreationViewController
16+
17+
- (id)initWithStyle:(UITableViewStyle)style
18+
{
19+
self = [super initWithStyle:style];
20+
if (self) {
21+
// Custom initialization
22+
}
23+
return self;
24+
}
25+
26+
- (void)viewDidLoad
27+
{
28+
[super viewDidLoad];
29+
30+
// Uncomment the following line to preserve selection between presentations.
31+
// self.clearsSelectionOnViewWillAppear = NO;
32+
33+
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
34+
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
35+
}
36+
37+
- (void)didReceiveMemoryWarning
38+
{
39+
[super didReceiveMemoryWarning];
40+
// Dispose of any resources that can be recreated.
41+
}
42+
43+
44+
- (IBAction)done:(id)sender {
45+
if (self.titleField.text.length > 0 && self.titleField.text.length < 25) {
46+
47+
// Create the new Broadcast object
48+
PFObject *newBroadcast = [PFObject objectWithClassName:@"Broadcast"];
49+
newBroadcast[@"title"] = self.titleField.text;
50+
// TODO: Add an owner property to a broadcast
51+
52+
// TODO: Set the access control for the new Broadcast
53+
54+
// Save the new Broadcast
55+
[newBroadcast saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
56+
if (!error) {
57+
[self.delegate createBroadcastController:self didAddBroadcast:newBroadcast];
58+
[self dismiss];
59+
} else {
60+
NSLog(@"Error saving Broadcast object: %@", error.description);
61+
}
62+
}];
63+
64+
// Show loading interface
65+
self.titleField.enabled = NO;
66+
self.doneButton.enabled = NO;
67+
self.cancelButton.enabled = NO;
68+
69+
} else {
70+
// Show validation error
71+
NSLog(@"Invalid title for new Broadcast object: %@", self.titleField.text);
72+
}
73+
}
74+
75+
- (IBAction)cancel:(id)sender {
76+
[self dismiss];
77+
}
78+
79+
// TODO: use segue unwinding
80+
- (void)dismiss {
81+
// Dismiss view controller
82+
[self.presentingViewController dismissViewControllerAnimated:YES completion:^{
83+
// Clear value in text field
84+
self.titleField.text = [NSString string];
85+
}];
86+
}
87+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// OTPSViewController.h
3+
// OpenTokParseSample
4+
//
5+
// Created by Ankur Oberoi on 11/28/12.
6+
// Copyright (c) 2012 Ankur Oberoi. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
#import <Parse/Parse.h>
11+
#import "BroadcastCreationViewController.h"
12+
#import "BroadcastViewController.h"
13+
14+
@interface BroadcastTableViewController : PFQueryTableViewController <OTPSCreateBroadcastDelegate>
15+
16+
@property (nonatomic, strong) BroadcastViewController *showBroadcastViewController;
17+
18+
@end

0 commit comments

Comments
 (0)