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
- (void)testAlert1:(id)sender | |
{ | |
UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"Error!" | |
message:@"Test error message" | |
preferredStyle:UIAlertControllerStyleAlert]; | |
UIAlertAction *alertAction = [UIAlertAction actionWithTitle:@"Dismiss" | |
style:UIAlertActionStyleDestructive | |
handler:^(UIAlertAction *action) { | |
NSLog(@"Dismiss button tapped!"); |
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
@IBAction func testAlert1() { | |
let controller = UIAlertController(title: "Error!", message: "Test error message", preferredStyle: .Alert) | |
let alertAction = UIAlertAction(title: "Dismiss", style: .Destructive) { (action) in | |
print("Dismiss button tapped!") | |
} | |
controller.addAction(alertAction) | |
presentViewController(controller, animated: true, completion: nil) |
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 GalleryItem : NSObject | |
@property (nonatomic, strong) NSString *itemImage; | |
+ (instancetype)galleryItemWithDictionary:(NSDictionary *)dictionary; | |
@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"]! | |
} | |
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
/// 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 <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
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 <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
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); |