This file contains hidden or 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
// To create a coupon or storecard feature in your app | |
// you can do the following | |
@interface Card : NSObject <KCSPersistable> | |
@property (nonatomic, retain) NSString *cardId; | |
@property (nonatomic, retain) NSString *code; | |
@property (nonatomic, retain) NSString *cardName; | |
@property (nonatomic, retain) NSString *firstName; | |
@property (nonatomic, retain) NSString *lastName; |
This file contains hidden or 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
<script type="text/javascript"> | |
// First let's create an array of JavaScript Date | |
// objects. | |
// More info about the Date class: | |
// http://w3schools.com/js/js_obj_date.asp | |
var dates = [ | |
new Date(2010, 4, 10, 10, 07, 16), | |
new Date(2010, 4, 8, 9, 16, 09), | |
new Date(2010, 3, 30, 0, 15, 49), |
This file contains hidden or 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
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds))]; | |
scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; | |
scrollView.pagingEnabled = YES; | |
[self.view addSubview:scrollView]; | |
NSArray *images = @[@"image1", @"image2", @"image3"]; | |
[images enumerateObjectsUsingBlock:^(NSString *imageName, NSUInteger idx, BOOL *stop) { | |
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]]; | |
imageView.frame = CGRectMake(idx * CGRectGetWidth(self.view.bounds), 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds)); | |
[self.scrollView addSubview:imageView]; |
This file contains hidden or 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
// | |
// CCamera.h | |
// CCamera | |
// | |
// Created by Jonathan Wight on 7/12/12. | |
// Copyright (c) 2012 Jonathan Wight. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains hidden or 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)setupCaptureSession | |
{ | |
NSError *error = nil; | |
AVCaptureSession *session = [[AVCaptureSession alloc] init]; | |
session.sessionPreset = AVCaptureSessionPresetMedium; | |
AVCaptureDevice *device = [AVCaptureDevice | |
defaultDeviceWithMediaType:AVMediaTypeVideo]; |
This file contains hidden or 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 <UIKit/UIKit.h> | |
@interface MySegueWithCustomAnimation : UIStoryboardSegue | |
@end |
This file contains hidden or 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
GlobalConfiguration.Configuration.IncludeErrorDetailPolicy | |
= IncludeErrorDetailPolicy.Always; |
This file contains hidden or 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
var family = [{ | |
"name" : "Jason", | |
"age" : "24", | |
"gender" : "male" | |
}, | |
{ | |
"name" : "Kyle", | |
"age" : "21", | |
"gender" : "male" | |
}]; |
This file contains hidden or 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
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:@"http://someurl/blah]; | |
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id resultJSON) { | |
[self processResult:resultJSON]; | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
[self processFailuer:error]; | |
}]; | |
[operation start]; |
OlderNewer