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
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
###################### | |
# 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
#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
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) | |
/// |
OlderNewer