Skip to content

Instantly share code, notes, and snippets.

NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
[previewingContext setSourceRect:[self.tableView rectForRowAtIndexPath:indexPath]];
- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
commitViewController:(UIViewController *)viewControllerToCommit
{
// get the peek controller (on screen currently)
HNTMemberPeekViewController *peekController = (HNTMemberPeekViewController *)viewControllerToCommit;
// get its data object
HNMemberLite *memberLite = peekController.memberLite;
// handle it as you'd handle normal cell tap action
[self memberAction:memberLite];
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
viewControllerForLocation:(CGPoint)location
{
// query the collectionView for index corresponting to the touch location
NSIndexPath *indexPath = [self.collectionView indexPathForItemAtPoint:location];
// just in case
if (!indexPath) { return nil; }
// get the data object corresponding to the pressed cell
if (iOS_9) {
[self registerForPreviewingWithDelegate:self
sourceView:self.collectionView];
}
@kubbing
kubbing / 0_reuse_code.js
Created June 1, 2014 12:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Code Sign warning: Specified PROVISIONING_PROFILE (98E447F7-E39B-4F0D-842B-6B588BC2D619) not found and no CODE_SIGN_IDENTITY specified. Ignoring PROVISIONING_PROFILE for now. This will become an error in the future.
@kubbing
kubbing / gist:9743680
Created March 24, 2014 16:23
For Mobile brezen 2014
xcodebuild
===========================================
xcodebuild
xcodebuild -workspace Pexeso.xcworkspace
xcodebuild -workspace Pexeso.xcworkspace -scheme Pexeso
xcodebuild -workspace Pexeso.xcworkspace -scheme Pexeso -configuration Release
@kubbing
kubbing / iOS_icon_resize.rb
Last active December 28, 2015 14:39
Resize iOS icons
#!/usr/bin/env ruby
if not ARGV[0]
puts "usage: ./script <icon.png>"
return
end
$icon = ARGV[0]
iPhone_dimensions = [ 29, 40, 57, 60 ]