View gist:8160367
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { | |
context.duration = 4.f; | |
context.allowsImplicitAnimation = YES; | |
[view.layer addAnimation:CATransition.animation forKey:@"contents"]; | |
view.layer.contents = someImage; | |
} completionHandler:nil]; |
View LBHView.h
#import <Cocoa/Cocoa.h> | |
@interface LBHView : NSView | |
/// This property controls whether the view can indirectly control its | |
/// backing layer's properties, specifically the following: | |
/// `affineTransform` | |
/// `anchorPoint` | |
/// | |
/// These properties cannot be modified on the layer during the time that |
View NSString+IBNMetrics.h
#import <Foundation/Foundation.h> | |
@interface NSString (IBNMetrics) | |
- (CGSize)ibn_sizeConstrainedToSize:(CGSize)size font:(NSFont *)font; | |
- (CGSize)ibn_sizeWithFont:(NSFont *)font; | |
@end |
View osx-for-hackers.sh
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront | |
sudo -v | |
# Keep-alive: update existing `sudo` time stamp until script has finished | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & |
OlderNewer