Skip to content
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

[DEV-254173] adapt sdk interface to ios standards using controllers and delegates #31

Draft
wants to merge 15 commits into
base: DEV
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- TrustlySDK (3.2.3)
- TrustlySDK (3.3.0)

DEPENDENCIES:
- TrustlySDK (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
TrustlySDK: 63b611ce510c67c2d7e4f1779d163688aea65c39
TrustlySDK: e77ebd5f7c8b03a03e65be2dee9827a879d8abc5

PODFILE CHECKSUM: 2d88e8d6e29e33aaa64b36a8d0e73ac21b25b6ba

Expand Down
14 changes: 5 additions & 9 deletions Example/TrustlySDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* Begin PBXBuildFile section */
152541E62B7E74B20029F149 /* EstablishDataUtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152541E52B7E74B20029F149 /* EstablishDataUtilsTests.swift */; };
1587AB912A2FE043006F6FC3 /* SessionManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1587AB902A2FE043006F6FC3 /* SessionManagerTests.swift */; };
15987B0929DEF79D00D7A395 /* TrustlyLightBoxViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15987B0829DEF79D00D7A395 /* TrustlyLightBoxViewController.swift */; };
159A116B2D495F11009609D6 /* MerchantViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 159A116A2D495F11009609D6 /* MerchantViewController.swift */; };
15BB98602B68120100A9210B /* URLUtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BB985F2B68120100A9210B /* URLUtilsTests.swift */; };
15BEC9B42C383FB900050FB9 /* ValidationHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BEC9B32C383FB900050FB9 /* ValidationHelperTests.swift */; };
15C29FB62C6165480037C239 /* SuccessViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 15C29FB52C6165480037C239 /* SuccessViewController.xib */; };
Expand All @@ -18,7 +18,6 @@
15E049852B7510BA0084B71A /* JsonUtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15E049842B7510BA0084B71A /* JsonUtilsTests.swift */; };
340657DFE7244067A8F33A0D /* Pods_TrustlySDK_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C63286550C0E975AC9573DF /* Pods_TrustlySDK_Example.framework */; };
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
Expand All @@ -42,7 +41,7 @@
10C7972A664657BB9F51ED82 /* Pods-TrustlySDK_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TrustlySDK_Tests.release.xcconfig"; path = "Target Support Files/Pods-TrustlySDK_Tests/Pods-TrustlySDK_Tests.release.xcconfig"; sourceTree = "<group>"; };
152541E52B7E74B20029F149 /* EstablishDataUtilsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EstablishDataUtilsTests.swift; sourceTree = "<group>"; };
1587AB902A2FE043006F6FC3 /* SessionManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionManagerTests.swift; sourceTree = "<group>"; };
15987B0829DEF79D00D7A395 /* TrustlyLightBoxViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustlyLightBoxViewController.swift; sourceTree = "<group>"; };
159A116A2D495F11009609D6 /* MerchantViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantViewController.swift; sourceTree = "<group>"; };
15BB985F2B68120100A9210B /* URLUtilsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLUtilsTests.swift; sourceTree = "<group>"; };
15BEC9B32C383FB900050FB9 /* ValidationHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidationHelperTests.swift; sourceTree = "<group>"; };
15C29FB52C6165480037C239 /* SuccessViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SuccessViewController.xib; sourceTree = "<group>"; };
Expand All @@ -56,7 +55,6 @@
607FACD01AFB9204008FA782 /* TrustlySDK_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TrustlySDK_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -98,11 +96,10 @@
15C29FBB2C6168B20037C239 /* Views */ = {
isa = PBXGroup;
children = (
607FACD71AFB9204008FA782 /* ViewController.swift */,
15987B0829DEF79D00D7A395 /* TrustlyLightBoxViewController.swift */,
607FACD91AFB9204008FA782 /* Main.storyboard */,
15C29FB52C6165480037C239 /* SuccessViewController.xib */,
15C29FB72C6165570037C239 /* SuccessViewController.swift */,
159A116A2D495F11009609D6 /* MerchantViewController.swift */,
);
name = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -266,7 +263,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 1610;
LastUpgradeCheck = 1620;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
Expand Down Expand Up @@ -390,10 +387,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
159A116B2D495F11009609D6 /* MerchantViewController.swift in Sources */,
15C29FB82C6165570037C239 /* SuccessViewController.swift in Sources */,
15987B0929DEF79D00D7A395 /* TrustlyLightBoxViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1610"
LastUpgradeVersion = "1620"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Example/TrustlySDK/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// Determine who sent the URL.
if url.absoluteString == "demoapp://" {
NotificationCenter.default.post(name: Notification.Name(TrustlyView.trustlyCloseWebview), object: nil)
// NotificationCenter.default.post(name: Notification.Name(TrustlyView.trustlyCloseWebview), object: nil)

return true
}
Expand Down
91 changes: 35 additions & 56 deletions Example/TrustlySDK/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,79 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="U1b-IB-buc">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<!--Merchant View Controller-->
<scene sceneID="6gO-FZ-sCu">
<objects>
<viewController storyboardIdentifier="MainViewController" id="vXZ-lx-hvc" customClass="ViewController" customModule="TrustlySDK_Example" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="MerchantViewController" id="U1b-IB-buc" customClass="MerchantViewController" customModule="TrustlySDK_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
<viewControllerLayoutGuide type="top" id="XoH-jc-WAk"/>
<viewControllerLayoutGuide type="bottom" id="BPc-dI-7pg"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<view key="view" contentMode="scaleToFill" id="bEs-6A-vbi">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Yrf-Eg-ElA">
<rect key="frame" x="-4" y="72" width="401" height="746"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="89n-Hd-53n">
<rect key="frame" x="20" y="20" width="361" height="605.33333333333337"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Amount:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="d2S-eh-Amc">
<rect key="frame" x="0.0" y="0.0" width="361" height="20.333333333333332"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="10.0" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Iqf-hK-a3I">
<rect key="frame" x="0.0" y="34.333333333333329" width="361" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="guD-xS-eey" customClass="TrustlyView" customModule="TrustlySDK">
<rect key="frame" x="0.0" y="82.333333333333371" width="361" height="523"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="523" id="EoN-h3-Uwt"/>
</constraints>
</view>
</subviews>
</stackView>
</subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Amount:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="57K-Er-fyu">
<rect key="frame" x="16" y="97" width="332" height="26.333333333333329"/>
<constraints>
<constraint firstItem="89n-Hd-53n" firstAttribute="top" secondItem="YET-E2-fOo" secondAttribute="top" constant="20" id="2Ui-F4-Fqi"/>
<constraint firstItem="89n-Hd-53n" firstAttribute="leading" secondItem="YET-E2-fOo" secondAttribute="leading" constant="20" id="Fs2-8U-V0f"/>
<constraint firstItem="89n-Hd-53n" firstAttribute="bottom" secondItem="YET-E2-fOo" secondAttribute="bottom" id="RDT-C9-Imw"/>
<constraint firstItem="89n-Hd-53n" firstAttribute="trailing" secondItem="YET-E2-fOo" secondAttribute="trailing" id="RWZ-2d-cSw"/>
<constraint firstItem="89n-Hd-53n" firstAttribute="width" secondItem="eAd-Fw-mMR" secondAttribute="width" multiplier="0.900249" id="cJk-5F-RUR"/>
<constraint firstAttribute="width" constant="332" id="UIj-ia-E8a"/>
</constraints>
<viewLayoutGuide key="contentLayoutGuide" id="YET-E2-fOo"/>
<viewLayoutGuide key="frameLayoutGuide" id="eAd-Fw-mMR"/>
</scrollView>
<fontDescription key="fontDescription" type="system" pointSize="22"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="08v-0k-Zj3">
<rect key="frame" x="15" y="122" width="354" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="rO9-vr-EOv"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="decimalPad"/>
</textField>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="57K-Er-fyu" firstAttribute="top" secondItem="XoH-jc-WAk" secondAttribute="bottom" constant="38" id="2f2-rR-9eE"/>
<constraint firstItem="08v-0k-Zj3" firstAttribute="leading" secondItem="bEs-6A-vbi" secondAttribute="leading" constant="15" id="G58-r6-eem"/>
<constraint firstAttribute="trailing" secondItem="08v-0k-Zj3" secondAttribute="trailing" constant="24" id="PcZ-oe-a3j"/>
<constraint firstItem="57K-Er-fyu" firstAttribute="leading" secondItem="bEs-6A-vbi" secondAttribute="leadingMargin" id="h1s-ef-1BA"/>
<constraint firstItem="08v-0k-Zj3" firstAttribute="top" secondItem="XoH-jc-WAk" secondAttribute="bottom" constant="63" id="sqE-j1-xn2"/>
</constraints>
</view>
<connections>
<outlet property="amountTextView" destination="Iqf-hK-a3I" id="g7Q-KP-B1p"/>
<outlet property="trustlyView" destination="guD-xS-eey" id="YxX-cB-xV5"/>
<outlet property="amountTextView" destination="08v-0k-Zj3" id="c8h-hn-I2D"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="0fA-M7-WEq" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="139.69465648854961" y="0.0"/>
<point key="canvasLocation" x="113.74045801526717" y="664.78873239436621"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
Loading
Loading