Skip to content

Instantly share code, notes, and snippets.

@vpaharia
vpaharia / SnapshotWKWebView.m
Created November 3, 2016 19:32
Snapshot complete WKWebView
// to snapshot complete wkwebview, scroll webview itself inside a container view rather than scrolling webview's content
@property (strong, nonatomic) WKWebView* webView;
@property (strong, nonatomic) UIView *containerView;
- (void)setupWebview:(CGSize)size {
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
[configuration.userContentController addScriptMessageHandler:self name:@"interOp"];
@vpaharia
vpaharia / UISearchBar+DetermineKeyboardType.m
Created November 3, 2016 18:36
Determine current keyboard type in iOS 10 and iOS 9
//
// UISearchBar+DetermineKeyboardType.m
//
// message [self.searchBar determineKeyboardType] to retreive current keyboard type
//
// Problem is explained here: http://tech.ustwo.com/2014/05/29/ios-uikeyboardtype-issue/
// Most of the code is copied from https://github.com/martinstolz/UIKeyboardType-Fix-Demo
// few modification made to support iOS 10 && 9
//