View UIImage+PSPDFKitAdditions.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIImage *)pspdf_preloadedImage { | |
CGImageRef image = self.CGImage; | |
// make a bitmap context of a suitable size to draw to, forcing decode | |
size_t width = CGImageGetWidth(image); | |
size_t height = CGImageGetHeight(image); | |
CGColorSpaceRef colourSpace = CGColorSpaceCreateDeviceRGB(); | |
CGContextRef imageContext = CGBitmapContextCreate(NULL, width, height, 8, width*4, colourSpace, | |
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); |
View SomeUITableViewCell.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)triggerRelayoutIfNecessary | |
{ | |
[_activityIndicator stopAnimating]; | |
float newHeight = [self.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height; | |
if ( newHeight != _lastHeight ) | |
{ | |
UITableView* tv = (UITableView*)[self LT_findFirstSuperviewOfClass:UITableView.class]; | |
if ( tv.isDragging || tv.isDecelerating ) | |
{ |
View NSString+Extensions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSString (IndexedSubscripting) | |
-(NSString*)objectAtIndexedSubscript:(NSInteger)index | |
{ | |
NSRange range = NSMakeRange( index < 0 ? self.length + index: index, 1 ); | |
return [self substringWithRange:range]; | |
} | |
@end |
View LTLabel.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(CGSize)intrinsicContentSize | |
{ | |
if ( _zeroIntrinsicContentSizeIfHidden && self.hidden ) | |
{ | |
return CGSizeZero; | |
} | |
return [super intrinsicContentSize]; | |
} |