Skip to content

Commit 724f08f

Browse files
Sachin KesirajuSachin Kesiraju
authored andcommitted
Minor update.
1 parent b218bb9 commit 724f08f

File tree

2 files changed

+3
-81
lines changed

2 files changed

+3
-81
lines changed

SwiftExample/TableViewController.swift

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import UIKit
1111
class TableViewController: UITableViewController {
1212

1313
var tableArray:NSMutableArray = ["Swift", "Objective -C", "Python", "Java", "Ruby"]
14-
var snapshot:UIView = UIView()
15-
var sourceIndexPath:NSIndexPath = NSIndexPath()
1614

1715
init(style: UITableViewStyle) {
1816
super.init(style: style)
@@ -35,58 +33,6 @@ class TableViewController: UITableViewController {
3533
// Dispose of any resources that can be recreated.
3634
}
3735

38-
/*@IBAction func longPressRecognized(sender:AnyObject){
39-
40-
var longGesture:UILongPressGestureRecognizer = sender as UILongPressGestureRecognizer
41-
var gestureState:UIGestureRecognizerState = longGesture.state
42-
43-
var point:CGPoint = longGesture.locationInView(self.tableView)
44-
var indexPath:NSIndexPath = self.tableView.indexPathForRowAtPoint(point)
45-
46-
switch(gestureState){
47-
48-
case UIGestureRecognizerState.Began:
49-
{
50-
51-
if(indexPath)
52-
{
53-
sourceIndexPath = indexPath
54-
var cell:UITableViewCell = self.tableView.cellForRowAtIndexPath(indexPath)
55-
snapshot = self.customSnapshotFromView(cell)
56-
57-
var center:CGPoint = cell.center
58-
snapshot.center = center
59-
snapshot.alpha = 0.0
60-
self.tableView.addSubview(snapshot)
61-
UIView.animateWithDuration(0.25, animations: {(
62-
63-
center.y = point.y,
64-
snapshot.center = center,
65-
snapshot.transform = CGAffineTransformMakeScale(1.05, 1.05),
66-
snapshot.alpha = 0.98,
67-
68-
cell.backgroundColor = UIColor.blackColor()
69-
70-
)})
71-
}
72-
}
73-
break
74-
75-
}
76-
77-
func customSnapshotFromView(inputView:UIView) -> UIView
78-
{
79-
var snapshot:UIView = inputView.snapshotViewAfterScreenUpdates(true)
80-
snapshot.layer.masksToBounds = false
81-
snapshot.layer.cornerRadius = 0.0
82-
snapshot.layer.shadowOffset = CGSizeMake(-5.0, 0.0)
83-
snapshot.layer.shadowRadius = 5.0
84-
snapshot.layer.shadowOpacity = 0.4
85-
86-
return snapshot
87-
}
88-
89-
*/
9036
//#pragma mark - Table view data source
9137

9238
override func numberOfSectionsInTableView(tableView: UITableView?) -> Int {
@@ -128,35 +74,11 @@ class TableViewController: UITableViewController {
12874
self.showAlert(tableArray.objectAtIndex(indexPath.row) as NSString, rowToUseInAlert: indexPath.row)
12975
}
13076

131-
override func tableView(tableView: UITableView!, canMoveRowAtIndexPath indexPath: NSIndexPath!) -> Bool
132-
{
133-
if(indexPath.row == 0)
134-
{
135-
return false
136-
}
137-
else
138-
{
139-
return true
140-
}
141-
}
142-
143-
override func tableView(tableView: UITableView!, moveRowAtIndexPath sourceIndexPath: NSIndexPath!, toIndexPath destinationIndexPath: NSIndexPath!)
144-
{
145-
var stringToMove:NSString = self.tableArray.objectAtIndex(sourceIndexPath.row) as NSString
146-
self.tableArray.removeObjectAtIndex(sourceIndexPath.row)
147-
self.tableArray.insertObject(stringToMove, atIndex: sourceIndexPath.row)
148-
}
149-
150-
override func tableView(tableView: UITableView!, targetIndexPathForMoveFromRowAtIndexPath sourceIndexPath: NSIndexPath!, toProposedIndexPath proposedDestinationIndexPath: NSIndexPath!) -> NSIndexPath!
151-
{
152-
return proposedDestinationIndexPath
153-
}
154-
15577
//#pragma mark - UIAlertView delegate methods
15678

157-
func alertView(alertView: UIAlertView!, didDismissWithButtonIndex buttonIndex: Int) {
158-
NSLog("Did dismiss button: %d", buttonIndex)
159-
}
79+
func alertView(alertView: UIAlertView!, didDismissWithButtonIndex buttonIndex: Int) {
80+
NSLog("Did dismiss button: %d", buttonIndex)
81+
}
16082

16183
// Function to init a UIAlertView and show it
16284
func showAlert(rowTitle:NSString, rowToUseInAlert: Int) {

0 commit comments

Comments
 (0)