http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/AddBookViewController.m ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/AddBookViewController.m b/sdks/other/ios/samples/Books/books/AddBookViewController.m new file mode 100644 index 0000000..85afa77 --- /dev/null +++ b/sdks/other/ios/samples/Books/books/AddBookViewController.m @@ -0,0 +1,169 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// AddBookViewController.m +// books +// + +#import "AddBookViewController.h" +#import "UGConnection.h" +#import "UGHTTPClient.h" +#import "UGHTTPResult.h" + +@interface FormTableViewCell : UITableViewCell <UITextFieldDelegate> +@property (nonatomic, strong) UILabel *label; +@property (nonatomic, strong) UITextField *textField; +@property (nonatomic, strong) NSString *key; +@property (nonatomic, weak) id binding; +@end + +@implementation FormTableViewCell + +- (id) initWithTitle:(NSString *)title key:(NSString *) key binding:(id) binding +{ + if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"]) { + self.label = [[UILabel alloc] initWithFrame:CGRectMake(10,0,90,14)]; + self.label.backgroundColor = [UIColor clearColor]; + self.label.font = [UIFont systemFontOfSize:10]; + self.label.textColor = [UIColor grayColor]; + self.label.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.label]; + self.textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 14, 100, 30)]; + self.textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; + self.textField.font = [UIFont systemFontOfSize:18]; + self.textField.autocorrectionType = UITextAutocorrectionTypeNo; + self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone; + self.textField.delegate = self; + if ([key isEqualToString:@"password"]) { + self.textField.secureTextEntry = YES; + } + [self.contentView addSubview:self.textField]; + self.selectionStyle = UITableViewCellSelectionStyleNone; + // individual cell properties + self.label.text = title; + self.key = key; + self.binding = binding; + } + return self; +} + +- (void) layoutSubviews +{ + [super layoutSubviews]; + CGRect textFieldFrame = self.textField.frame; + textFieldFrame.size.width = self.textField.superview.bounds.size.width - textFieldFrame.origin.x - 5; + self.textField.frame = textFieldFrame; +} + +- (void) textFieldDidEndEditing:(UITextField *)textField +{ + [self.binding setObject:textField.text forKey:self.key]; +} + +@end + +@interface AddBookViewController () +@property (nonatomic, strong) NSMutableDictionary *values; +@property (nonatomic, strong) NSArray *cells; +@end + +@implementation AddBookViewController + +- (id)init { + if (self = [super initWithStyle:UITableViewStyleGrouped]) { + self.values = [[[NSUserDefaults standardUserDefaults] objectForKey:@"usergrid"] mutableCopy]; + if (!self.values) { + self.values = [NSMutableDictionary dictionary]; + } + self.cells = + @[[[FormTableViewCell alloc] initWithTitle:@"Title" key:@"title" binding:self.values], + [[FormTableViewCell alloc] initWithTitle:@"Author" key:@"author" binding:self.values]]; + } + return self; +} + +- (void) loadView +{ + [super loadView]; + self.title = @"Connection"; + self.tableView.backgroundView = nil; + self.tableView.backgroundColor = [UIColor darkGrayColor]; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] + initWithTitle:@"Cancel" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(cancel:)]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] + initWithTitle:@"Save" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(save:)]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return [self.cells count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return [self.cells objectAtIndex:[indexPath row]]; +} + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath +{ + FormTableViewCell *formCell = (FormTableViewCell *) cell; + formCell.textField.text = [formCell.binding objectForKey:formCell.key]; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + FormTableViewCell *formCell = (FormTableViewCell *)[tableView cellForRowAtIndexPath:indexPath]; + [formCell.textField becomeFirstResponder]; +} + +#pragma mark - Sign In + +- (void) cancel:(id) sender +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void) save:(id) sender +{ + for (FormTableViewCell *cell in self.cells) { + [cell.textField resignFirstResponder]; + } + UGConnection *connection = [UGConnection sharedConnection]; + [[[UGHTTPClient alloc] initWithRequest: + [connection createEntityInCollection:@"books" withValues:self.values]] + connectWithCompletionHandler:^(UGHTTPResult *result) { + [self dismissViewControllerAnimated:YES completion:nil]; + }]; +} + +@end
http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/AppDelegate.h ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/AppDelegate.h b/sdks/other/ios/samples/Books/books/AppDelegate.h new file mode 100644 index 0000000..185592e --- /dev/null +++ b/sdks/other/ios/samples/Books/books/AppDelegate.h @@ -0,0 +1,43 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// AppDelegate.h +// books +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import <UIKit/UIKit.h> + +@interface AppDelegate : UIResponder <UIApplicationDelegate> + +@property (strong, nonatomic) UIWindow *window; + +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/AppDelegate.m ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/AppDelegate.m b/sdks/other/ios/samples/Books/books/AppDelegate.m new file mode 100644 index 0000000..f1082ef --- /dev/null +++ b/sdks/other/ios/samples/Books/books/AppDelegate.m @@ -0,0 +1,43 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// AppDelegate.m +// books +// + +#import "AppDelegate.h" +#import "BooksViewController.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + UINavigationController *navigationController = [[UINavigationController alloc] + initWithRootViewController:[[BooksViewController alloc] init]]; + navigationController.navigationBar.tintColor = [UIColor colorWithRed:100.0/255.0 + green:150.0/255.0 + blue:200.0/255.0 + alpha:1]; + self.window.rootViewController = navigationController; + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; + return YES; +} + +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/BooksViewController.h ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/BooksViewController.h b/sdks/other/ios/samples/Books/books/BooksViewController.h new file mode 100644 index 0000000..b286c29 --- /dev/null +++ b/sdks/other/ios/samples/Books/books/BooksViewController.h @@ -0,0 +1,41 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// BooksViewController.h +// books +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import <UIKit/UIKit.h> + +@interface BooksViewController : UITableViewController + +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/BooksViewController.m ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/BooksViewController.m b/sdks/other/ios/samples/Books/books/BooksViewController.m new file mode 100644 index 0000000..44be61c --- /dev/null +++ b/sdks/other/ios/samples/Books/books/BooksViewController.m @@ -0,0 +1,154 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// BooksViewController.m +// books +// + +#import "BooksViewController.h" +#import "UGSignInViewController.h" +#import "UGConnection.h" +#import "UGHTTPClient.h" +#import "UGHTTPResult.h" +#import "AddBookViewController.h" + +@interface BooksViewController () +@property (nonatomic, strong) NSDictionary *content; +@end + +@implementation BooksViewController + +- (id)initWithStyle:(UITableViewStyle)style +{ + self = [super initWithStyle:style]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)loadView +{ + [super loadView]; + self.navigationItem.title = @"My Books"; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Add Book" + style:UIBarButtonItemStyleBordered target:self action:@selector(addbook:)]; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] + initWithTitle:@"Connection" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(connect:)]; +} + +- (void) connect:(id) sender +{ + UGSignInViewController *signinViewController = [[UGSignInViewController alloc] init]; + UINavigationController *signinNavigationController = + [[UINavigationController alloc] initWithRootViewController:signinViewController]; + signinNavigationController.modalPresentationStyle = UIModalPresentationFormSheet; + signinNavigationController.navigationBar.tintColor = self.navigationController.navigationBar.tintColor; + [self presentViewController:signinNavigationController animated:YES completion:nil]; +} + +- (void) addbook:(id) sender +{ + AddBookViewController *addBookViewController = [[AddBookViewController alloc] init]; + UINavigationController *navigationController = + [[UINavigationController alloc] initWithRootViewController:addBookViewController]; + navigationController.modalPresentationStyle = UIModalPresentationFormSheet; + navigationController.navigationBar.tintColor = self.navigationController.navigationBar.tintColor; + [self presentViewController:navigationController animated:YES completion:nil]; +} + +- (void) viewWillAppear:(BOOL)animated +{ + [self reload]; +} + +- (void) reload { + UGConnection *usergrid = [UGConnection sharedConnection]; + if ([usergrid isAuthenticated]) { + NSLog(@"loading..."); + UGHTTPClient *client = [[UGHTTPClient alloc] initWithRequest: + [usergrid getEntitiesInCollection:@"books" limit:100]]; + [client connectWithCompletionHandler:^(UGHTTPResult *result) { + NSLog(@"%@", result.object); + self.content = result.object; + [self.tableView reloadData]; + }]; + } +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + return self.content ? [self.content[@"entities"] count] : 1; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"]; +} + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (!self.content) { + cell.textLabel.text = @"Please sign in."; + } else { + id entity = self.content[@"entities"][[indexPath row]]; + cell.textLabel.text = entity[@"title"]; + cell.detailTextLabel.text = entity[@"author"]; + UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + cell.accessoryView = deleteButton; + [deleteButton setTitle:@"X" forState:UIControlStateNormal]; + deleteButton.tag = [indexPath row]; + [deleteButton addTarget:self action:@selector(deleteItem:) forControlEvents:UIControlEventTouchUpInside]; + [deleteButton sizeToFit]; + } + cell.selectionStyle = UITableViewCellSelectionStyleNone; +} + +- (void) deleteItem:(UIButton *) sender { + int row = [sender tag]; + id entity = self.content[@"entities"][row]; + NSString *uuid = [entity objectForKey:@"uuid"]; + UGHTTPClient *client = [[UGHTTPClient alloc] initWithRequest: + [[UGConnection sharedConnection] deleteEntity:uuid inCollection:@"books"]]; + [client connectWithCompletionHandler:^(UGHTTPResult *result) { + [self reload]; + }]; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (!self.content) { + [self connect:nil]; + } +} + +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/default-5...@2x.png ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/default-5...@2x.png b/sdks/other/ios/samples/Books/books/default-5...@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/sdks/other/ios/samples/Books/books/default-5...@2x.png differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/Default.png ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/Default.png b/sdks/other/ios/samples/Books/books/Default.png new file mode 100644 index 0000000..4c8ca6f Binary files /dev/null and b/sdks/other/ios/samples/Books/books/Default.png differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/defa...@2x.png ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/defa...@2x.png b/sdks/other/ios/samples/Books/books/defa...@2x.png new file mode 100644 index 0000000..35b84cf Binary files /dev/null and b/sdks/other/ios/samples/Books/books/defa...@2x.png differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/UGSignInViewController.h ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/UGSignInViewController.h b/sdks/other/ios/samples/Books/books/UGSignInViewController.h new file mode 100644 index 0000000..b831869 --- /dev/null +++ b/sdks/other/ios/samples/Books/books/UGSignInViewController.h @@ -0,0 +1,23 @@ +// +// UGSignInViewController.h +// books +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@class UGAppViewController; + +@interface UGSignInViewController : UITableViewController +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/UGSignInViewController.m ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/UGSignInViewController.m b/sdks/other/ios/samples/Books/books/UGSignInViewController.m new file mode 100644 index 0000000..6cccb77 --- /dev/null +++ b/sdks/other/ios/samples/Books/books/UGSignInViewController.m @@ -0,0 +1,184 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// UGSignInViewController.m +// books +// + + +#import "UGHTTPClient.h" +#import "UGConnection.h" +#import "UGSignInViewController.h" + +#define SERVER @"http://api.usergrid.com" + +@interface UGFormTableViewCell : UITableViewCell <UITextFieldDelegate> +@property (nonatomic, strong) UILabel *label; +@property (nonatomic, strong) UITextField *textField; +@property (nonatomic, strong) NSString *key; +@property (nonatomic, weak) id binding; +@end + +@implementation UGFormTableViewCell + +- (id) initWithTitle:(NSString *)title key:(NSString *) key binding:(id) binding +{ + if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"]) { + self.label = [[UILabel alloc] initWithFrame:CGRectMake(10,0,90,14)]; + self.label.backgroundColor = [UIColor clearColor]; + self.label.font = [UIFont systemFontOfSize:10]; + self.label.textColor = [UIColor grayColor]; + self.label.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.label]; + self.textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 14, 100, 30)]; + self.textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; + self.textField.font = [UIFont systemFontOfSize:18]; + self.textField.autocorrectionType = UITextAutocorrectionTypeNo; + self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone; + self.textField.delegate = self; + if ([key isEqualToString:@"password"]) { + self.textField.secureTextEntry = YES; + } + [self.contentView addSubview:self.textField]; + self.selectionStyle = UITableViewCellSelectionStyleNone; + // individual cell properties + self.label.text = title; + self.key = key; + self.binding = binding; + } + return self; +} + +- (void) layoutSubviews +{ + [super layoutSubviews]; + CGRect textFieldFrame = self.textField.frame; + textFieldFrame.size.width = self.textField.superview.bounds.size.width - textFieldFrame.origin.x - 5; + self.textField.frame = textFieldFrame; +} + +- (void) textFieldDidEndEditing:(UITextField *)textField +{ + [self.binding setObject:textField.text forKey:self.key]; +} + +@end + +@interface UGSignInViewController () +@property (nonatomic, strong) NSMutableDictionary *values; +@property (nonatomic, strong) NSArray *cells; +@end + +@implementation UGSignInViewController + +- (id)init { + if (self = [super initWithStyle:UITableViewStyleGrouped]) { + self.values = [[[NSUserDefaults standardUserDefaults] objectForKey:@"usergrid"] mutableCopy]; + if (!self.values) { + self.values = [NSMutableDictionary dictionary]; + [self.values setObject:SERVER forKey:@"server"]; + } + self.cells = + @[[[UGFormTableViewCell alloc] initWithTitle:@"Server" key:@"server" binding:self.values], + [[UGFormTableViewCell alloc] initWithTitle:@"Organization" key:@"organization" binding:self.values], + [[UGFormTableViewCell alloc] initWithTitle:@"Application" key:@"application" binding:self.values], + [[UGFormTableViewCell alloc] initWithTitle:@"Username" key:@"username" binding:self.values], + [[UGFormTableViewCell alloc] initWithTitle:@"Password" key:@"password" binding:self.values]]; + } + return self; +} + +- (void) loadView +{ + [super loadView]; + self.title = @"Connection"; + self.tableView.backgroundView = nil; + self.tableView.backgroundColor = [UIColor darkGrayColor]; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] + initWithTitle:@"Cancel" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(cancel:)]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] + initWithTitle:@"Sign In" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(signin:)]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return [self.cells count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return [self.cells objectAtIndex:[indexPath row]]; +} + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath +{ + UGFormTableViewCell *formCell = (UGFormTableViewCell *) cell; + formCell.textField.text = [formCell.binding objectForKey:formCell.key]; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + UGFormTableViewCell *formCell = (UGFormTableViewCell *)[tableView cellForRowAtIndexPath:indexPath]; + [formCell.textField becomeFirstResponder]; +} + +#pragma mark - Sign In + +- (void) cancel:(id) sender +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void) signin:(id) sender +{ + for (UGFormTableViewCell *cell in self.cells) { + [cell.textField resignFirstResponder]; + } + [[NSUserDefaults standardUserDefaults] setObject:self.values forKey:@"usergrid"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + + UGConnection *connection = [UGConnection sharedConnection]; + connection.server = [self.values objectForKey:@"server"]; + connection.organization = [self.values objectForKey:@"organization"]; + connection.application = [self.values objectForKey:@"application"]; + + [[[UGHTTPClient alloc] initWithRequest: + [connection getAccessTokenForApplicationWithUsername:[self.values objectForKey:@"username"] + password:[self.values objectForKey:@"password"]]] + connectWithCompletionHandler:^(UGHTTPResult *result) { + [connection authenticateWithResult:result]; + [self dismissViewControllerAnimated:YES completion:nil]; + }]; +} + +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/books-Info.plist ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/books-Info.plist b/sdks/other/ios/samples/Books/books/books-Info.plist new file mode 100644 index 0000000..f394f12 --- /dev/null +++ b/sdks/other/ios/samples/Books/books/books-Info.plist @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +--> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundleDisplayName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIdentifier</key> + <string>com.apigee.${PRODUCT_NAME:rfc1034identifier}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1.0</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>UIRequiredDeviceCapabilities</key> + <array> + <string>armv7</string> + </array> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> + <key>UISupportedInterfaceOrientations~ipad</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> +</dict> +</plist> http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/books-Prefix.pch ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/books-Prefix.pch b/sdks/other/ios/samples/Books/books/books-Prefix.pch new file mode 100644 index 0000000..42d6379 --- /dev/null +++ b/sdks/other/ios/samples/Books/books/books-Prefix.pch @@ -0,0 +1,31 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// Prefix header for all source files of the 'books' target in the 'books' project +// + +#import <Availability.h> + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iOS SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import <UIKit/UIKit.h> + #import <Foundation/Foundation.h> +#endif http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/en.lproj/InfoPlist.strings ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/en.lproj/InfoPlist.strings b/sdks/other/ios/samples/Books/books/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..7004264 --- /dev/null +++ b/sdks/other/ios/samples/Books/books/en.lproj/InfoPlist.strings @@ -0,0 +1,21 @@ +/* +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +*/ + +/* Localized versions of Info.plist keys */ + http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Books/books/main.m ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Books/books/main.m b/sdks/other/ios/samples/Books/books/main.m new file mode 100644 index 0000000..a3b2f01 --- /dev/null +++ b/sdks/other/ios/samples/Books/books/main.m @@ -0,0 +1,32 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// main.m +// books +// + +#import <UIKit/UIKit.h> + +#import "AppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser.xcodeproj/project.pbxproj ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser.xcodeproj/project.pbxproj b/sdks/other/ios/samples/Browser/browser.xcodeproj/project.pbxproj new file mode 100644 index 0000000..63320fd --- /dev/null +++ b/sdks/other/ios/samples/Browser/browser.xcodeproj/project.pbxproj @@ -0,0 +1,487 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 22FC709C1730595C00153630 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22FC709B1730595C00153630 /* UIKit.framework */; }; + 22FC709E1730595C00153630 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22FC709D1730595C00153630 /* Foundation.framework */; }; + 22FC70A01730595C00153630 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22FC709F1730595C00153630 /* CoreGraphics.framework */; }; + 22FC70A61730595C00153630 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 22FC70A41730595C00153630 /* InfoPlist.strings */; }; + 22FC70A81730595C00153630 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70A71730595C00153630 /* main.m */; }; + 22FC70AE1730595C00153630 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 22FC70AD1730595C00153630 /* Default.png */; }; + 22FC70B01730595C00153630 /* defa...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 22FC70AF1730595C00153630 /* defa...@2x.png */; }; + 22FC70B21730595C00153630 /* default-5...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 22FC70B11730595C00153630 /* default-5...@2x.png */; }; + 22FC70C41730639600153630 /* UGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70B91730639600153630 /* UGAppDelegate.m */; }; + 22FC70C51730639600153630 /* UGAppViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70BB1730639600153630 /* UGAppViewController.m */; }; + 22FC70C61730639600153630 /* UGCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70BD1730639600153630 /* UGCollectionViewController.m */; }; + 22FC70C71730639600153630 /* UGEntityViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70BF1730639600153630 /* UGEntityViewController.m */; }; + 22FC70C81730639600153630 /* UGSignInViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70C11730639600153630 /* UGSignInViewController.m */; }; + 22FC70C91730639600153630 /* UGTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70C31730639600153630 /* UGTextViewController.m */; }; + 22FC70FD173063AF00153630 /* NSObject+SBJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70CD173063AF00153630 /* NSObject+SBJson.m */; }; + 22FC70FE173063AF00153630 /* SBJsonParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70D0173063AF00153630 /* SBJsonParser.m */; }; + 22FC70FF173063AF00153630 /* SBJsonStreamParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70D2173063AF00153630 /* SBJsonStreamParser.m */; }; + 22FC7100173063AF00153630 /* SBJsonStreamParserAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70D4173063AF00153630 /* SBJsonStreamParserAccumulator.m */; }; + 22FC7101173063AF00153630 /* SBJsonStreamParserAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70D6173063AF00153630 /* SBJsonStreamParserAdapter.m */; }; + 22FC7102173063AF00153630 /* SBJsonStreamParserState.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70D8173063AF00153630 /* SBJsonStreamParserState.m */; }; + 22FC7103173063AF00153630 /* SBJsonStreamWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70DA173063AF00153630 /* SBJsonStreamWriter.m */; }; + 22FC7104173063AF00153630 /* SBJsonStreamWriterAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70DC173063AF00153630 /* SBJsonStreamWriterAccumulator.m */; }; + 22FC7105173063AF00153630 /* SBJsonStreamWriterState.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70DE173063AF00153630 /* SBJsonStreamWriterState.m */; }; + 22FC7106173063AF00153630 /* SBJsonTokeniser.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70E0173063AF00153630 /* SBJsonTokeniser.m */; }; + 22FC7107173063AF00153630 /* SBJsonUTF8Stream.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70E2173063AF00153630 /* SBJsonUTF8Stream.m */; }; + 22FC7108173063AF00153630 /* SBJsonWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70E4173063AF00153630 /* SBJsonWriter.m */; }; + 22FC7109173063AF00153630 /* UGActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70E6173063AF00153630 /* UGActivity.m */; }; + 22FC710A173063AF00153630 /* UGClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70E8173063AF00153630 /* UGClient.m */; }; + 22FC710B173063AF00153630 /* UGClientResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70EB173063AF00153630 /* UGClientResponse.m */; }; + 22FC710C173063AF00153630 /* UGHTTPManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70ED173063AF00153630 /* UGHTTPManager.m */; }; + 22FC710D173063AF00153630 /* UGMultiStepAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70EF173063AF00153630 /* UGMultiStepAction.m */; }; + 22FC710E173063AF00153630 /* UGQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70F1173063AF00153630 /* UGQuery.m */; }; + 22FC710F173063AF00153630 /* UGUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70F3173063AF00153630 /* UGUser.m */; }; + 22FC7110173063AF00153630 /* UGConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70F6173063AF00153630 /* UGConnection.m */; }; + 22FC7111173063AF00153630 /* UGHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70F8173063AF00153630 /* UGHTTPClient.m */; }; + 22FC7112173063AF00153630 /* UGHTTPHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70FA173063AF00153630 /* UGHTTPHelpers.m */; }; + 22FC7113173063AF00153630 /* UGHTTPResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FC70FC173063AF00153630 /* UGHTTPResult.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 22FC70981730595C00153630 /* browser.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = browser.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 22FC709B1730595C00153630 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 22FC709D1730595C00153630 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 22FC709F1730595C00153630 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 22FC70A31730595C00153630 /* browser-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "browser-Info.plist"; sourceTree = "<group>"; }; + 22FC70A51730595C00153630 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; + 22FC70A71730595C00153630 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 22FC70A91730595C00153630 /* browser-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "browser-Prefix.pch"; sourceTree = "<group>"; }; + 22FC70AD1730595C00153630 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; }; + 22FC70AF1730595C00153630 /* defa...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "defa...@2x.png"; sourceTree = "<group>"; }; + 22FC70B11730595C00153630 /* default-5...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "default-5...@2x.png"; sourceTree = "<group>"; }; + 22FC70B81730639600153630 /* UGAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGAppDelegate.h; sourceTree = "<group>"; }; + 22FC70B91730639600153630 /* UGAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGAppDelegate.m; sourceTree = "<group>"; }; + 22FC70BA1730639600153630 /* UGAppViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGAppViewController.h; sourceTree = "<group>"; }; + 22FC70BB1730639600153630 /* UGAppViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGAppViewController.m; sourceTree = "<group>"; }; + 22FC70BC1730639600153630 /* UGCollectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGCollectionViewController.h; sourceTree = "<group>"; }; + 22FC70BD1730639600153630 /* UGCollectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGCollectionViewController.m; sourceTree = "<group>"; }; + 22FC70BE1730639600153630 /* UGEntityViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGEntityViewController.h; sourceTree = "<group>"; }; + 22FC70BF1730639600153630 /* UGEntityViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGEntityViewController.m; sourceTree = "<group>"; }; + 22FC70C01730639600153630 /* UGSignInViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGSignInViewController.h; sourceTree = "<group>"; }; + 22FC70C11730639600153630 /* UGSignInViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGSignInViewController.m; sourceTree = "<group>"; }; + 22FC70C21730639600153630 /* UGTextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGTextViewController.h; sourceTree = "<group>"; }; + 22FC70C31730639600153630 /* UGTextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGTextViewController.m; sourceTree = "<group>"; }; + 22FC70CC173063AF00153630 /* NSObject+SBJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+SBJson.h"; sourceTree = "<group>"; }; + 22FC70CD173063AF00153630 /* NSObject+SBJson.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SBJson.m"; sourceTree = "<group>"; }; + 22FC70CE173063AF00153630 /* SBJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJson.h; sourceTree = "<group>"; }; + 22FC70CF173063AF00153630 /* SBJsonParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonParser.h; sourceTree = "<group>"; }; + 22FC70D0173063AF00153630 /* SBJsonParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonParser.m; sourceTree = "<group>"; }; + 22FC70D1173063AF00153630 /* SBJsonStreamParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonStreamParser.h; sourceTree = "<group>"; }; + 22FC70D2173063AF00153630 /* SBJsonStreamParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonStreamParser.m; sourceTree = "<group>"; }; + 22FC70D3173063AF00153630 /* SBJsonStreamParserAccumulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonStreamParserAccumulator.h; sourceTree = "<group>"; }; + 22FC70D4173063AF00153630 /* SBJsonStreamParserAccumulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonStreamParserAccumulator.m; sourceTree = "<group>"; }; + 22FC70D5173063AF00153630 /* SBJsonStreamParserAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonStreamParserAdapter.h; sourceTree = "<group>"; }; + 22FC70D6173063AF00153630 /* SBJsonStreamParserAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonStreamParserAdapter.m; sourceTree = "<group>"; }; + 22FC70D7173063AF00153630 /* SBJsonStreamParserState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonStreamParserState.h; sourceTree = "<group>"; }; + 22FC70D8173063AF00153630 /* SBJsonStreamParserState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonStreamParserState.m; sourceTree = "<group>"; }; + 22FC70D9173063AF00153630 /* SBJsonStreamWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonStreamWriter.h; sourceTree = "<group>"; }; + 22FC70DA173063AF00153630 /* SBJsonStreamWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonStreamWriter.m; sourceTree = "<group>"; }; + 22FC70DB173063AF00153630 /* SBJsonStreamWriterAccumulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonStreamWriterAccumulator.h; sourceTree = "<group>"; }; + 22FC70DC173063AF00153630 /* SBJsonStreamWriterAccumulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonStreamWriterAccumulator.m; sourceTree = "<group>"; }; + 22FC70DD173063AF00153630 /* SBJsonStreamWriterState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonStreamWriterState.h; sourceTree = "<group>"; }; + 22FC70DE173063AF00153630 /* SBJsonStreamWriterState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonStreamWriterState.m; sourceTree = "<group>"; }; + 22FC70DF173063AF00153630 /* SBJsonTokeniser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonTokeniser.h; sourceTree = "<group>"; }; + 22FC70E0173063AF00153630 /* SBJsonTokeniser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonTokeniser.m; sourceTree = "<group>"; }; + 22FC70E1173063AF00153630 /* SBJsonUTF8Stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonUTF8Stream.h; sourceTree = "<group>"; }; + 22FC70E2173063AF00153630 /* SBJsonUTF8Stream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonUTF8Stream.m; sourceTree = "<group>"; }; + 22FC70E3173063AF00153630 /* SBJsonWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonWriter.h; sourceTree = "<group>"; }; + 22FC70E4173063AF00153630 /* SBJsonWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonWriter.m; sourceTree = "<group>"; }; + 22FC70E5173063AF00153630 /* UGActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGActivity.h; sourceTree = "<group>"; }; + 22FC70E6173063AF00153630 /* UGActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGActivity.m; sourceTree = "<group>"; }; + 22FC70E7173063AF00153630 /* UGClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGClient.h; sourceTree = "<group>"; }; + 22FC70E8173063AF00153630 /* UGClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGClient.m; sourceTree = "<group>"; }; + 22FC70E9173063AF00153630 /* UGClientDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGClientDelegate.h; sourceTree = "<group>"; }; + 22FC70EA173063AF00153630 /* UGClientResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGClientResponse.h; sourceTree = "<group>"; }; + 22FC70EB173063AF00153630 /* UGClientResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGClientResponse.m; sourceTree = "<group>"; }; + 22FC70EC173063AF00153630 /* UGHTTPManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGHTTPManager.h; sourceTree = "<group>"; }; + 22FC70ED173063AF00153630 /* UGHTTPManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGHTTPManager.m; sourceTree = "<group>"; }; + 22FC70EE173063AF00153630 /* UGMultiStepAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGMultiStepAction.h; sourceTree = "<group>"; }; + 22FC70EF173063AF00153630 /* UGMultiStepAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGMultiStepAction.m; sourceTree = "<group>"; }; + 22FC70F0173063AF00153630 /* UGQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGQuery.h; sourceTree = "<group>"; }; + 22FC70F1173063AF00153630 /* UGQuery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGQuery.m; sourceTree = "<group>"; }; + 22FC70F2173063AF00153630 /* UGUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGUser.h; sourceTree = "<group>"; }; + 22FC70F3173063AF00153630 /* UGUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGUser.m; sourceTree = "<group>"; }; + 22FC70F5173063AF00153630 /* UGConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGConnection.h; sourceTree = "<group>"; }; + 22FC70F6173063AF00153630 /* UGConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGConnection.m; sourceTree = "<group>"; }; + 22FC70F7173063AF00153630 /* UGHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGHTTPClient.h; sourceTree = "<group>"; }; + 22FC70F8173063AF00153630 /* UGHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGHTTPClient.m; sourceTree = "<group>"; }; + 22FC70F9173063AF00153630 /* UGHTTPHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGHTTPHelpers.h; sourceTree = "<group>"; }; + 22FC70FA173063AF00153630 /* UGHTTPHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGHTTPHelpers.m; sourceTree = "<group>"; }; + 22FC70FB173063AF00153630 /* UGHTTPResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UGHTTPResult.h; sourceTree = "<group>"; }; + 22FC70FC173063AF00153630 /* UGHTTPResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UGHTTPResult.m; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 22FC70951730595C00153630 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 22FC709C1730595C00153630 /* UIKit.framework in Frameworks */, + 22FC709E1730595C00153630 /* Foundation.framework in Frameworks */, + 22FC70A01730595C00153630 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 22FC708F1730595C00153630 = { + isa = PBXGroup; + children = ( + 22FC70CA173063AF00153630 /* UGAPI */, + 22FC70A11730595C00153630 /* browser */, + 22FC709A1730595C00153630 /* Frameworks */, + 22FC70991730595C00153630 /* Products */, + ); + sourceTree = "<group>"; + }; + 22FC70991730595C00153630 /* Products */ = { + isa = PBXGroup; + children = ( + 22FC70981730595C00153630 /* browser.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 22FC709A1730595C00153630 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 22FC709B1730595C00153630 /* UIKit.framework */, + 22FC709D1730595C00153630 /* Foundation.framework */, + 22FC709F1730595C00153630 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 22FC70A11730595C00153630 /* browser */ = { + isa = PBXGroup; + children = ( + 22FC70B81730639600153630 /* UGAppDelegate.h */, + 22FC70B91730639600153630 /* UGAppDelegate.m */, + 22FC70BA1730639600153630 /* UGAppViewController.h */, + 22FC70BB1730639600153630 /* UGAppViewController.m */, + 22FC70BC1730639600153630 /* UGCollectionViewController.h */, + 22FC70BD1730639600153630 /* UGCollectionViewController.m */, + 22FC70BE1730639600153630 /* UGEntityViewController.h */, + 22FC70BF1730639600153630 /* UGEntityViewController.m */, + 22FC70C01730639600153630 /* UGSignInViewController.h */, + 22FC70C11730639600153630 /* UGSignInViewController.m */, + 22FC70C21730639600153630 /* UGTextViewController.h */, + 22FC70C31730639600153630 /* UGTextViewController.m */, + 22FC70A21730595C00153630 /* Supporting Files */, + ); + path = browser; + sourceTree = "<group>"; + }; + 22FC70A21730595C00153630 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 22FC70A31730595C00153630 /* browser-Info.plist */, + 22FC70A41730595C00153630 /* InfoPlist.strings */, + 22FC70A71730595C00153630 /* main.m */, + 22FC70A91730595C00153630 /* browser-Prefix.pch */, + 22FC70AD1730595C00153630 /* Default.png */, + 22FC70AF1730595C00153630 /* defa...@2x.png */, + 22FC70B11730595C00153630 /* default-5...@2x.png */, + ); + name = "Supporting Files"; + sourceTree = "<group>"; + }; + 22FC70CA173063AF00153630 /* UGAPI */ = { + isa = PBXGroup; + children = ( + 22FC70CB173063AF00153630 /* SBJson */, + 22FC70E5173063AF00153630 /* UGActivity.h */, + 22FC70E6173063AF00153630 /* UGActivity.m */, + 22FC70E7173063AF00153630 /* UGClient.h */, + 22FC70E8173063AF00153630 /* UGClient.m */, + 22FC70E9173063AF00153630 /* UGClientDelegate.h */, + 22FC70EA173063AF00153630 /* UGClientResponse.h */, + 22FC70EB173063AF00153630 /* UGClientResponse.m */, + 22FC70EC173063AF00153630 /* UGHTTPManager.h */, + 22FC70ED173063AF00153630 /* UGHTTPManager.m */, + 22FC70EE173063AF00153630 /* UGMultiStepAction.h */, + 22FC70EF173063AF00153630 /* UGMultiStepAction.m */, + 22FC70F0173063AF00153630 /* UGQuery.h */, + 22FC70F1173063AF00153630 /* UGQuery.m */, + 22FC70F2173063AF00153630 /* UGUser.h */, + 22FC70F3173063AF00153630 /* UGUser.m */, + 22FC70F4173063AF00153630 /* v2 */, + ); + name = UGAPI; + path = ../../UGAPI; + sourceTree = "<group>"; + }; + 22FC70CB173063AF00153630 /* SBJson */ = { + isa = PBXGroup; + children = ( + 22FC70CC173063AF00153630 /* NSObject+SBJson.h */, + 22FC70CD173063AF00153630 /* NSObject+SBJson.m */, + 22FC70CE173063AF00153630 /* SBJson.h */, + 22FC70CF173063AF00153630 /* SBJsonParser.h */, + 22FC70D0173063AF00153630 /* SBJsonParser.m */, + 22FC70D1173063AF00153630 /* SBJsonStreamParser.h */, + 22FC70D2173063AF00153630 /* SBJsonStreamParser.m */, + 22FC70D3173063AF00153630 /* SBJsonStreamParserAccumulator.h */, + 22FC70D4173063AF00153630 /* SBJsonStreamParserAccumulator.m */, + 22FC70D5173063AF00153630 /* SBJsonStreamParserAdapter.h */, + 22FC70D6173063AF00153630 /* SBJsonStreamParserAdapter.m */, + 22FC70D7173063AF00153630 /* SBJsonStreamParserState.h */, + 22FC70D8173063AF00153630 /* SBJsonStreamParserState.m */, + 22FC70D9173063AF00153630 /* SBJsonStreamWriter.h */, + 22FC70DA173063AF00153630 /* SBJsonStreamWriter.m */, + 22FC70DB173063AF00153630 /* SBJsonStreamWriterAccumulator.h */, + 22FC70DC173063AF00153630 /* SBJsonStreamWriterAccumulator.m */, + 22FC70DD173063AF00153630 /* SBJsonStreamWriterState.h */, + 22FC70DE173063AF00153630 /* SBJsonStreamWriterState.m */, + 22FC70DF173063AF00153630 /* SBJsonTokeniser.h */, + 22FC70E0173063AF00153630 /* SBJsonTokeniser.m */, + 22FC70E1173063AF00153630 /* SBJsonUTF8Stream.h */, + 22FC70E2173063AF00153630 /* SBJsonUTF8Stream.m */, + 22FC70E3173063AF00153630 /* SBJsonWriter.h */, + 22FC70E4173063AF00153630 /* SBJsonWriter.m */, + ); + path = SBJson; + sourceTree = "<group>"; + }; + 22FC70F4173063AF00153630 /* v2 */ = { + isa = PBXGroup; + children = ( + 22FC70F5173063AF00153630 /* UGConnection.h */, + 22FC70F6173063AF00153630 /* UGConnection.m */, + 22FC70F7173063AF00153630 /* UGHTTPClient.h */, + 22FC70F8173063AF00153630 /* UGHTTPClient.m */, + 22FC70F9173063AF00153630 /* UGHTTPHelpers.h */, + 22FC70FA173063AF00153630 /* UGHTTPHelpers.m */, + 22FC70FB173063AF00153630 /* UGHTTPResult.h */, + 22FC70FC173063AF00153630 /* UGHTTPResult.m */, + ); + path = v2; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 22FC70971730595C00153630 /* browser */ = { + isa = PBXNativeTarget; + buildConfigurationList = 22FC70B51730595C00153630 /* Build configuration list for PBXNativeTarget "browser" */; + buildPhases = ( + 22FC70941730595C00153630 /* Sources */, + 22FC70951730595C00153630 /* Frameworks */, + 22FC70961730595C00153630 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = browser; + productName = browser; + productReference = 22FC70981730595C00153630 /* browser.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 22FC70901730595C00153630 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0460; + ORGANIZATIONNAME = "Radtastical Inc."; + }; + buildConfigurationList = 22FC70931730595C00153630 /* Build configuration list for PBXProject "browser" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 22FC708F1730595C00153630; + productRefGroup = 22FC70991730595C00153630 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 22FC70971730595C00153630 /* browser */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 22FC70961730595C00153630 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22FC70A61730595C00153630 /* InfoPlist.strings in Resources */, + 22FC70AE1730595C00153630 /* Default.png in Resources */, + 22FC70B01730595C00153630 /* defa...@2x.png in Resources */, + 22FC70B21730595C00153630 /* default-5...@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 22FC70941730595C00153630 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22FC70A81730595C00153630 /* main.m in Sources */, + 22FC70C41730639600153630 /* UGAppDelegate.m in Sources */, + 22FC70C51730639600153630 /* UGAppViewController.m in Sources */, + 22FC70C61730639600153630 /* UGCollectionViewController.m in Sources */, + 22FC70C71730639600153630 /* UGEntityViewController.m in Sources */, + 22FC70C81730639600153630 /* UGSignInViewController.m in Sources */, + 22FC70C91730639600153630 /* UGTextViewController.m in Sources */, + 22FC70FD173063AF00153630 /* NSObject+SBJson.m in Sources */, + 22FC70FE173063AF00153630 /* SBJsonParser.m in Sources */, + 22FC70FF173063AF00153630 /* SBJsonStreamParser.m in Sources */, + 22FC7100173063AF00153630 /* SBJsonStreamParserAccumulator.m in Sources */, + 22FC7101173063AF00153630 /* SBJsonStreamParserAdapter.m in Sources */, + 22FC7102173063AF00153630 /* SBJsonStreamParserState.m in Sources */, + 22FC7103173063AF00153630 /* SBJsonStreamWriter.m in Sources */, + 22FC7104173063AF00153630 /* SBJsonStreamWriterAccumulator.m in Sources */, + 22FC7105173063AF00153630 /* SBJsonStreamWriterState.m in Sources */, + 22FC7106173063AF00153630 /* SBJsonTokeniser.m in Sources */, + 22FC7107173063AF00153630 /* SBJsonUTF8Stream.m in Sources */, + 22FC7108173063AF00153630 /* SBJsonWriter.m in Sources */, + 22FC7109173063AF00153630 /* UGActivity.m in Sources */, + 22FC710A173063AF00153630 /* UGClient.m in Sources */, + 22FC710B173063AF00153630 /* UGClientResponse.m in Sources */, + 22FC710C173063AF00153630 /* UGHTTPManager.m in Sources */, + 22FC710D173063AF00153630 /* UGMultiStepAction.m in Sources */, + 22FC710E173063AF00153630 /* UGQuery.m in Sources */, + 22FC710F173063AF00153630 /* UGUser.m in Sources */, + 22FC7110173063AF00153630 /* UGConnection.m in Sources */, + 22FC7111173063AF00153630 /* UGHTTPClient.m in Sources */, + 22FC7112173063AF00153630 /* UGHTTPHelpers.m in Sources */, + 22FC7113173063AF00153630 /* UGHTTPResult.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 22FC70A41730595C00153630 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 22FC70A51730595C00153630 /* en */, + ); + name = InfoPlist.strings; + sourceTree = "<group>"; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 22FC70B31730595C00153630 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.1; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 22FC70B41730595C00153630 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.1; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 22FC70B61730595C00153630 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "browser/browser-Prefix.pch"; + INFOPLIST_FILE = "browser/browser-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 22FC70B71730595C00153630 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "browser/browser-Prefix.pch"; + INFOPLIST_FILE = "browser/browser-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 22FC70931730595C00153630 /* Build configuration list for PBXProject "browser" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 22FC70B31730595C00153630 /* Debug */, + 22FC70B41730595C00153630 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 22FC70B51730595C00153630 /* Build configuration list for PBXNativeTarget "browser" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 22FC70B61730595C00153630 /* Debug */, + 22FC70B71730595C00153630 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 22FC70901730595C00153630 /* Project object */; +} http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/default-5...@2x.png ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/default-5...@2x.png b/sdks/other/ios/samples/Browser/browser/default-5...@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/sdks/other/ios/samples/Browser/browser/default-5...@2x.png differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/Default.png ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/Default.png b/sdks/other/ios/samples/Browser/browser/Default.png new file mode 100644 index 0000000..4c8ca6f Binary files /dev/null and b/sdks/other/ios/samples/Browser/browser/Default.png differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/defa...@2x.png ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/defa...@2x.png b/sdks/other/ios/samples/Browser/browser/defa...@2x.png new file mode 100644 index 0000000..35b84cf Binary files /dev/null and b/sdks/other/ios/samples/Browser/browser/defa...@2x.png differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/UGAppDelegate.h ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/UGAppDelegate.h b/sdks/other/ios/samples/Browser/browser/UGAppDelegate.h new file mode 100644 index 0000000..fb1453f --- /dev/null +++ b/sdks/other/ios/samples/Browser/browser/UGAppDelegate.h @@ -0,0 +1,24 @@ +// +// UGAppDelegate.h +// Browser +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@interface UGAppDelegate : UIResponder <UIApplicationDelegate> + +@property (strong, nonatomic) UIWindow *window; + +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/UGAppDelegate.m ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/UGAppDelegate.m b/sdks/other/ios/samples/Browser/browser/UGAppDelegate.m new file mode 100644 index 0000000..246a860 --- /dev/null +++ b/sdks/other/ios/samples/Browser/browser/UGAppDelegate.m @@ -0,0 +1,39 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// UGAppDelegate.m +// Browser +// + +#import "UGAppDelegate.h" +#import "UGAppViewController.h" + +@implementation UGAppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + UINavigationController *navigationController = [[UINavigationController alloc] + initWithRootViewController:[[UGAppViewController alloc] init]]; + navigationController.navigationBar.tintColor = [UIColor darkGrayColor]; + self.window.rootViewController = navigationController; + [self.window makeKeyAndVisible]; + return YES; +} + +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/UGAppViewController.h ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/UGAppViewController.h b/sdks/other/ios/samples/Browser/browser/UGAppViewController.h new file mode 100644 index 0000000..7f26de9 --- /dev/null +++ b/sdks/other/ios/samples/Browser/browser/UGAppViewController.h @@ -0,0 +1,27 @@ +// +// UGAppViewController.h +// Browser +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@interface UGAppViewController : UITableViewController +@property (nonatomic, strong) NSDictionary *application; + + +- (void) downloadApplicationDescription; + +@end + http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/UGAppViewController.m ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/UGAppViewController.m b/sdks/other/ios/samples/Browser/browser/UGAppViewController.m new file mode 100644 index 0000000..b298fe1 --- /dev/null +++ b/sdks/other/ios/samples/Browser/browser/UGAppViewController.m @@ -0,0 +1,143 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// UGAppViewController.m +// Browser +// + +#import "UGHTTPClient.h" +#import "UGHTTPResult.h" +#import "UGConnection.h" +#import "UGAppViewController.h" +#import "UGSignInViewController.h" +#import "UGCollectionViewController.h" + +@interface UGAppViewController () + +@end + +@implementation UGAppViewController + +- (void) loadView +{ + [super loadView]; + self.navigationItem.title = @"Usergrid"; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] + initWithTitle:@"Connection" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(connect:)]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); + } else { + return YES; + } +} + +- (void) connect:(id) sender +{ + UGSignInViewController *signinViewController = [[UGSignInViewController alloc] init]; + signinViewController.appViewController = self; + UINavigationController *signinNavigationController = + [[UINavigationController alloc] initWithRootViewController:signinViewController]; + signinNavigationController.modalPresentationStyle = UIModalPresentationFormSheet; + signinNavigationController.navigationBar.tintColor = self.navigationController.navigationBar.tintColor; + [self presentModalViewController:signinNavigationController animated:YES]; +} + +- (void) downloadApplicationDescription +{ + UGConnection *usergrid = [UGConnection sharedConnection]; + [[[UGHTTPClient alloc] + initWithRequest:[usergrid getApplication:usergrid.application inOrganization:usergrid.organization]] + connectWithCompletionHandler:^(UGHTTPResult *result) { + self.application = result.object[@"entities"][0]; + [self.tableView reloadData]; + }]; +} + +- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView +{ + return self.application ? 2 : 0; +} + +- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + if (section == 0) { + return self.application ? 1 : 0; + } else if (section == 1) { + return self.application ? [self.application[@"metadata"][@"collections"] count] : 0; + } else { + return 0; + } +} + +- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"]; + cell.backgroundColor = [UIColor whiteColor]; + return cell; +} + +- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([indexPath section] == 0) { + cell.textLabel.text = self.application[@"name"]; + cell.accessoryType = UITableViewCellAccessoryNone; + } else { + NSDictionary *collections = self.application[@"metadata"][@"collections"]; + NSString *key = [[[collections allKeys] sortedArrayUsingSelector:@selector(compare:)] objectAtIndex:[indexPath row]]; + NSDictionary *object = collections[key]; + cell.textLabel.text = [NSString stringWithFormat:@"%@", + object[@"title"]]; + cell.detailTextLabel.text = [NSString stringWithFormat:@"name:%@ type:%@", + object[@"name"], + object[@"type"]]; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + } + cell.backgroundColor = [UIColor whiteColor]; + cell.selectionStyle = UITableViewCellSelectionStyleGray; +} + +- (NSString *) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + if (section == 0) { + return @"Application"; + } else { + return @"Collections"; + } +} + +- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + if ([indexPath section] == 1) { + NSDictionary *collections = self.application[@"metadata"][@"collections"]; + NSString *key = [[[collections allKeys] sortedArrayUsingSelector:@selector(compare:)] objectAtIndex:[indexPath row]]; + NSDictionary *collection = collections[key]; + UGCollectionViewController *collectionViewController = [[UGCollectionViewController alloc] init]; + collectionViewController.collection = collection; + [self.navigationController pushViewController:collectionViewController animated:YES]; + } +} + +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/UGCollectionViewController.h ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/UGCollectionViewController.h b/sdks/other/ios/samples/Browser/browser/UGCollectionViewController.h new file mode 100644 index 0000000..1b0074b --- /dev/null +++ b/sdks/other/ios/samples/Browser/browser/UGCollectionViewController.h @@ -0,0 +1,23 @@ +// +// UGCollectionViewController.h +// Browser +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@interface UGCollectionViewController : UITableViewController +@property (nonatomic, strong) NSDictionary *collection; +@property (nonatomic, strong) NSDictionary *collectionDetail; +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/ios/samples/Browser/browser/UGCollectionViewController.m ---------------------------------------------------------------------- diff --git a/sdks/other/ios/samples/Browser/browser/UGCollectionViewController.m b/sdks/other/ios/samples/Browser/browser/UGCollectionViewController.m new file mode 100644 index 0000000..720bd09 --- /dev/null +++ b/sdks/other/ios/samples/Browser/browser/UGCollectionViewController.m @@ -0,0 +1,115 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// UGCollectionViewController.m +// Browser +// + +#import "UGHTTPClient.h" +#import "UGHTTPResult.h" +#import "UGConnection.h" +#import "UGCollectionViewController.h" +#import "UGEntityViewController.h" + +@interface UGCollectionViewController () + +@end + +@implementation UGCollectionViewController + +- (id)initWithStyle:(UITableViewStyle)style +{ + self = [super initWithStyle:style]; + if (self) { + // Custom initialization + } + return self; +} + +- (void) loadView +{ + [super loadView]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void) getCollection +{ + [[[UGHTTPClient alloc] initWithRequest:[[UGConnection sharedConnection] + getEntitiesInCollection:self.collection[@"name"] + limit:200]] + connectWithCompletionHandler:^(UGHTTPResult *result) { + self.collectionDetail = result.object; + [self.tableView reloadData]; + self.navigationItem.title = result.object[@"path"]; + }]; +} + +- (void) viewWillAppear:(BOOL)animated +{ + [self getCollection]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + if (!self.collectionDetail) { + return 0; + } else { + return [self.collectionDetail[@"count"] intValue]; + } +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"]; + cell.textLabel.font = [UIFont boldSystemFontOfSize:14]; + return cell; +} + +- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath +{ + int row = [indexPath row]; + NSDictionary *entity = self.collectionDetail[@"entities"][row]; + cell.textLabel.text = entity[@"name"]; + cell.detailTextLabel.text = entity[@"uuid"]; +} + + + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + UGEntityViewController *entityViewController = [[UGEntityViewController alloc] init]; + int row = [indexPath row]; + entityViewController.entity = self.collectionDetail[@"entities"][row]; + [self.navigationController pushViewController:entityViewController animated:YES]; +} + +@end