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
#ifndef ESPENLAUB_ARDUINO_COMPAT_H | |
#define ESPENLAUB_ARDUINO_COMPAT_H | |
#pragma once | |
#include "driver/gpio.h" | |
#include "esp_timer.h" | |
#include "freertos/FreeRTOS.h" | |
#include "freertos/task.h" | |
using byte = uint8_t; |
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); |
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 ) | |
{ |
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 |
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]; | |
} |