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
extension String { | |
/// Compares the current string value as a file path against a second | |
/// file path string in order to determine which comes first. | |
/// | |
/// Rules: | |
/// * Item names are only compared if they are in the same directory | |
/// * Items in higher parent directories always take priority | |
/// * Files prefixed with "_" are automatically downgraded (Since files prefixed like that are usually ads) | |
/// |
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 <sys/stat.h> | |
chflags(filePath.UTF8String, UF_TRACKED); | |
NSURL *url = [NSURL fileURLWithPath:filePath]; | |
id value = nil; | |
[url getResourceValue:&value forKey:NSURLDocumentIdentifierKey error:nil]; | |
NSLog(@"%@", value); |
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
###################### | |
# Build Script for | |
# Producing a fat | |
# Cocoa framework binary | |
###################### | |
PROJECT_NAME="MyAppExample" | |
SCHEME_NAME="MyAppFramework" | |
FRAMEWORK_NAME="MyApp" | |
BUILD_DIR="Builds" |
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
let fileManager = FileManager.default | |
var configuration = Realm.Configuration() | |
let defaultRealmURL = configuration.fileURL! | |
// Get the path to the Library directory and append 'default.realm' to it | |
let libraryDirectoryPath = NSSearchPathForDirectoriesInDomains(.libraryDirectory, .userDomainMask, true).first! | |
let libraryDirectoryURL = URL(fileURLWithPath: libraryDirectoryPath) | |
let newRealmURL = libraryDirectoryURL.appendingPathComponent(defaultRealmURL.lastPathComponent) | |
// There is a user-created default.realm in the Documents directory |
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
#!/bin/bash | |
# Global build settings | |
export SDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk | |
export MIN_MACOS_VERSION=10.10 | |
export HOST=x86_64-apple-darwin | |
export LDFLAGS_NATIVE="-isysroot $SDKPATH" | |
export TASN1_CFLAGS="-Ilibtasn1/include" | |
export TASN1_LIBS="-Llibtasn1 -ltasn1" | |
export ARCH="x86_64" |
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
#!/bin/bash | |
# Global build settings | |
export SDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk | |
export SIMSDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk | |
export MIN_IOS_VERSION=7.0 | |
export HOST=arm-apple-darwin | |
export LDFLAGS_NATIVE="-isysroot $SDKPATH" | |
export LDFLAGS_SIMULATOR="-isysroot $SIMSDKPATH" | |
export TASN1_CFLAGS="-Ilibtasn1/include" |
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
#!/bin/bash | |
# Global build settings | |
export SDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk | |
export SIMSDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk | |
export MIN_TVOS_VERSION=9.0 | |
export HOST=arm-apple-darwin | |
export LDFLAGS_NATIVE="-isysroot $SDKPATH" | |
export LDFLAGS_SIMULATOR="-isysroot $SIMSDKPATH" | |
export TASN1_CFLAGS="-Ilibtasn1/include" |
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
#!/bin/bash | |
# Global build settings | |
export SDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk | |
export SIMSDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk | |
export MIN_IOS_VERSION=7.0 | |
export HOST=arm-apple-darwin | |
export LDFLAGS_NATIVE="-isysroot $SDKPATH" | |
export LDFLAGS_SIMULATOR="-isysroot $SIMSDKPATH" | |
export TASN1_CFLAGS="-Ilibtasn1/include" |
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
Thread : Crashed: com.apple.main-thread | |
0 OpenGLES 0x0000000187b03930 +[EAGLContext setCurrentContext:] + 84 | |
1 OpenGLES 0x0000000187b0391c +[EAGLContext setCurrentContext:] + 64 | |
2 CoreImage 0x0000000184c28600 __is_gpu_A9_or_higher_block_invoke + 188 | |
3 libdispatch.dylib 0x000000019999d770 _dispatch_client_callout + 16 | |
4 libdispatch.dylib 0x000000019999e5b4 dispatch_once_f + 80 | |
5 CoreImage 0x0000000184c28540 is_gpu_A9_or_higher + 60 | |
6 CoreImage 0x0000000184c08ad8 CI::GLContext::surface_rowbytes_alignment_for_output(CI::PixelFormat) const + 24 | |
7 CoreImage 0x0000000184c1be18 CI::_get_bitmap(CI::Context*, CI::Image*, CGRect, CGColorSpace*, CI::Bitmap*) + 140 | |
8 CoreImage 0x0000000184c1bcdc CI::image_get_bitmap(CI::Context*, CI::Image*, CGRect, CGColorSpace*, CI::Bitmap*, unsigned long) + 732 |
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
@implementation UIScrollView (ZoomToPoint) | |
/** | |
Zooms into the specified point of the scroll view's zoomable content view at the supplied scaled. | |
(The zoomable content view is the view that is returned in `viewForZoomingInScrollView:` | |
@param zoomPoint - In terms of the scroll view's co-ordinate space, the point to zoom to | |
@param scale - A value between minimumZoomScale and maximumZoomScale in which to zoom to. | |
@param animated - Whether the transition is animated, or instant | |
NewerOlder