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
imageView.frame = self.frame | |
imageView.image = defaultImage | |
imageView.translatesAutoresizingMaskIntoConstraints = false | |
addSubview(imageView) | |
let views: [String: AnyObject] = ["imageView": imageView] | |
let verticalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|[imageView]|", | |
options: .AlignAllCenterX, | |
metrics: nil, | |
views: views) | |
addConstraints(verticalConstraints) |
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
-(void)startPulsatingAnimation { | |
if (!self.shouldPulsate) {return;} | |
[self removePulsingAnimation]; | |
CABasicAnimation *theAnimation=[CABasicAnimation animationWithKeyPath:OpacityAnimationKey]; | |
theAnimation.duration = 1.0; | |
theAnimation.repeatCount = HUGE_VALF; | |
theAnimation.autoreverses = YES; | |
theAnimation.fromValue = [NSNumber numberWithFloat:1.0]; | |
theAnimation.toValue = [NSNumber numberWithFloat:0.0]; | |
[self.layer addAnimation:theAnimation forKey:PulsingAnimation]; |
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:UIKeyboardWillChangeFrameNotification object:nil queue:nil usingBlock:^(NSNotification *note) { | |
NSDictionary *dict = [note userInfo]; | |
NSValue *keyboardFrame = dict[UIKeyboardFrameEndUserInfoKey]; | |
CGRect frame = [keyboardFrame CGRectValue]; | |
NSNumber *duration = dict[UIKeyboardAnimationDurationUserInfoKey]; | |
double durationDouble = [duration doubleValue]; | |
[UIView animateWithDuration:durationDouble animations:^{ | |
self.view.frame = CGRectMake(0, frame.origin.y - self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height); | |
}]; | |
}]; |
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(UIKeyboardWillChangeFrameNotification, object: nil, queue: nil) { (notification) -> Void in | |
guard let info: [NSObject: AnyObject] = notification.userInfo, | |
let keyboardFrameValue = info[UIKeyboardFrameEndUserInfoKey] as? NSValue, | |
let duration = info[UIKeyboardAnimationDurationUserInfoKey] as? Int else { | |
return | |
} | |
let diff = CGRectGetHeight(keyboardFrameValue.CGRectValue()) | |
UIView.animateWithDuration(Double(duration), animations: { () -> Void in | |
self.view.frame = CGRect(x: self.view.frame.minX, y: keyboardFrameValue.CGSizeValue().height, width: self.view.frame.width, height: self.view.frame.height) |
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
// PDFRenderer.swift | |
// MobileMakersAcademy | |
// | |
// Created by Rich Fellure on 2/2/15. | |
// Copyright (c) 2015 Mobile Makers. All rights reserved. | |
// | |
import Foundation | |
class PDFRenderer { |
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
// Location.h | |
// TSApp | |
// | |
// Created by Rich Fellure on 8/12/14. | |
// Copyright (c) 2014 TravelSages. All rights reserved. | |
// | |
#import <Parse/Parse.h> | |
#import "Region.h" |