This file contains 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
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
This file contains 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
// Created by SuStinge on 12/02/2018. | |
import UIKit | |
import Foundation | |
import AVFoundation | |
import MobileCoreServices | |
class PhotoLibraryHelper: NSObject { | |
public static let imagePicker = UIImagePickerController() | |
fileprivate let isPhotoLibraryAvailable = UIImagePickerController.isSourceTypeAvailable(.photoLibrary) | |
fileprivate let sourceTypePhotoAlbum = UIImagePickerControllerSourceType.photoLibrary |
This file contains 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
// Created by SuStinge on 12/02/2018. | |
import UIKit | |
import Foundation | |
import AVFoundation | |
import MobileCoreServices | |
class CameraHelper: NSObject { | |
public static let imagePicker = UIImagePickerController() | |
fileprivate let isCameraAvailable = UIImagePickerController.isSourceTypeAvailable(.camera) |
This file contains 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
@interface NSNotificationCenter : NSObject { | |
@package | |
void *_impl; | |
void *_callback; | |
void *_pad[11]; | |
} | |
@property (class, readonly, strong) NSNotificationCenter *defaultCenter; |
This file contains 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
// addObserver | |
void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior); | |
// postNotificationName | |
void CFNotificationCenterPostNotification(CFNotificationCenterRef center, CFNotificationName name, const void *object, CFDictionaryRef userInfo, Boolean deliverImmediately); | |
// removeObserver | |
void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFNotificationName name, const void *object); |
This file contains 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) viewDidLoad { | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; | |
} |
This file contains 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) triggeredObserver { | |
[[NSNotificationCenter defaultCenter] postNotificationName:UIKeyboardWillShowNotification object:nil userInfo:nil]; | |
} |
This file contains 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) dealloc { | |
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; | |
} |
This file contains 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
#include <stdio.h> | |
#define price double | |
#define PRINT(x) printf("macro: %f", x); | |
int main() { | |
price p = 12.3; | |
PRINT(p); | |
return 0; | |
} |
This file contains 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
#define CLASSNAME(x) NSStringFromClass([x class]) | |
NSLog(@"NSString:%@", CLASSNAME([NSString string])); | |
NSLog(@"NSMutableString:%@", CLASSNAME([NSMutableString string])); | |
#undef CLS |
OlderNewer