WWDC 2007 2008 2009 2010 2011 2012 2013 2014 2015
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
NSTIFFCompression with zip has enum value 8 | |
NSData *originalData = [NSData dataWithContentsOfURL:URL]; | |
NSImage *image = [[NSImage alloc] initByReferencingURL:URL]; | |
NSBitmapImageRep *imageRep = (NSBitmapImageRep *)[[image representations] firstObject]; | |
NSLog(@"%@", [NSBitmapImageRep localizedNameForTIFFCompressionType:8]); //prints null | |
BOOL canBecompressed = [imageRep canBeCompressedUsing:8]; | |
NSLog(@"%d", canBecompressed); //prints NO |
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
import Cocoa | |
class SomeView : NSView { | |
var trackingArea : NSTrackingArea? | |
override func draw(_ dirtyRect: NSRect) { | |
NSColor.red.setFill() | |
dirtyRect.fill() | |
} | |
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
#import <Cocoa/Cocoa.h> | |
#import <CoreImage/CoreImage.h> | |
@protocol CILineOverlay <CIFilter> | |
@property (nonatomic, retain) CIImage *inputImage; | |
@property (nonatomic) float threshold; | |
@end | |
@interface CIFilter(CILineOverlay) | |
+ (CIFilter<CILineOverlay>*) lineOverlayFilter; |
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
点我达iOS首页 | |
iOS Block探究 | |
2017/12/28 | |
### | |
iOS Block探究 | |
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
#import <AVFoundation/AVFoundation.h> | |
@interface AVCaptureDevice(Additions) | |
+ (NSArray<AVCaptureDevice *>*)inputCameraDevices; | |
- (BOOL)isBuiltIn; | |
- (BOOL)hasVideoMedia; | |
- (BOOL)canOpenCamera; | |
@end |
The dynamic wallpaper in MacOS Mojave is a single 114 MB .heic
file that seems to contain 16 embedded images.
It also contains the following binary plist data in its metadata under the key "Solar". It's an array of 16 items, each with four keys:
i
(integer). This seems to be the image index.o
(integer). This is always 1 or 0. Stephen Radford thinks it indicates dark mode (0) vs. light mode (1).a
(decimal). I’m pretty sure this is the angle of the sun over the horizon. 0º = sunset/sunrise. 90º = sun directly overhead. Negative values = sun below horizon.z
(decimal). This seems to be the cardinal position of the sun relative to the camera. 0º = sun is directly in front of the camera. 90º = sun is directly to the right of the camera. 180º = sun is directly behind the 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
1. Quit Photos app and run command "launchctl stop photolibraryd" | |
2. Use sqlite3 or some app to edit "database/photos.db" file; run SQL command UPDATE RKVersion SET createDate = imageDate WHERE imageDate >0 | |
3. Run command "launchctl start photolibraryd" | |
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
// need to include <Carbon/Carbon.h> and link against Carbon.framework | |
// not every layout/input method has TIFF icon | |
CFArrayRef list = TISCreateInputSourceList(NULL, true); | |
for (int i = 0; i < CFArrayGetCount(list); i++) { | |
TISInputSourceRef source = (TISInputSourceRef)CFArrayGetValueAtIndex(list, i); | |
IconRef icon = TISGetInputSourceProperty(source, kTISPropertyIconRef); | |
CFStringRef sourceID = TISGetInputSourceProperty(source, kTISPropertyInputSourceID); |
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
// | |
// main.m | |
// antidebugging | |
// | |
// Created by Vincent Tan on 7/8/15. | |
// Copyright (c) 2015 Vincent Tan. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
#import "AppDelegate.h" |
NewerOlder