Skip to content

Commit

Permalink
feat: add isinspectable and built with xcode 17 (#29)
Browse files Browse the repository at this point in the history
* feat: add isinspectable and built with xcode 17

* Update WebViewController.swift

* bump version as well
  • Loading branch information
KazuCocoa committed Jun 12, 2023
1 parent 6ff9d58 commit ff3f62e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,11 @@ npm run watch
```
npm test
```

## `webView.isInspectable`

Since iOS 16.4, the `WKWebView` insatnce needs to enable `isInspectable` to make WebView available.
The sample app enables it.



Binary file modified UIKitCatalog/UIKitCatalog-iphonesimulator.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions UIKitCatalog/UIKitCatalog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@
INFOPLIST_FILE = "$(SRCROOT)/UIKitCatalog/UIKitCatalog-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
MARKETING_VERSION = 2.13;
MARKETING_VERSION = 2.14;
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UICatalog";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -756,7 +756,7 @@
INFOPLIST_FILE = "$(SRCROOT)/UIKitCatalog/UIKitCatalog-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
MARKETING_VERSION = 2.13;
MARKETING_VERSION = 2.14;
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UICatalog";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 4 additions & 0 deletions UIKitCatalog/UIKitCatalog/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class WebViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

if #available(iOS 16.4, *) {
webView.isInspectable = true
}

// So we can capture failures in "didFailProvisionalNavigation".
webView.navigationDelegate = self
loadAddressURL()
Expand Down

0 comments on commit ff3f62e

Please sign in to comment.