CS | Pixel format and bitmap information constants | Availability |
---|---|---|
Gray | 8 bpp, 8 bpc, kCGImageAlphaNone | Mac OS X, iOS |
Gray | 8 bpp, 8 bpc, kCGImageAlphaOnly | Mac OS X, iOS |
Gray | 16 bpp, 16 bpc, kCGImageAlphaNone | Mac OS X |
Gray | 32 bpp, 32 bpc, kCGImageAlphaNone OR kCGBitmapFloatComponents | Mac OS X |
RGB | 16 bpp, 5 bpc, kCGImageAlphaNoneSkipFirst | Mac OS X, iOS |
RGB | 32 bpp, 8 bpc, kCGImageAlphaNoneSkipFirst | Mac OS X, iOS |
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 Camera : NSObject | |
@property (nonatomic, strong) AVCaptureStillImageOutput* stillImageOutput; | |
@property (nonatomic,strong) AVCaptureSession *session; | |
- (AVCaptureDevice *)frontFacingCameraIfAvailable; | |
- (void)setupCaptureSession; | |
- (void)captureWithBlock:(void(^)(UIImage* block))block; | |
@end |
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)share:(UIImage *)immagine completion:(void(^)(NSError* error))completion | |
{ | |
[FBRequestConnection startWithGraphPath:@"/me/albums" parameters:nil HTTPMethod:@"GET" completionHandler:^(FBRequestConnection *connection,i d result, NSError *error) | |
{ | |
if (!error) | |
{ | |
NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; | |
[params setObject:UIImagePNGRepresentation(immagine) forKey:@"picture"]; | |
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"/%@/photos", result] parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection,result,NSError *error) |
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
// for find commit hash from HEAD | |
git reflog | |
// commit all changes and remember last commit hash | |
git checkout your_branch | |
git reset --hard your_hash |
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 Swizzle(Class class, SEL selector, void(^block)()) | |
{ | |
Method method = class_getInstanceMethod(class, selector); | |
//IMP imp = method_getImplementation(method); | |
method_setImplementation(method, imp_implementationWithBlock(block)); | |
} |
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 BEGIN_DEFINE_TYPE(type) NSString* NSStringFrom##type(type var) { | |
#define DEFINE_TYPE_VALUE(value) if (var == value) return @#value; | |
#define END_DEFINE_TYPE() return @"Unknown type"; } | |
typedef NS_ENUM(NSInteger, MyType) { | |
MyTypeTest, | |
MyTypeAppstore, | |
MyTypeRelease | |
}; |
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
git log --author=Andrey --after="2016-08-01 00:00" > ~/Documents/log.txt | |
git log --author=Andrey --after="2016-08-12 00:00" --pretty='format:%ad %B' > ~/Documents/log.txt |
Xcode 13.3 required macOS 12.0 or later, but with this tips you can use it on a macOS 11 (11.6.1 for me).
Xcode 13.2.1 should be installed anyway (/Applications/Xcode.app
).
- Download Xcode 13.3 from Apple Developer Portal;
- Unpack it and move to
/Applications
; - Right click on
Xcode_13.3.app
and selectShow Package Contents
; - Open
Contents/Info.plist
; - Set your current macOS version to
Minimum system version
(I just set 11.0).