Skip to content

Instantly share code, notes, and snippets.

View mikeabdullah's full-sized avatar

Mike Abdullah mikeabdullah

View GitHub Profile
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow];
if (selectedRowIndexPath) {
[self.transitionCoordination animateAlongsideTransitionInView:self.tableView animation:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[self.tableView deselectRowAtIndexPath:selectedRowIndexPath animated:YES];
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
BOOL inMultipleSelectionMode = (self.tableView.editing ?
self.tableView.allowsMultipleSelectionDuringEditing :
self.tableView.allowsMultipleSelection);
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow];
if (selectedRowIndexPath && !inMultipleSelectionMode) {
extern NSArray *PRHArrayByMap(NSArray *inArray, id (^block)(id));
@mikeabdullah
mikeabdullah / BSManagedDocument.h
Created November 2, 2012 12:04 — forked from adib/BSManagedDocument.h
An NSDocument subclass that supports asynchronous Core Data operations
//
// BSManagedDocument.h
//
// Created by Sasmito Adibowo on 29-08-12.
// Copyright (c) 2012 Basil Salad Software. All rights reserved.
// http://basilsalad.com
//
// Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license>
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@mikeabdullah
mikeabdullah / NSManagedObjectContextShim.h
Created July 26, 2012 10:20 — forked from danielctull/ThreadedManagedObjectContext.h
NSManagedObjectContext for iOS 4. Maybe?
/*
NSManagedObjectContextShim.h
NSManagedObjectContextShim
Created by Daniel Tull on 25.07.2012.
Copyright (c) 2012 Daniel Tull. All rights reserved.
@mikeabdullah
mikeabdullah / gist:3052841
Created July 5, 2012 10:28 — forked from itod/objc_closure.m
Objective-C Closure
// compiled with ARC enabled
NSArray *foo() {
NSMutableArray *res = [NSMutableArray array];
for (int i = 0; i < 3; i++) {
[res addObject:^{
NSLog(@"%d", i);
}];
}
return res;