Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
Separate Visualizer class
Browse files Browse the repository at this point in the history
  • Loading branch information
morizotter committed Jun 2, 2015
1 parent 4235dcb commit bd7695f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Pod/Classes/Visualizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ final public class Visualizer {
touch.removeFromSuperview()
}
}
// MARK: - Methods
}

extension Visualizer {
public class func isEnabled() -> Bool {
return sharedInstance.enabled
}
Expand All @@ -50,7 +50,6 @@ final public class Visualizer {
}

public class func start(config: Configuration) {

let instance = sharedInstance
instance.enabled = true
instance.config = config
Expand Down Expand Up @@ -98,7 +97,6 @@ final public class Visualizer {
}

public func handleEvent(event: UIEvent) {

if event.type != UIEventType.Touches {
return
}
Expand Down Expand Up @@ -133,16 +131,18 @@ final public class Visualizer {
UIView.animateWithDuration(0.2, delay: 0.0, options: .AllowUserInteraction, animations: { [unowned self] () -> Void in
view.alpha = 0.0
view.endTouch()
}, completion: { [unowned self] (finished) -> Void in
view.removeFromSuperview()
self.log(touch)
});
}, completion: { [unowned self] (finished) -> Void in
view.removeFromSuperview()
self.log(touch)
});
}
log(touch)
}
}
}

}

extension Visualizer {
public func log(touch: UITouch) {
if !config.showsLog {
return
Expand Down

0 comments on commit bd7695f

Please sign in to comment.