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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.clayallsopp.isawesome" | |
android:versionCode="1" | |
android:versionName="1.0"> | |
<application android:icon="@drawable/icon" android:label="@string/app_name"> | |
<activity android:name=".OfflineListActivity" | |
android:label="@string/app_name"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> |
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
// 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 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 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
//Loop assemblies ,loop types, check if implemented | |
var type = typeof(IMyInteraface); | |
var types = AppDomain.CurrentDomain.GetAssemblies().ToList() | |
.SelectMany(s => s.GetTypes()) | |
.Where(p => type.IsAssignableFrom(p)); |
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
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 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 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 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
//basic alert view , remember <UIAlertViewDelegate> | |
- (IBAction)showMessage:(id)sender { | |
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Hello World!" | |
message:@"This is your UIAlertview message." | |
delegate:nil | |
cancelButtonTitle:@"OK" | |
otherButtonTitles:nil]; | |
[message show]; | |
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex |
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 <UIKit/UIKit.h> | |
@interface MySegueWithCustomAnimation : UIStoryboardSegue | |
@end |
OlderNewer