Last active
August 29, 2015 14:13
-
-
Save switz/0bc0e75598ed4884cba5 to your computer and use it in GitHub Desktop.
Revisions
-
switz revised this gist
Jan 22, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -16,8 +16,8 @@ class ContainerViewController: UIViewController, UITableViewDelegate, NSFetchedR } if (gesture.state != UIGestureRecognizerState.Began) { return; } let fingerLocation = gesture.locationInView(self.table); if let indexPath = self.table.indexPathForRowAtPoint(fingerLocation) { let container = self.fetchedResultsController?.objectAtIndexPath(indexPath) as NSManagedObject // do stuff with container self.performSegueWithIdentifier("show_player", sender: self); -
switz revised this gist
Jan 22, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ class ContainerViewController: UIViewController, UITableViewDelegate, NSFetchedR // Play on touch down var td = UILongPressGestureRecognizer(target: self, action: "touchDown:") td.minimumPressDuration = 0; td.allowableMovement = 10000; self.table.addGestureRecognizer(td); } -
switz revised this gist
Jan 22, 2015 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,11 @@ class ContainerViewController: UIViewController, UITableViewDelegate, NSFetchedResultsControllerDelegate { override func viewDidLoad() { super.viewDidLoad() // Play on touch down var td = UILongPressGestureRecognizer(target: self, action: "touchDown:") td.minimumPressDuration = 0; self.table.addGestureRecognizer(td); } func touchDown(gesture: UIGestureRecognizer) { if (gesture.state == UIGestureRecognizerState.Ended) { @@ -19,4 +21,5 @@ // do stuff with container self.performSegueWithIdentifier("show_player", sender: self); } } } -
switz created this gist
Jan 22, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ // in view did load // Play on touch down var td = UILongPressGestureRecognizer(target: self, action: "touchDown:") td.minimumPressDuration = 0; self.table.addGestureRecognizer(td); func touchDown(gesture: UIGestureRecognizer) { if (gesture.state == UIGestureRecognizerState.Ended) { if self.playerViewController != nil { self.playerViewController!.dismissViewControllerAnimated(false, completion: nil); } } if (gesture.state != UIGestureRecognizerState.Began) { return; } let tapLocation = gesture.locationInView(self.table); if let indexPath = self.table.indexPathForRowAtPoint(tapLocation) { let container = self.fetchedResultsController?.objectAtIndexPath(indexPath) as NSManagedObject // do stuff with container self.performSegueWithIdentifier("show_player", sender: self); } }