Skip to content

Commit 0413e89

Browse files
authored
Merge pull request #2371 from numbersprotocol/fix-iframe-white-flash-on-ios
fix: iOS iframe white flash with custom View Controller
2 parents 8a58ca4 + 865b72d commit 0413e89

File tree

3 files changed

+47
-8
lines changed

3 files changed

+47
-8
lines changed

ios/App/App.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; };
1717
DE095D00277AF00900242276 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DE095CFF277AF00900242276 /* GoogleService-Info.plist */; };
1818
DE28999027B790A900F6581C /* public in Resources */ = {isa = PBXBuildFile; fileRef = DE28998F27B790A900F6581C /* public */; };
19+
DE590AEA293B40E400AF72F3 /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE590AE9293B40E400AF72F3 /* MyViewController.swift */; };
1920
DE7E48442869E4CA002ED956 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DE7E48432869E4CA002ED956 /* StoreKit.framework */; };
2021
/* End PBXBuildFile section */
2122

@@ -34,6 +35,7 @@
3435
DE095CFF277AF00900242276 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
3536
DE2706742854C3960046512E /* Configuration.storekit */ = {isa = PBXFileReference; lastKnownFileType = text; path = Configuration.storekit; sourceTree = "<group>"; };
3637
DE28998F27B790A900F6581C /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = "<group>"; };
38+
DE590AE9293B40E400AF72F3 /* MyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyViewController.swift; sourceTree = "<group>"; };
3739
DE7E48432869E4CA002ED956 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
3840
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = "<group>"; };
3941
/* End PBXFileReference section */
@@ -92,6 +94,7 @@
9294
504EC3101FED79650016851F /* LaunchScreen.storyboard */,
9395
504EC3131FED79650016851F /* Info.plist */,
9496
2FAD9762203C412B000D30F8 /* config.xml */,
97+
DE590AE9293B40E400AF72F3 /* MyViewController.swift */,
9598
);
9699
path = App;
97100
sourceTree = "<group>";
@@ -219,6 +222,7 @@
219222
isa = PBXSourcesBuildPhase;
220223
buildActionMask = 2147483647;
221224
files = (
225+
DE590AEA293B40E400AF72F3 /* MyViewController.swift in Sources */,
222226
504EC3081FED79650016851F /* AppDelegate.swift in Sources */,
223227
);
224228
runOnlyForDeploymentPostprocessing = 0;
@@ -376,7 +380,7 @@
376380
PRODUCT_NAME = "$(TARGET_NAME)";
377381
PROVISIONING_PROFILE_SPECIFIER = NumbersAppDistributionV4;
378382
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = NumbersAppDistributionV4;
379-
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG";
383+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
380384
SWIFT_VERSION = 5.0;
381385
TARGETED_DEVICE_FAMILY = "1,2";
382386
VERSIONING_SYSTEM = "apple-generic";
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14111" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3-
<device id="retina4_7" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina4_7" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
97
</dependencies>
108
<scenes>
11-
<!--Bridge View Controller-->
9+
<!--My View Controller-->
1210
<scene sceneID="tne-QT-ifu">
1311
<objects>
14-
<viewController id="BYZ-38-t0r" customClass="CAPBridgeViewController" customModule="Capacitor" sceneMemberID="viewController"/>
12+
<viewController id="BYZ-38-t0r" customClass="MyViewController" customModule="App" customModuleProvider="target" sceneMemberID="viewController"/>
1513
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
1614
</objects>
15+
<point key="canvasLocation" x="76" y="-2"/>
1716
</scene>
1817
</scenes>
1918
</document>

ios/App/App/MyViewController.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// MyViewController.swift
3+
// App
4+
//
5+
// Created by sultanmyrza on 2022/12/3.
6+
//
7+
8+
import UIKit
9+
import Capacitor
10+
11+
class MyViewController: CAPBridgeViewController {
12+
13+
override func viewDidLoad() {
14+
super.viewDidLoad()
15+
16+
// Do any additional setup after loading the view.
17+
}
18+
19+
20+
override func webView(with frame: CGRect, configuration: WKWebViewConfiguration) -> WKWebView {
21+
let webView = WKWebView(frame: frame, configuration: configuration)
22+
webView.isOpaque = false
23+
return webView
24+
}
25+
26+
/*
27+
// MARK: - Navigation
28+
29+
// In a storyboard-based application, you will often want to do a little preparation before navigation
30+
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
31+
// Get the new view controller using segue.destination.
32+
// Pass the selected object to the new view controller.
33+
}
34+
*/
35+
36+
}

0 commit comments

Comments
 (0)