This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ASCScreenBrightnessDetector *brightnessDetector = | |
[ASCScreenBrightnessDetector new]; | |
brightnessDetector.delegate = self; | |
- (void)screenBrightnessDidChange:(CGFloat)brightness { | |
NSLog(@"Brightness is: %f", brightness); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef __OBJC__ | |
#import <UIKit/UIKit.h> | |
#import <Foundation/Foundation.h> | |
#import "BAAClient.h" | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[BaasBox setBaseURL:@"http://localhost:9000" | |
appCode:@"1234567890"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) createUser { | |
BAAClient *client = [BAAClient sharedClient]; | |
[client createUserWithUsername:@"cesare" | |
password:@"password" | |
completion:^(BOOL success, NSError *error) { | |
if (success) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) uploadFile { | |
NSURL *imgPath = [[NSBundle mainBundle] URLForResource:@"baasbox" withExtension:@"png"]; | |
NSString* stringPath = [imgPath absoluteString]; | |
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:stringPath]]; | |
BAAFile *myLocalFile = [[BAAFile alloc] initWithData:data]; | |
myLocalFile.contentType = @"image/png"; | |
[myLocalFile uploadFileWithPermissions:nil | |
completion:^(BAAFile *file, NSError *error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Availability.h> | |
#ifndef __IPHONE_5_0 | |
#warning "This project uses features only available in iOS SDK 5.0 and later." | |
#endif | |
#ifdef __OBJC__ | |
#import <UIKit/UIKit.h> | |
#import <Foundation/Foundation.h> | |
#import "BAAClient.h" // < added import statement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SMPost : BAAObject | |
...; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (instancetype) initWithDictionary:(NSDictionary *)dictionary { | |
self = [super initWithDictionary:dictionary]; | |
if (self) { | |
_postTitle = dictionary[@"postTitle"]; | |
_postBody = dictionary[@"postBody"]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)collectionName { | |
return @"document/memos"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewWillAppear:(BOOL)animated { | |
[super viewWillAppear:animated]; | |
BAAClient *client = [BAAClient sharedClient]; | |
if (client.isAuthenticated) { | |
NSLog(@"Logged in"); | |
OlderNewer