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
import UIKit | |
public extension String { | |
/// Transforms this string into an NSAttributedString that has hyphenation enabled. | |
/// Especially at larger preferredContentSizes, regular word wrapping can lead to really | |
/// choppy line breaks. Hyphenating allows fuller use of the line whenever possible, | |
/// resulting in more text on the screen. | |
/// - Returns: An NSAttributedString version of this String with hyphenation enabled | |
func withHyphenationEnabled() -> NSAttributedString { | |
let paragraphStyle = NSMutableParagraphStyle() |
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
@interface NSArray (Batching) | |
- (void) enumerateObjectsWithBatchSize:(NSUInteger)batchSize | |
usingBlock:(void (^)(NSArray* batch, NSUInteger startIndex, BOOL *stop))block; | |
@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
// | |
// NSMutableURLRequest+CacheControl.m | |
// | |
// Created by Paul Goracke on 2/26/13. | |
// | |
@implementation NSMutableURLRequest (CacheControl) | |
+ (instancetype) newCachePolicyRequestWithURL:(NSURL *)url timeoutInterval:(NSTimeInterval)timeoutInterval { | |
// If we have cached info, tell request to ignore cache because we only want to process data when we get new from server |