Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shazron/sawkwebviewuidelegate
Default UIDelegate for WKWebView to match UIWebView behaviour
https://github.com/shazron/sawkwebviewuidelegate
Last synced: 8 days ago
JSON representation
Default UIDelegate for WKWebView to match UIWebView behaviour
- Host: GitHub
- URL: https://github.com/shazron/sawkwebviewuidelegate
- Owner: shazron
- License: other
- Created: 2014-07-12T07:25:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-12T08:17:32.000Z (over 10 years ago)
- Last Synced: 2024-10-30T02:42:44.233Z (about 2 months ago)
- Language: Objective-C
- Size: 121 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## SAWKWebViewUIDelegate
https://github.com/shazron/SAWKWebViewUIDelegateA UIDelegate for WKWebView that is equal to the default UIDelegate behaviour in a UIWebView. iOS 8 only.
### Usage
```
WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
configuration.userContentController = [[WKUserContentController alloc] init];WKWebView* webView = [[WKWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds] configuration:configuration];
```#### Method 1: uses CFBundleDisplayName for the title and the app rootViewController
```
SAWKWebViewUIDelegate* uiDelegate = [[SAWKWebViewUIDelegate alloc] init];
webView.UIDelegate = uiDelegate;
```#### Method 2: specify the title and uses the app rootViewController
```
SAWKWebViewUIDelegate* uiDelegate = [[SAWKWebViewUIDelegate alloc] initWithTitle:@"MyAppTitle"];
webView.UIDelegate = uiDelegate;
```#### Method 3: specify the title and specify the viewController
```
UIViewController* viewController = [UIApplication sharedApplication].delegate.window.rootViewController;
SAWKWebViewUIDelegate* uiDelegate = [[SAWKWebViewUIDelegate alloc] initWithTitle:@"MyAppTitle" viewController:viewController];
webView.UIDelegate = uiDelegate;
```### Issues
https://github.com/shazron/SAWKWebViewUIDelegate/issues
### License
Copyright [2014] Shazron Abdullah
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.