Last active
September 26, 2015 21:27
-
-
Save matsuda/1161588 to your computer and use it in GitHub Desktop.
Objective-CのUIView関連のスニペット
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
/* | |
UIWebViewのUserAgentを取得 | |
*/ | |
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero]; | |
NSString *ua = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"]; | |
NSLog(@"userAgent >>> %@", ua); | |
[webView release]; | |
// ASIHTTPRequestにUserAgentを設定 | |
// [ASIHTTPRequest setDefaultUserAgentString:ua]; |
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
/* | |
再帰的に子viewを表示 | |
*/ | |
@interface UIView (PrivateAPI) | |
- (NSString *)recursiveDescription; | |
@end | |
// view is UIView's object | |
NSLog(@"%@", [view recursiveDescription]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment