Skip to content

Instantly share code, notes, and snippets.

View jparishy's full-sized avatar

Julius Parishy jparishy

View GitHub Profile
@jparishy
jparishy / gist:1135069
Created August 9, 2011 20:12
Const order test
#include <iostream>
int main(int argc, char** argv)
{
const int const1 = 1;
const int const2 = 2;
const int const3 = 3;
int blah = 4;
int foo = 5;
@jparishy
jparishy / gist:1135073
Created August 9, 2011 20:13
Const order test
#include <iostream>
int main(int argc, char** argv)
{
const int const1 = 1;
const int const2 = 2;
const int const3 = 3;
int blah = 4;
int foo = 5;
@jparishy
jparishy / gist:1135075
Created August 9, 2011 20:13
Const order test
#include <iostream>
int main(int argc, char** argv)
{
const int const1 = 1;
const int const2 = 2;
const int const3 = 3;
int blah = 4;
@jparishy
jparishy / gist:1135077
Created August 9, 2011 20:13
Const order test
#include <iostream>
int main(int argc, char** argv)
{
const int const1 = 1;
const int const2 = 2;
const int const3 = 3;
int blah = 4;
@jparishy
jparishy / HiddenView.m
Created August 9, 2011 20:50
Class variables
CGRect openRect;
CGPoint originalOffset;
CGPoint targetOffset;
UIView* openingContainer;
UIView* openingBottomImage;
BOOL openingOpen;
@property (nonatomic, retain) IBOutlet UIView* underViewAlbum;
@property (nonatomic, retain) IBOutlet UIView* underViewCaption;
@jparishy
jparishy / HiddenView.m
Created August 9, 2011 21:03
Opening the view
-(void)openEditAnimationFromCellRect:(CGRect)rect withView:(UIView *)underView
{
[self.tableView setScrollsToTop:NO];
[self.tableView setScrollEnabled:NO];
originalOffset = self.tableView.contentOffset;
targetOffset = CGPointMake(0.0f, rect.origin.y);
[UIView animateWithDuration:0.5f animations:^(void) {
self.tableView.contentOffset = targetOffset;
-(void)openEditAnimationFromCellRect:(CGRect)rect withView:(UIView *)underView
{
[self.tableView setScrollsToTop:NO];
[self.tableView setScrollEnabled:NO];
originalOffset = self.tableView.contentOffset;
targetOffset = CGPointMake(0.0f, rect.origin.y);
@jparishy
jparishy / HiddenView.m
Created August 9, 2011 21:04
openEditAnimationFromCellRect:withView:
-(void)openEditAnimationFromCellRect:(CGRect)rect withView:(UIView *)underView
{
[self.tableView setScrollsToTop:NO];
[self.tableView setScrollEnabled:NO];
originalOffset = self.tableView.contentOffset;
targetOffset = CGPointMake(0.0f, rect.origin.y);
[UIView animateWithDuration:0.5f animations:^(void) {
self.tableView.contentOffset = targetOffset;
}
completion:^(BOOL finished)
{
// Get a UIImage of the contents of the view as they are now
float scale = [[UIScreen mainScreen] scale];
UIGraphicsBeginImageContextWithOptions(self.view.superview.frame.size, true, scale);
CGContextRef imageContext = UIGraphicsGetCurrentContext();
[self.view.superview.layer renderInContext:imageContext];
UIImage* image = UIGraphicsGetImageFromCurrentImageContext();