Skip to content

Instantly share code, notes, and snippets.

View ahmetardal's full-sized avatar

Ahmet Ardal ahmetardal

View GitHub Profile
//
// UIScreen+Utils.m
// LiveGO
//
// Created by Ahmet Ardal on 2/3/11.
// Copyright 2011 MessengerFX. All rights reserved.
//
#import "UIScreen+Utils.h"
/*!
@method
@abstract adds images to the queue and starts the operation queue to download them
*/
- (void) addImagesToQueue:(NSArray *)images
{
NSLog(@"AsyncImageLoadingViewController::addImagesToQueue called");
[self.imageQueue addObjectsFromArray:images];
//
// UINavigationBar+CustomBackground.h
// CustomizingNavigationBarBackground
//
// Created by Ahmet Ardal on 2/10/11.
// Copyright 2011 LiveGO. All rights reserved.
//
#import <Foundation/Foundation.h>
@ahmetardal
ahmetardal / initializing_animation_timers.m
Created April 25, 2011 10:30
EyeballAnimation Demo App
- (void) initializeTimerWithNSTimer
{
CGFloat interval = 1.0f / 50.0f;
[NSTimer scheduledTimerWithTimeInterval:interval
target:self
selector:@selector(animateBallNSTimer:)
userInfo:nil
repeats:YES];
}
[[SSLocationManager sharedManager] addDelegate:self];
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellId = @"CopyableCell";
CopyableCell *cell = (CopyableCell *) [tableView dequeueReusableCellWithIdentifier:cellId];
if (cell == nil) {
cell = [[[CopyableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId] autorelease];
}
[cell setIndexPath:indexPath];
[cell setDelegate:self];
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellId = @"EmailableCell";
EmailableCell *cell = (EmailableCell *) [tableView dequeueReusableCellWithIdentifier:cellId];
if (cell == nil) {
cell = [[[EmailableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId] autorelease];
}
[cell setIndexPath:indexPath];
[cell setDelegate:self];
@ahmetardal
ahmetardal / UIWebViewHttpStatusCodeHandling_checksession.m
Created August 18, 2011 11:17
UIWebViewHttpStatusCodeHandling
#pragma mark -
#pragma mark UIWebViewDelegate Methods
- (BOOL) webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType
{
if (_sessionChecked) {
[self log:@"session already checked."];
return YES;
@ahmetardal
ahmetardal / SSPhotoCropperDelegate.m
Created October 17, 2011 09:21
SSPhotoCropperViewController
@protocol SSPhotoCropperDelegate<NSObject>
@optional
- (void) photoCropper:(SSPhotoCropperViewController *)photoCropper
didCropPhoto:(UIImage *)photo;
- (void) photoCropperDidCancel:(SSPhotoCropperViewController *)photoCropper;
@end
- (void) viewDidLoad
{
[super viewDidLoad];
SSCheckBoxView *cbv = [[SSCheckBoxView alloc] initWithFrame:CGRectMake(20, 20, 200, 30)
style:kSSCheckBoxViewStyleGlossy
checked:YES];
[cbv setText:@"Check updates?"];
[self.view addSubview:cbv];
[cbv release];