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
-(IBAction)show:(id)sender{ | |
CGRect frame = [aView frame]; | |
frame.origin.y = [[self view] bounds].size.height; | |
[aView setFrame:frame]; | |
[[self view] addSubview:aView]; | |
[UIView beginAnimations:@"slide up" context:NULL]; | |
frame.origin.y = [[self view] bounds].size.height - frame.size.height; | |
[aView setFrame:frame]; | |
[UIView commitAnimations]; |
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
// Original | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
static NSString *firstLaunchKey = @"firstLaunch"; | |
// Register default defaults | |
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; | |
NSDictionary *defaultDefaults = [[NSDictionary alloc] initWithObjectsAndKeys: | |
[NSNumber numberWithBool:YES], firstLaunchKey, | |
nil]; |
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
// | |
// IZGoogleGeocoder.m | |
// JSON Google Geocoder | |
// | |
// Created by Zsombor Szabó on 2/11/11. | |
// Copyright 2011 IZE. All rights reserved. | |
// | |
#import "IZGoogleGeocoder.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
// recursively apply typeface to our textviews | |
static final void setTypeface(ViewGroup viewGroup, Typeface typeface) | |
{ | |
if (viewGroup == null) return; | |
int children = viewGroup.getChildCount(); | |
Log.d(TAG, "setTypeface " + viewGroup + " : " + children); | |
for (int i=0; i<children; i++) | |
{ | |
View view = viewGroup.getChildAt(i); |
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_stripHtml.h | |
// Copyright 2011 Leigh McCulloch. Released under the MIT license. | |
#import <Foundation/Foundation.h> | |
@interface NSString (stripHtml) | |
- (NSString*)stripHtml; | |
@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
- (UIAccessibilityTraits)accessibilityTraits | |
{ | |
UIAccessibilityTraits traits = UIAccessibilityTraitButton | UIAccessibilityTraitAllowsDirectInteraction | UIAccessibilityTraitStaticText; | |
if (self.disabled == YES) | |
{ | |
traits = traits | UIAccessibilityTraitNotEnabled; | |
} | |
return traits; |
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
// stringByAddingPercentEscapesUsingEncoding is pretty conservative about escaping characters, which is fine most of the time. This method however escapes *all special characters*, allowing any arbitrary string to be used when building any part of a URL. | |
// (c) 2011 Springs & Struts. Released under MIT-style license. See: http://www.opensource.org/licenses/mit-license.php | |
@interface NSString (SSURLEscaping) | |
- (NSString *)ss_stringByEscapingAllURLCharactersForRealWithEncoding:(NSStringEncoding)encoding; | |
@end | |
@implementation NSString (SSURLEscaping) | |
- (NSString *)ss_stringByEscapingAllURLCharactersForRealWithEncoding:(NSStringEncoding)encoding |
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
static NSString *kcIdentifier = @"MyApp"; | |
@implementation LTAppDelegate (KeyChain) | |
- (void)keychainInit | |
{ | |
self.keychainDict = [NSMutableDictionary dictionaryWithCapacity:7]; | |
KeychainItemWrapper *item = [[KeychainItemWrapper alloc] initWithIdentifier:kcIdentifier accessGroup:nil]; | |
[self.keychainDict setObject:@"" forKey:kcEmailAddress]; |
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
@implementation BHSCollectionViewFlowLayout | |
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { | |
NSArray *allAttrs = [super layoutAttributesForElementsInRect:rect]; | |
for (UICollectionViewLayoutAttributes *attributes in allAttrs) { | |
attributes.frame = CGRectIntegral(attributes.frame); | |
} | |
return allAttrs; | |
} |
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 NSManagedObject (Serialization) | |
- (NSDictionary*) toDictionary; | |
- (void) populateFromDictionary:(NSDictionary*)dict; | |
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict | |
inContext:(NSManagedObjectContext*)context; | |
@end |
OlderNewer