Skip to content

Instantly share code, notes, and snippets.

View aliHafizji's full-sized avatar

Kauserali aliHafizji

View GitHub Profile
RKObjectManager *objectManager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:BASE_URL]];
objectManager.acceptMIMEType = RKMIMETypeJSON;
RKObjectMapping *sessionMapping = [RKObjectMapping mappingForClass:[Session class]];
[sessionMapping mapKeyPath:@"SessionKey" toAttribute:@"sessionKey"];
[sessionMapping mapKeyPath:@"WindowTime" toAttribute:@"windowTime"];
[sessionMapping mapKeyPath:@"IsNonSliding" toAttribute:@"isNonSliding"];
[objectManager.mappingProvider setMapping:sessionMapping forKeyPath:@"Session"];
[RKObjectManager setSharedManager:objectManager];
Pod::Spec.new do |s|
s.name = "Kal"
s.version = "1.0rc1"
s.summary = "A calendar component for the iPhone (the UI is designed to match MobileCal)."
s.description = <<-DESC
This project aims to provide an open-source implementation of the month view in Apple's mobile calendar app (MobileCal). When the user taps a day on the calendar, any associated data for that day will be displayed in a table view directly below the calendar. As a client of the Kal component, you have 2 responsibilities:
Tell Kal which days need to be marked with a dot because they have associated data.
Provide UITableViewCells which display the details (if any) for the currently selected day.
In order to use Kal in your application, you will need to provide an implementation of the KalDataSource protocol to satisfy these responsibilities. Please see KalDataSource.h and the included demo app for more details.
Pod::Spec.new do |s|
s.name = "Kal"
s.version = "1.0rc1"
s.summary = "A calendar component for the iPhone (the UI is designed to match MobileCal)."
s.description = <<-DESC
This project aims to provide an open-source implementation of the month view in Apple's mobile calendar app (MobileCal). When the user taps a day on the calendar, any associated data for that day will be displayed in a table view directly below the calendar. As a client of the Kal component, you have 2 responsibilities:
Tell Kal which days need to be marked with a dot because they have associated data.
Provide UITableViewCells which display the details (if any) for the currently selected day.
In order to use Kal in your application, you will need to provide an implementation of the KalDataSource protocol to satisfy these responsibilities. Please see KalDataSource.h and the included demo app for more details.
<style name="Theme.cheddar" parent="@android:style/Theme.Holo.Light">
<item name="android:buttonStyle">@style/cheddar_ButtonStyle</item>
</style>
<style name="cheddar_ButtonStyle" parent="@android:style/Widget.Holo.Light.Button">
<item name="android:background">@drawable/selectable_background_cheddar</item>
</style>
<style name="Theme.cheddar" parent="@android:style/Theme.Holo.Light">
<item name="android:buttonStyle">@style/cheddar_ButtonStyle</item>
</style>
<style name="cheddar_ButtonStyle" parent="@android:style/Widget.Holo.Light.Button">
<item name="android:background">@drawable/selectable_background_cheddar</item>
</style>
<style name="Theme.cheddar" parent="@android:style/Theme.Holo.Light">
<item name="android:dialogTheme">@style/cheddar_AlertDialog</item>
</style>
<style name="cheddar_AlertDialog" parent="@android:style/Theme.Holo.Dialog">
<item name="android:buttonBarStyle">@style/cheddar_AlertButtonStyle</item>
</style>
<style name="cheddar_AlertButtonStyle" parent="@android:style/Holo.ButtonBar.AlertDialog">
<item name="android:background">@drawable/selectable_background_cheddar</item>
<style name="Theme.cheddar" parent="@android:style/Theme.Holo.Light">
<item name="android:alertDialogTheme">@style/cheddar_AlertDialog</item>
</style>
<style name="cheddar_AlertDialog" parent="@android:style/Theme.Holo.Light.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:buttonBarButtonStyle">@style/cheddar_AlertButtonStyle</item>
</style>
<style name="cheddar_AlertButtonStyle" parent="@android:style/Holo.Light.ButtonBar.AlertDialog">
NSMutableDictionary *uploadHttpBody = @{@"filename":data}.mutableCopy;
MKNetworkOperation *uploadOperation = [[MKNetworkOperation alloc] initWithURLString:url params:uploadHttpBody httpMethod:@"PUT"];
- (void) rotateHandleWithTouch:(UITouch*)touch {
CGPoint previousLocation = [touch previousLocationInView:[touch view]];
CGPoint newLocation = [touch locationInView:[touch view]];
//preform all the same basic rig on both the current touch and previous touch
CGPoint previousGlLocation = [[CCDirector sharedDirector] convertToGL:previousLocation];
CGPoint newGlLocation = [[CCDirector sharedDirector] convertToGL:newLocation];
CCSprite *handle = (CCSprite*)[_spriteManager getChildByTag:HANDLE_TAG];
//manually add a search bar
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 3, 320, 44)];
searchBar.delegate = self;
[searchBar setPlaceholder:NSLocalizedString(@"SearchNearbyPlaces", nil)];
UISearchDisplayController *searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self.navigationController];
searchDisplayController.searchResultsDataSource = self;
searchDisplayController.searchResultsDelegate = self;
searchDisplayController.delegate = self;