This file contains hidden or 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.UIGestureRecognizerSubclass | |
class ForceGestureRecognizer: UIGestureRecognizer { | |
var forceValue: CGFloat = 0 | |
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent) { | |
super.touchesBegan(touches, withEvent: event) | |
state = .Began | |
handleForceWithTouches(touches) |
This file contains hidden or 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 func viewDragged(sender: UIPanGestureRecognizer) { | |
let yTranslation = sender.translationInView(view).y | |
if (hasExceededVerticalLimit(topViewConstraint.constant)){ | |
totalTranslation += yTranslation | |
topViewConstraint.constant = logConstraintValueForYPoisition(totalTranslation) | |
if(sender.state == UIGestureRecognizerState.Ended ){ | |
animateViewBackToLimit() | |
} | |
} else { | |
topViewConstraint.constant += yTranslation |
This file contains hidden or 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 | |
class ViewController: UIViewController { | |
let magicLabel = AnimatedLabel(frame: CGRectMake(100, 100, 300, 20)); | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
magicLabel.text = "Magic label" | |
self.view.addSubview(magicLabel); |
This file contains hidden or 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
// | |
// CustomDynamicAlertView.h | |
// Week3_inclass | |
// | |
// Created by Victor Baro on 18/02/2015. | |
// Copyright (c) 2015 Produkt. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
NewerOlder