"I'm Dorothy Gale from Kansas"
Monterey Bay Aquarium
I'd rather be in outer space 🛸
h

tannertan36
dirt enthusiast
PUT YOUR BEARD IN MY MOUTH
Not today Justin
cherry valley forever

ellievsbear
let's talk about Bridgerton tea, my ask is open

祝日 / Permanent Vacation
noise dept.
$LAYYYTER

Kiana Khansmith

❣ Chile in a Photography ❣
will byers stan first human second
i don't do bad sauce passes

PR's Tumblrdome
Keni

seen from United States
seen from United Kingdom

seen from United States
seen from Malaysia

seen from United States
seen from India

seen from Philippines

seen from United States
seen from United States

seen from Canada

seen from United States
seen from United States

seen from Netherlands

seen from Singapore
seen from Switzerland

seen from United States
seen from Italy
seen from United States
seen from Mexico

seen from Mexico
@pastedump
Check if device is iPad
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
Check rotation of screen
UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])
If you change a UIView's transform, don't use frame anymore
Warning: If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.
http://developer.apple.com/library/ios/documentation/uikit/reference/UIView_Class/UIView/UIView.html#//apple_ref/doc/uid/TP40006816-CH3-SW5
Finding objects in an NSSet using objectsPassingTest
- (myObject *)findObjectWithDescription:(NSString*)d in:(NSSet*)set
{
[set objectsPassingTest:^(id obj, BOOL *stop)
{
if([d isEqualToString:((myObject*)obj).description)
{
*stop = YES;
return YES;
}
else
{
return NO;
}
}];
}
When to use NSOrderedSet?
"You can use ordered sets as an alternative to arrays when the order of elements is important and performance in testing whether an object is contained in the set is a consideration— testing for membership of an array is slower than testing for membership of a set."
https://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSOrderedSet_Class/Reference/Reference.html
Always label your stashs
git stash save "MESSAGE HERE"
Then when you view stashes with
git stash list
You'll know what the stash was about without having to read which file changed (git stash show STASHID)
Don't nest MACROS
MAX( x, MIN( y, z)) does not work!
Expand it to see why.
Animate CALayer property startPoint
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"startPoint"];
[animation setDuration:1.f];
[animation setFromValue:[NSValue valueWithCGPoint:CGPointMake(0.0,0)]];
[animation setToValue:[NSValue valueWithCGPoint:CGPointMake(1.0,0)]];
[animation setRemovedOnCompletion:NO];
[myGradient addAnimation: animation forKey:@"startPoint"];
Creating a gradient alpha mask
UIImageView * view = [[UIImageView alloc] initWithImage:image];
// Make a gradient
CAGradientLayer * myGradient = [CAGradientLayer layer];
//Choose colors
UIColor * color1 = [UIColor ...];
UIColor * color2 = [UIColor ...];
[myGradient setCOlors:{NSArray arrayWithObjects:(id)[color1 CGColor], (id)[color2 CGColor], nil]];
// apply as mask
view.layer.mask = myGradient;
Convert a CGPoint to be used in CALayer animations
[animation setToValue:[NSValue valueWithCGPoint:CGPointMake(0.2,0)]];
Creating CGRect from CGPoint and CGSize:
CGRect rect = (CGRect){CGPointZero, CGSizeZero};
Debugging CG structures
CGPoint myPoint;
...
NSLog(@"%@", CGPointFromString(myPoint));
Also:
CGRectFromString(myRect);
CGSizeFromString(mySize);