Skip to content

Instantly share code, notes, and snippets.

@vpaharia
vpaharia / SnapshotWKWebView.m
Created Nov 3, 2016
Snapshot complete WKWebView
View SnapshotWKWebView.m
// 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 Nov 3, 2016
Determine current keyboard type in iOS 10 and iOS 9
View UISearchBar+DetermineKeyboardType.m
//
// 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
//