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
extension CLLocationCoordinate2D: Equatable {} | |
extension Double { | |
func places(p: Double) -> String { | |
return NSString(format: "%\(p)f", self) | |
} | |
} | |
public func ==(lhs: CLLocationCoordinate2D, rhs: CLLocationCoordinate2D) -> Bool { | |
return lhs.latitude.places(3) == rhs.latitude.places(3) && lhs.longitude.places(3) == rhs.longitude.places(3) |
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
func anyCommonElements <T, U where T: Sequence, U: Sequence, T.GeneratorType.Element: Equatable, T.GeneratorType.Element == U.GeneratorType.Element> (lhs: T, rhs: U) -> Bool { | |
for lhsItem in lhs { | |
for rhsItem in rhs { | |
if lhsItem == rhsItem { | |
return true | |
} | |
} | |
} | |
return false | |
} |
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
// | |
// AVRAnimatedTableViewController.m | |
// AnimationIssues | |
// | |
// Created by Adam Weeks on 5/2/14. | |
// Copyright (c) 2014 AppsVersusRobots, LLC. All rights reserved. | |
// | |
#import "AVRAnimatedTableViewController.h" | |
#import "AVRAnimatedTableViewCell.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
#import "TableViewController.h" | |
@interface NSArray (CountForTableView) | |
- (NSInteger)countForTableView; | |
@end | |
@implementation NSArray (CountForTableView) |
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
// | |
// MapViewController.h | |
// MapsCustomInfoWindow | |
// | |
// Created by Jon Friskics on 4/22/14. | |
// Copyright (c) 2014 Jon Friskics. All rights reserved. | |
// | |
#import <UIKit/UIKit.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
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; | |
// for light navigation item text, or UIBarStyleDefault for dark navigation item text | |
imagePickerController.navigationBar.barStyle = UIBarStyleBlack; | |
// the actual color will be affected by the translucency setting | |
imagePickerController.navigationBar.barTintColor = [UIColor blueColor]; | |
// default is YES, but you could change to NO | |
imagePickerController.navigationBar.translucent = YES; |
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 "AppDelegate.h" | |
#import "ContainerVC.h" | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
self.window.rootViewController = [[ContainerVC alloc] init]; |
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
[[NSNotificationCenter defaultCenter] addObserverForName:@"UIKeyboardDidShowNotification" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { | |
CGRect cursorRect = [self.textView caretRectForPosition:self.textView.selectedTextRange.start]; | |
if(CGRectGetMaxY(cursorRect) > CGRectGetHeight(self.view.frame) - self.topLayoutGuide.length - 216) { | |
[UIView animateWithDuration:1.0f animations:^{ | |
self.textView.contentOffset = CGPointMake(0, 216); | |
} completion:^(BOOL finished) { | |
}]; | |
} | |
}]; | |
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 AppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@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
#import <UIKit/UIKit.h> | |
@interface ViewController : UIViewController | |
@property (strong, nonatomic) UILabel *getResponseLabel; | |
@property (strong, nonatomic) UILabel *postResponseLabel; | |
@end |