Manos Chorianopoulos

add CampaignViewController

...@@ -7,14 +7,22 @@ ...@@ -7,14 +7,22 @@
7 7
8 import Foundation 8 import Foundation
9 import UIKit 9 import UIKit
10 +import WebKit
10 11
11 -@objc public class CampaignViewController: UIViewController { 12 +@objc public class CampaignViewController: UIViewController, WKNavigationDelegate {
13 + @IBOutlet weak var webview: WKWebView!
14 +
15 + var campaignUrl: String = ""
16 +
17 + override func viewDidLoad() {
18 + super.viewDidLoad()
12 19
13 - public override func viewWillAppear(_ animated: Bool) {
14 - super.viewWillAppear(animated)
15 setBackButton() 20 setBackButton()
16 - setNavigationTitle("Καμπάνια")
17 - }
18 21
22 + webview.navigationDelegate = self
23 + let url = URL(string: campaignUrl)!
24 + webview.load(URLRequest(url: url))
25 + webview.allowsBackForwardNavigationGestures = true
26 + }
19 27
20 } 28 }
......
...@@ -205,12 +205,43 @@ ...@@ -205,12 +205,43 @@
205 <scene sceneID="twP-1E-dhb"> 205 <scene sceneID="twP-1E-dhb">
206 <objects> 206 <objects>
207 <viewController storyboardIdentifier="CampaignViewController" id="yqg-nb-9Dh" customClass="CampaignViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController"> 207 <viewController storyboardIdentifier="CampaignViewController" id="yqg-nb-9Dh" customClass="CampaignViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController">
208 - <view key="view" contentMode="scaleToFill" id="Cz1-PS-4Dy"> 208 + <view key="view" contentMode="scaleToFill" id="V7y-5C-oMC">
209 <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> 209 <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
210 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> 210 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
211 - <viewLayoutGuide key="safeArea" id="a8E-Xr-REu"/> 211 + <subviews>
212 - <color key="backgroundColor" systemColor="systemBackgroundColor"/> 212 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iPT-gj-hEL">
213 + <rect key="frame" x="0.0" y="44" width="414" height="852"/>
214 + <subviews>
215 + <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bHn-Kz-pbS">
216 + <rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
217 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
218 + <wkWebViewConfiguration key="configuration">
219 + <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
220 + <wkPreferences key="preferences"/>
221 + </wkWebViewConfiguration>
222 + </wkWebView>
223 + </subviews>
224 + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
225 + <constraints>
226 + <constraint firstAttribute="bottom" secondItem="bHn-Kz-pbS" secondAttribute="bottom" id="CcL-ZT-QeZ"/>
227 + <constraint firstAttribute="trailing" secondItem="bHn-Kz-pbS" secondAttribute="trailing" id="Nsn-7j-FSx"/>
228 + <constraint firstItem="bHn-Kz-pbS" firstAttribute="leading" secondItem="iPT-gj-hEL" secondAttribute="leading" id="UTz-nY-JvS"/>
229 + <constraint firstItem="bHn-Kz-pbS" firstAttribute="top" secondItem="iPT-gj-hEL" secondAttribute="top" id="WKD-3C-3kF"/>
230 + </constraints>
231 + </view>
232 + </subviews>
233 + <viewLayoutGuide key="safeArea" id="xUc-yV-Y8f"/>
234 + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
235 + <constraints>
236 + <constraint firstAttribute="bottom" secondItem="iPT-gj-hEL" secondAttribute="bottom" id="5l8-hX-bhz"/>
237 + <constraint firstItem="iPT-gj-hEL" firstAttribute="leading" secondItem="V7y-5C-oMC" secondAttribute="leading" id="Owm-bA-52e"/>
238 + <constraint firstItem="iPT-gj-hEL" firstAttribute="top" secondItem="xUc-yV-Y8f" secondAttribute="top" id="TkC-xl-X4w"/>
239 + <constraint firstAttribute="trailing" secondItem="iPT-gj-hEL" secondAttribute="trailing" id="yjN-j9-XbE"/>
240 + </constraints>
213 </view> 241 </view>
242 + <connections>
243 + <outlet property="webview" destination="bHn-Kz-pbS" id="Fhg-oM-cQy"/>
244 + </connections>
214 </viewController> 245 </viewController>
215 <placeholder placeholderIdentifier="IBFirstResponder" id="Ee1-aw-PRJ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> 246 <placeholder placeholderIdentifier="IBFirstResponder" id="Ee1-aw-PRJ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
216 </objects> 247 </objects>
......