Skip to content

Commit 78d641b

Browse files
committed
Same change for offline view controller
1 parent dc1602a commit 78d641b

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

EmbedFramework/AdaWebHostViewController.storyboard

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="D6W-gQ-JwA">
3-
<device id="retina6_1" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="D6W-gQ-JwA">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
97
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
108
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
119
</dependencies>
@@ -57,7 +55,7 @@
5755
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Qvu-aw-TnU">
5856
<rect key="frame" x="0.0" y="157.5" width="280" height="80"/>
5957
<subviews>
60-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DyO-zH-0Hs">
58+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DyO-zH-0Hs">
6159
<rect key="frame" x="85" y="10" width="110" height="32"/>
6260
<color key="backgroundColor" red="0.20256891846656799" green="0.45271092653274536" blue="0.90760737657546997" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
6361
<constraints>
@@ -93,14 +91,14 @@
9391
</constraints>
9492
</view>
9593
</subviews>
94+
<viewLayoutGuide key="safeArea" id="auu-Pf-WkL"/>
9695
<color key="backgroundColor" white="0.0" alpha="0.5" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
9796
<constraints>
9897
<constraint firstAttribute="bottom" secondItem="B1c-UZ-eXX" secondAttribute="bottom" id="2fw-wv-cmS"/>
9998
<constraint firstItem="B1c-UZ-eXX" firstAttribute="leading" secondItem="AJC-ml-g1g" secondAttribute="leading" id="DBe-mr-5CX"/>
10099
<constraint firstAttribute="trailing" secondItem="B1c-UZ-eXX" secondAttribute="trailing" id="P5o-0D-Uef"/>
101100
<constraint firstItem="B1c-UZ-eXX" firstAttribute="top" secondItem="AJC-ml-g1g" secondAttribute="top" id="cDo-Si-Ode"/>
102101
</constraints>
103-
<viewLayoutGuide key="safeArea" id="auu-Pf-WkL"/>
104102
</view>
105103
<connections>
106104
<outlet property="container" destination="B1c-UZ-eXX" id="t7G-8U-aJH"/>

EmbedFramework/OfflineViewController.swift

+9-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ class OfflineViewController: UIViewController {
1717

1818
static func create() -> OfflineViewController? {
1919
let bundle = Bundle(for: OfflineViewController.self)
20-
let frameworkBundlePath = bundle.path(forResource: "AdaEmbedFramework", ofType: "bundle")!
21-
let frameworkBundle = Bundle(path: frameworkBundlePath)
22-
let storyboard = UIStoryboard(name: "AdaWebHostViewController", bundle: frameworkBundle)
20+
// Loads the resource_bundle if available (Cocoapod)
21+
if (bundle.path(forResource: "AdaEmbedFramework", ofType: "bundle") != nil){
22+
let frameworkBundlePath = bundle.path(forResource: "AdaEmbedFramework", ofType: "bundle")!
23+
let frameworkBundle = Bundle(path: frameworkBundlePath)
24+
storyboard = UIStoryboard(name: "AdaWebHostViewController", bundle: frameworkBundle)
25+
} else {
26+
// Used for if SDK was manually imported
27+
storyboard = UIStoryboard(name: "AdaWebHostViewController", bundle: bundle)
28+
}
2329
return storyboard.instantiateViewController(withIdentifier: "OfflineViewController") as? OfflineViewController
2430
}
2531

0 commit comments

Comments
 (0)