Install development packages via Brew. If you're using OS X 10.12+, install osxfuse via cask as Brew suggest in error output.
brew tap homebrew/fuse
brew install --HEAD usbmuxd
brew install --HEAD libimobiledevice
brew install --HEAD ifuse
| #!/bin/bash | |
| # Provides list of gems that have nothing depending on them | |
| for target in $(gem list -l --no-verbose | cut -d ' ' -f 1); do | |
| if [ "$(gem dependency -lr $target | wc -l)" -eq 2 ]; then | |
| echo "$target" | |
| fi | |
| done |
| typedef CF_ENUM(int, CFNetworkErrors) { | |
| kCFHostErrorHostNotFound = 1, | |
| kCFHostErrorUnknown = 2, // Query the kCFGetAddrInfoFailureKey to get the value returned from getaddrinfo; lookup in netdb.h | |
| // SOCKS errors; in all cases you may query kCFSOCKSStatusCodeKey to recover the status code returned by the server | |
| kCFSOCKSErrorUnknownClientVersion = 100, | |
| kCFSOCKSErrorUnsupportedServerVersion = 101, // Query the kCFSOCKSVersionKey to find the version requested by the server | |
| // SOCKS4-specific errors | |
| kCFSOCKS4ErrorRequestFailed = 110, // request rejected or failed by the server | |
| kCFSOCKS4ErrorIdentdFailed = 111, // request rejected because SOCKS server cannot connect to identd on the client |
| platform :ios, '9.0' | |
| inhibit_all_warnings! | |
| use_frameworks! | |
| # Guide and example for a neat way to modify pods using patchfiles | |
| # https://github.com/jpsim/pod-diffs | |
| post_install do | installer | | |
| `patch -p0 < Diffs/TARGET_FILE.m.diff` | |
| end |
| @import MobileCoreServices; | |
| @import AVFoundation; | |
| @import AssetsLibrary; | |
| // ... | |
| - (void)cropVideoAtURL:(NSURL *)videoURL toSquareWithSide:(CGFloat)sideLength completion:(void(^)(NSURL *resultURL, NSError *error))completionHander { | |
| /* asset */ |
| #import <UIKit/UIKit.h> | |
| /// This constraint could be toggled between two values (min/max) by `enlarged` flag | |
| @interface ToggleConstraint : NSLayoutConstraint | |
| /** | |
| Max size of the height/width/offset/etc. | |
| Think about it as some UI element can change it's size between min and max values. | |
| */ | |
| @property (nonatomic, assign) IBInspectable BOOL enlarged; |
| #import <UIKit/UIKit.h> | |
| /// Allows to use a 1px wide delimiter views | |
| @interface ScalingConstraint : NSLayoutConstraint | |
| @end | |
| @implementation ScalingConstraint | |
| - (CGFloat)constant { | |
| return [super constant] / [UIScreen mainScreen].scale; | |
| } |
| // Swift version of the code from http://stackoverflow.com/a/30335594/1986600 | |
| import CoreTelephony | |
| override func awakeFromNib() { | |
| super.awakeFromNib() | |
| let isCapableToCall: Bool | |
| if UIApplication.sharedApplication().canOpenURL(NSURL(string: "tel://")!) { | |
| // Check if iOS Device supports phone calls |
| :beep frequency=264 length=250ms; | |
| :delay 500ms; | |
| :beep frequency=264 length=250ms; | |
| :delay 250ms; | |
| :beep frequency=297 length=1000ms; | |
| :delay 250ms; | |
| :beep frequency=264 length=1000ms; | |
| :delay 250ms; | |
| :beep frequency=352 length=1000ms; | |
| :delay 250ms; |
| #define INC_SYSTEM_VERSION(v) ((NSOperatingSystemVersion){v.majorVersion, v.minorVersion + 1, 0}) | |
| #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:v] | |
| #define SYSTEM_VERSION_LESS_THAN(v) (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)) | |
| #define SYSTEM_VERSION_EQUAL_TO(v) (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) && (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(INC_SYSTEM_VERSION(v)))) | |
| #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) (SYSTEM_VERSION_LESS_THAN(v) || SYSTEM_VERSION_EQUAL_TO(v)) | |
| #define SYSTEM_VERSION_GREATER_THAN(v) (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) && (!SYSTEM_VERSION_EQUAL_TO(v))) | |
| /* | |
| // Manual logical check | |
| NSOperatingSystemVersion v = (NSOperatingSystemVersion){8, 4, 0}; |