-
Notifications
You must be signed in to change notification settings - Fork 0
feat: maskWebView option and accesibilityIdentifier support #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6742cde
- maskWebView option
abelonogov-ld b95da8c
update doc
abelonogov-ld c130f0b
Merge branch 'main' into andrey/webview-storyboard
abelonogov-ld 2cc53ef
Delete commented code
abelonogov-ld aa46372
Another unused fields
abelonogov-ld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import SwiftUI | ||
| import UIKit | ||
|
|
||
| struct StoryboardRootView: UIViewControllerRepresentable { | ||
| func makeUIViewController(context: Context) -> UIViewController { | ||
| let sb = UIStoryboard(name: "StoryboardiOS", bundle: .main) | ||
| // Use the Initial VC, or use instantiateViewController(withIdentifier:) if you set an ID | ||
| return sb.instantiateInitialViewController()! | ||
| } | ||
| func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24128" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX"> | ||
| <device id="retina6_12" orientation="portrait" appearance="light"/> | ||
| <dependencies> | ||
| <deployment identifier="iOS"/> | ||
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24063"/> | ||
| <capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
| <capability name="System colors in document resources" minToolsVersion="11.0"/> | ||
| <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
| </dependencies> | ||
| <scenes> | ||
| <!--StoryboardiOS--> | ||
| <scene sceneID="s0d-6b-0kx"> | ||
| <objects> | ||
| <viewController title="StoryboardiOS" id="Y6W-OH-hqX" customClass="StoryboardiOSViewController" customModule="TestApp" sceneMemberID="viewController"> | ||
| <view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc"> | ||
| <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> | ||
| <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| <subviews> | ||
| <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="tM9-Bg-Ve2"> | ||
| <rect key="frame" x="148" y="118" width="97" height="34"/> | ||
| <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| <fontDescription key="fontDescription" type="system" pointSize="14"/> | ||
| <textInputTraits key="textInputTraits"/> | ||
| </textField> | ||
| <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h3i-fX-rrY"> | ||
| <rect key="frame" x="78" y="125" width="45" height="21"/> | ||
| <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| <fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
| <nil key="textColor"/> | ||
| <nil key="highlightedColor"/> | ||
| </label> | ||
| </subviews> | ||
| <viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/> | ||
| <color key="backgroundColor" systemColor="systemBackgroundColor"/> | ||
| </view> | ||
| </viewController> | ||
| <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> | ||
| </objects> | ||
| <point key="canvasLocation" x="139" y="131"/> | ||
| </scene> | ||
| </scenes> | ||
| <resources> | ||
| <systemColor name="systemBackgroundColor"> | ||
| <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
| </systemColor> | ||
| </resources> | ||
| </document> |
30 changes: 30 additions & 0 deletions
30
TestApp/Sources/Storyboard/StoryboardiOSViewController.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import UIKit | ||
|
|
||
| class StoryboardiOSViewController: UIViewController { | ||
| // MARK: - Outlets | ||
| @IBOutlet weak var nameLabel: UILabel! | ||
| @IBOutlet weak var nameTextField: UITextField! | ||
|
||
| // @IBOutlet weak var passwordLabel: UILabel! | ||
| // @IBOutlet weak var passwordTextField: UITextField! | ||
| // @IBOutlet weak var loginButton: UIButton! | ||
|
|
||
| // MARK: - Actions | ||
| @IBAction func loginButtonTapped(_ sender: UIButton) { | ||
| // Example login validation logic (add your own as needed) | ||
abelonogov-ld marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // let name = nameTextField.text ?? "" | ||
| // let password = passwordTextField.text ?? "" | ||
| // if name.isEmpty || password.isEmpty { | ||
| // // Present an alert or show an error | ||
| // let alert = UIAlertController(title: "Missing Info", message: "Please enter both name and password.", preferredStyle: .alert) | ||
| // alert.addAction(UIAlertAction(title: "OK", style: .default)) | ||
| // present(alert, animated: true) | ||
| // return | ||
| // } | ||
| // Perform login logic here | ||
| } | ||
|
|
||
| override func viewDidLoad() { | ||
| super.viewDidLoad() | ||
| view.backgroundColor = .white | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import UIKit | ||
| import WebKit | ||
| import SwiftUI | ||
|
|
||
| class WebViewController: UIViewController, WKUIDelegate, WKNavigationDelegate { | ||
|
|
||
| private var webView: WKWebView! | ||
|
|
||
| override func loadView() { | ||
|
|
||
| // Configure the web view | ||
| let webConfiguration = WKWebViewConfiguration() | ||
| webView = WKWebView(frame: .zero, configuration: webConfiguration) | ||
| webView.uiDelegate = self | ||
| webView.navigationDelegate = self | ||
| view = webView | ||
| } | ||
|
|
||
| override func viewDidLoad() { | ||
| super.viewDidLoad() | ||
|
|
||
| // The notice should automatically get hidden in the web view as consent is passed from the mobile app to the website. However, it might happen that the notice gets displayed for a very short time before being hidden. You can disable the notice in your web view to make sure that it never shows by appending didomiConfig.notice.enable=false to the query string of the URL that you are loading | ||
| let myURL = URL(string:"https://launchdarkly.com/")! | ||
| let myRequest = URLRequest(url: myURL) | ||
| webView.load(myRequest) | ||
| } | ||
| } | ||
|
|
||
| struct WebViewControllertView: UIViewControllerRepresentable { | ||
| func makeUIViewController(context: Context) -> UIViewController { | ||
| WebViewController() | ||
| } | ||
| func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.