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
| // NSArray+FAPMap.h | |
| typedef id(^MapBlock)(id item); | |
| @interface NSArray (FAPMap) | |
| - (NSArray*)fap_map:(MapBlock)mapBlock; | |
| @end | |
| // NSArray+FAPMap.m |
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
| function(num) { return num * 3; } |
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
| _.map([1, 2, 3], function(num) { return num * 3; }); |
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
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| [NSClassFromString(@"WebView") _enableRemoteInspector]; | |
| // or [NSClassFromString(@"WebView") performSelector:@selector(_enableRemoteInspector)]; | |
| // if the compiler will complain | |
| } |
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
| func tableView(tableView: UITableView, didEndEditingRowAtIndexPath indexPath: NSIndexPath) { | |
| if(self.swipeGestureStarted) { | |
| self.swipeGestureStarted = false | |
| self.tableView.selectRowAtIndexPath(self.selectedIndexPath, animated: true, scrollPosition: .None) | |
| } | |
| } |
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
| func tableView(tableView: UITableView, willBeginEditingRowAtIndexPath indexPath: NSIndexPath) { | |
| self.swipeGestureStarted = true | |
| } |
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
| func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
| self.selectedIndexPath = indexPath | |
| } |