Skip to content

Instantly share code, notes, and snippets.

View ericrowe's full-sized avatar

Eric Rowe ericrowe

View GitHub Profile
@ericrowe
ericrowe / keybase.md
Last active August 29, 2015 14:13
Keybase proof

Keybase proof

I hereby claim:

  * I am ericrowe on github.   * I am ericrowe (https://keybase.io/ericrowe) on keybase.   * I have a public key whose fingerprint is 1356 F54E 1E3F 9924 5819  A22C FF84 02AB EFFB 3C3A

To claim this, I am signing this object:

@ericrowe
ericrowe / gist:3647b46b775fde1b988e
Created August 2, 2014 03:50
Hiding the navigationBar and UIToolbar in Swift
// in viewDidLoad...
var tapGestureRecognizer = UITapGestureRecognizer(target: self, action: "showToolbars")
tapGestureRecognizer.cancelsTouchesInView = false
scrollView.addGestureRecognizer(tapGestureRecognizer)
// somewhere else...
func showToolbars() {
UIView.animateWithDuration(1.0, delay: 0.0, options: UIViewAnimationOptions.CurveEaseOut, animations: {
self.toolbar.frame = CGRectMake(0, self.view.frame.size.height-self.toolbar.frame.size.height, self.toolbar.frame.size.width, self.toolbar.frame.size.height)
if self.ios7Patches!.verticalSizeClass == UIUserInterfaceSizeClass.Compact { // iPhone Horizontal
@ericrowe
ericrowe / iOS7_Patches
Last active August 29, 2015 14:04
Trait collection patch for iOS7 and Swift
// put these functions in an objc class, then you can call them from Swift without the link errors
// you'll need an owningViewController ivar passed in during init
-(id)init:(UIViewController*) viewController {
if ((self = [super init])) {
owningViewController = viewController;
}
return self;
}
-(UIUserInterfaceSizeClass)verticalSizeClass {
//
// UIImage+ImageWithColor.h
// WordClock
//
// Created by James Rutherford on 2012-12-03.
// Copyright (c) 2012 Braxio Interactive. All rights reserved.
//