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
// Swift 3 | |
import UIKit | |
class TestView: UIView { | |
// MARK: Observers | |
override func didMoveToWindow() { | |
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 TestView | |
#pragma mark - Observers | |
- (void)didMoveToWindow | |
{ | |
if (self.window) // If self.window != nil, it means view was added to the window | |
{ | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(test:) |
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
// Swift 3 | |
let testArray: [Double] = [15.67, 9.87, 4.56, 3.45, 3.45, 8.76, 6, 1, 20.11] | |
let average: Double = (testArray as NSArray).value(forKeyPath: "@avg.self") as! Double | |
print("Average \(average)") |
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
NSArray *testArray = @[@(15.67), @(9.87), @(4.56), @(3.45), @(8.76), @(6), @(1), @(20.11)]; | |
NSNumber *average = [testArray valueForKeyPath:@"@avg.self"]; | |
NSLog(@"Average %@", average); |
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 <UIKit/UIKit.h> | |
@interface GalleryItemsLayout : UICollectionViewLayout | |
@property (nonatomic, readonly) CGFloat horizontalInset; | |
@property (nonatomic, readonly) CGFloat verticalInset; | |
@property (nonatomic, readonly) CGFloat minimumItemWidth; | |
@property (nonatomic, readonly) CGFloat maximumItemWidth; | |
@property (nonatomic, readonly) CGFloat itemHeight; |
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 UIKit | |
class GalleryItemsLayout: UICollectionViewLayout { | |
var horizontalInset = 0.0 as CGFloat | |
var verticalInset = 0.0 as CGFloat | |
var minimumItemWidth = 0.0 as CGFloat | |
var maximumItemWidth = 0.0 as CGFloat | |
var itemHeight = 0.0 as CGFloat |
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> | |
void checkJailbreakSymlinks() | |
{ | |
NSArray *linksChecks = @[LOO_CRYPT_STR_N("/Applications", 13), | |
LOO_CRYPT_STR_N("/usr/libexec", 12), | |
LOO_CRYPT_STR_N("/usr/share", 10), | |
LOO_CRYPT_STR_N("/Library/Wallpaper", 18), | |
LOO_CRYPT_STR_N("/usr/include", 12)]; | |
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
/// Writes the textual representations of `items` most suitable for | |
/// debugging, separated by `separator` and terminated by | |
/// `terminator`, into the standard output. | |
/// | |
/// The textual representations are obtained for each `item` via | |
/// the expression `String(reflecting: item)`. | |
/// | |
/// - Note: To print without a trailing newline, pass `terminator: ""` | |
/// | |
/// - SeeAlso: `print`, `Streamable`, `CustomStringConvertible`, |
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/Foundation.h> | |
@interface Log : NSObject | |
extern void SSLog(BOOL releaseLog, NSString *format, ...) NS_FORMAT_FUNCTION(2,3); | |
@end |
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 | |
class GalleryItem { | |
var itemImage: String | |
init(dataDictionary:Dictionary<String,String>) { | |
itemImage = dataDictionary["itemImage"]! | |
} | |
NewerOlder