@@ -11,8 +11,6 @@ import UIKit
11
11
class TableViewController : UITableViewController {
12
12
13
13
var tableArray : NSMutableArray = [ " Swift " , " Objective -C " , " Python " , " Java " , " Ruby " ]
14
- var snapshot : UIView = UIView ( )
15
- var sourceIndexPath : NSIndexPath = NSIndexPath ( )
16
14
17
15
init ( style: UITableViewStyle ) {
18
16
super. init ( style: style)
@@ -35,58 +33,6 @@ class TableViewController: UITableViewController {
35
33
// Dispose of any resources that can be recreated.
36
34
}
37
35
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
- */
90
36
//#pragma mark - Table view data source
91
37
92
38
override func numberOfSectionsInTableView( tableView: UITableView ? ) -> Int {
@@ -128,35 +74,11 @@ class TableViewController: UITableViewController {
128
74
self . showAlert ( tableArray. objectAtIndex ( indexPath. row) as NSString , rowToUseInAlert: indexPath. row)
129
75
}
130
76
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
-
155
77
//#pragma mark - UIAlertView delegate methods
156
78
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
+ }
160
82
161
83
// Function to init a UIAlertView and show it
162
84
func showAlert( rowTitle: NSString , rowToUseInAlert: Int ) {
0 commit comments