1 | textView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0); |
去除顶部的10个像素空白区域
1 | textView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0); |
去除顶部的10个像素空白区域
1 | NSString *urlString = @"http://www.books.com:3321/lib/query;steve?key=job&sort=asc#chapter2"; |
1 | url.absoluteString http://www.books.com:3321/lib/query;steve?key=job&sort=asc#chapter2 |
iPhone4S,iPhone5/5s,iPhone6
竖屏:(w:Compact h:Regular)
横屏:(w:Compact h:Compact)
iPhone6 Plus
竖屏:(w:Compact h:Regular)
横屏:(w:Regular h:Compact)
iPad
竖屏:(w:Regular h:Regular)
横屏:(w:Regular h:Regular)
1 | @interface Animal : NSObject @end |
####console output
1 | in Animal load Animal |
1 | NSKeyValueObservingOptions.New 新值 |
.xcuserstate
Xcode
.pbxuser
.mode1v3
.mode2v3
.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/
1 | class IndexViewController: UIViewController{} |
1 | CWInterface *wifi = [CWWiFiClient sharedWiFiClient].interface; |
Getting to Know TextKit
https://www.objc.io/issues/5-ios7/getting-to-know-textkit/
1 | NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"alert" ofType:@"wav"]; |
播放系统声效1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28int soundIndex = 0;
- (void) tryLoopPlaySound{
NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/System/Library/Sounds"
error:nil];
NSUInteger arrayCount = [directoryContents count];
if (soundIndex < arrayCount-1) {
soundIndex++;
}
else {
soundIndex = 0;
}
[self playSystemSound:soundIndex];
}
-(void) playSystemSound:(int) index{
NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/System/Library/Sounds"
error:nil];
NSUInteger arrayCount = [directoryContents count];
if(index >= arrayCount) {
return;
}
NSString *soundName = [directoryContents objectAtIndex:
index];
soundName = [soundName stringByDeletingPathExtension];
NSSound *systemSound = [NSSound soundNamed:soundName];
NSLog(@"soundName %@ %d",soundName, index);
[systemSound play];
}