This file contains hidden or 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
// Taken from http://PSPDFKit.com. This snippet is under public domain. | |
#define UIKitVersionNumber_iOS_7_0 0xB57 | |
BOOL PSPDFIsUIKitFlatMode(void) { | |
static BOOL isUIKitFlatMode = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7. | |
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) { | |
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0; | |
} |
This file contains hidden or 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
// This could be done using CALayer cornerRadius property | |
// This is an example of how would be done without that :-) | |
@interface UIImage (RoundedCorners) | |
- (UIImage *)roundedImageWithCornerRadius:(CGFloat)cornerRadius; | |
@end | |
@implementation UIImage (RoundedCorners) |
This file contains hidden or 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
// | |
// Punycode.swift | |
// | |
// Created by Mike Kasianowicz on 9/7/15. | |
// Copyright © 2015 Mike Kasianowicz. All rights reserved. | |
// | |
import Foundation | |
public class Punycode { |
This file contains hidden or 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 Foundation | |
import Dispatch | |
// Special queue for flushing the logs | |
private let loggingQueue = DispatchQueue(label: "com.logging.queue", qos: .utility) | |
// The application-wide logger object | |
public var logger: Logger = GlobalLogger.global | |
// A global logger which flushes data using the loggingQueue |
OlderNewer