Manos Chorianopoulos

add CampaignViewController

......@@ -7,14 +7,22 @@
import Foundation
import UIKit
import WebKit
@objc public class CampaignViewController: UIViewController {
@objc public class CampaignViewController: UIViewController, WKNavigationDelegate {
@IBOutlet weak var webview: WKWebView!
var campaignUrl: String = ""
override func viewDidLoad() {
super.viewDidLoad()
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setBackButton()
setNavigationTitle("Καμπάνια")
}
webview.navigationDelegate = self
let url = URL(string: campaignUrl)!
webview.load(URLRequest(url: url))
webview.allowsBackForwardNavigationGestures = true
}
}
......
......@@ -205,12 +205,43 @@
<scene sceneID="twP-1E-dhb">
<objects>
<viewController storyboardIdentifier="CampaignViewController" id="yqg-nb-9Dh" customClass="CampaignViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Cz1-PS-4Dy">
<view key="view" contentMode="scaleToFill" id="V7y-5C-oMC">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="a8E-Xr-REu"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iPT-gj-hEL">
<rect key="frame" x="0.0" y="44" width="414" height="852"/>
<subviews>
<wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bHn-Kz-pbS">
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences"/>
</wkWebViewConfiguration>
</wkWebView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="bHn-Kz-pbS" secondAttribute="bottom" id="CcL-ZT-QeZ"/>
<constraint firstAttribute="trailing" secondItem="bHn-Kz-pbS" secondAttribute="trailing" id="Nsn-7j-FSx"/>
<constraint firstItem="bHn-Kz-pbS" firstAttribute="leading" secondItem="iPT-gj-hEL" secondAttribute="leading" id="UTz-nY-JvS"/>
<constraint firstItem="bHn-Kz-pbS" firstAttribute="top" secondItem="iPT-gj-hEL" secondAttribute="top" id="WKD-3C-3kF"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="xUc-yV-Y8f"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="iPT-gj-hEL" secondAttribute="bottom" id="5l8-hX-bhz"/>
<constraint firstItem="iPT-gj-hEL" firstAttribute="leading" secondItem="V7y-5C-oMC" secondAttribute="leading" id="Owm-bA-52e"/>
<constraint firstItem="iPT-gj-hEL" firstAttribute="top" secondItem="xUc-yV-Y8f" secondAttribute="top" id="TkC-xl-X4w"/>
<constraint firstAttribute="trailing" secondItem="iPT-gj-hEL" secondAttribute="trailing" id="yjN-j9-XbE"/>
</constraints>
</view>
<connections>
<outlet property="webview" destination="bHn-Kz-pbS" id="Fhg-oM-cQy"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ee1-aw-PRJ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
......