Vasilis

changes for ui

...@@ -124,6 +124,8 @@ ...@@ -124,6 +124,8 @@
124 E6D8DF6027A9429E0006A3A9 /* MyApi.m in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DF5C27A9429E0006A3A9 /* MyApi.m */; }; 124 E6D8DF6027A9429E0006A3A9 /* MyApi.m in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DF5C27A9429E0006A3A9 /* MyApi.m */; };
125 E6D8DF6127A9429E0006A3A9 /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DF5D27A9429E0006A3A9 /* ProfileView.swift */; }; 125 E6D8DF6127A9429E0006A3A9 /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DF5D27A9429E0006A3A9 /* ProfileView.swift */; };
126 E6D8DF6227A9429E0006A3A9 /* MyApi.h in Headers */ = {isa = PBXBuildFile; fileRef = E6D8DF5E27A9429E0006A3A9 /* MyApi.h */; settings = {ATTRIBUTES = (Public, ); }; }; 126 E6D8DF6227A9429E0006A3A9 /* MyApi.h in Headers */ = {isa = PBXBuildFile; fileRef = E6D8DF5E27A9429E0006A3A9 /* MyApi.h */; settings = {ATTRIBUTES = (Public, ); }; };
127 + E6EA2F6E2806E32500EC4CF5 /* Coupons.xib in Resources */ = {isa = PBXBuildFile; fileRef = E6EA2F6D2806E32500EC4CF5 /* Coupons.xib */; };
128 + E6EA2F702806E8C200EC4CF5 /* Coupons.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6EA2F6F2806E8C200EC4CF5 /* Coupons.swift */; };
127 /* End PBXBuildFile section */ 129 /* End PBXBuildFile section */
128 130
129 /* Begin PBXFileReference section */ 131 /* Begin PBXFileReference section */
...@@ -246,6 +248,8 @@ ...@@ -246,6 +248,8 @@
246 E6D8DF5C27A9429E0006A3A9 /* MyApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyApi.m; sourceTree = "<group>"; }; 248 E6D8DF5C27A9429E0006A3A9 /* MyApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyApi.m; sourceTree = "<group>"; };
247 E6D8DF5D27A9429E0006A3A9 /* ProfileView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = "<group>"; }; 249 E6D8DF5D27A9429E0006A3A9 /* ProfileView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = "<group>"; };
248 E6D8DF5E27A9429E0006A3A9 /* MyApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyApi.h; sourceTree = "<group>"; }; 250 E6D8DF5E27A9429E0006A3A9 /* MyApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyApi.h; sourceTree = "<group>"; };
251 + E6EA2F6D2806E32500EC4CF5 /* Coupons.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Coupons.xib; sourceTree = "<group>"; };
252 + E6EA2F6F2806E8C200EC4CF5 /* Coupons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coupons.swift; sourceTree = "<group>"; };
249 F2447FDBC0B149DFB9DC6E40 /* Pods-WarplySDKFrameworkIOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WarplySDKFrameworkIOS.debug.xcconfig"; path = "Target Support Files/Pods-WarplySDKFrameworkIOS/Pods-WarplySDKFrameworkIOS.debug.xcconfig"; sourceTree = "<group>"; }; 253 F2447FDBC0B149DFB9DC6E40 /* Pods-WarplySDKFrameworkIOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WarplySDKFrameworkIOS.debug.xcconfig"; path = "Target Support Files/Pods-WarplySDKFrameworkIOS/Pods-WarplySDKFrameworkIOS.debug.xcconfig"; sourceTree = "<group>"; };
250 /* End PBXFileReference section */ 254 /* End PBXFileReference section */
251 255
...@@ -309,6 +313,8 @@ ...@@ -309,6 +313,8 @@
309 E6D8DE6B27A942010006A3A9 /* WarplySDKFrameworkIOS.h */, 313 E6D8DE6B27A942010006A3A9 /* WarplySDKFrameworkIOS.h */,
310 E6D8DE6C27A942010006A3A9 /* WarplySDKFrameworkIOS.docc */, 314 E6D8DE6C27A942010006A3A9 /* WarplySDKFrameworkIOS.docc */,
311 E655D05928058A72004F913C /* WarplySDKFrameworkIOS-Bridging-Header.h */, 315 E655D05928058A72004F913C /* WarplySDKFrameworkIOS-Bridging-Header.h */,
316 + E6EA2F6D2806E32500EC4CF5 /* Coupons.xib */,
317 + E6EA2F6F2806E8C200EC4CF5 /* Coupons.swift */,
312 ); 318 );
313 path = WarplySDKFrameworkIOS; 319 path = WarplySDKFrameworkIOS;
314 sourceTree = "<group>"; 320 sourceTree = "<group>";
...@@ -654,6 +660,7 @@ ...@@ -654,6 +660,7 @@
654 E6D8DF0F27A942920006A3A9 /* warp_white_close_button@2x.png in Resources */, 660 E6D8DF0F27A942920006A3A9 /* warp_white_close_button@2x.png in Resources */,
655 E6D8DF0D27A942920006A3A9 /* warp_white_forward_button.png in Resources */, 661 E6D8DF0D27A942920006A3A9 /* warp_white_forward_button.png in Resources */,
656 E6D8DEFA27A942920006A3A9 /* WLNativeAdTableViewCell.xib in Resources */, 662 E6D8DEFA27A942920006A3A9 /* WLNativeAdTableViewCell.xib in Resources */,
663 + E6EA2F6E2806E32500EC4CF5 /* Coupons.xib in Resources */,
657 E6D8DF1027A942920006A3A9 /* warp_white_forward_button@2x.png in Resources */, 664 E6D8DF1027A942920006A3A9 /* warp_white_forward_button@2x.png in Resources */,
658 E6D8DEF127A942920006A3A9 /* WLNativeVideoTableViewCell.xib in Resources */, 665 E6D8DEF127A942920006A3A9 /* WLNativeVideoTableViewCell.xib in Resources */,
659 E6D8DEFB27A942920006A3A9 /* WLNativeAdCollectionViewCell.xib in Resources */, 666 E6D8DEFB27A942920006A3A9 /* WLNativeAdCollectionViewCell.xib in Resources */,
...@@ -704,6 +711,7 @@ ...@@ -704,6 +711,7 @@
704 E6D8DF0627A942920006A3A9 /* WLBeacon.m in Sources */, 711 E6D8DF0627A942920006A3A9 /* WLBeacon.m in Sources */,
705 E6D8DF2927A942920006A3A9 /* NSData+SSToolkitAdditions.m in Sources */, 712 E6D8DF2927A942920006A3A9 /* NSData+SSToolkitAdditions.m in Sources */,
706 E6D8DEFC27A942920006A3A9 /* WLCustomNativeAdTableViewCell.m in Sources */, 713 E6D8DEFC27A942920006A3A9 /* WLCustomNativeAdTableViewCell.m in Sources */,
714 + E6EA2F702806E8C200EC4CF5 /* Coupons.swift in Sources */,
707 E6D8DF5F27A9429E0006A3A9 /* ProfileViewInterface.swift in Sources */, 715 E6D8DF5F27A9429E0006A3A9 /* ProfileViewInterface.swift in Sources */,
708 E6D8DF4A27A942920006A3A9 /* AFNetworkReachabilityManager.m in Sources */, 716 E6D8DF4A27A942920006A3A9 /* AFNetworkReachabilityManager.m in Sources */,
709 E6D8DF4B27A942920006A3A9 /* AFSecurityPolicy.m in Sources */, 717 E6D8DF4B27A942920006A3A9 /* AFSecurityPolicy.m in Sources */,
......
1 +//
2 +// Coupons.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Βασιλης Σκουρας on 13/4/22.
6 +//
7 +
8 +import UIKit
9 +
10 +class Coupons: UIViewController {
11 +
12 + @IBOutlet weak var myScrollView: UIScrollView!
13 +
14 + override func viewDidLoad() {
15 + super.viewDidLoad()
16 + let corners = UIRectCorner(arrayLiteral: [
17 + UIRectCorner.topLeft,
18 + ])
19 + let cornerRadii = CGSize(
20 + width: 10,
21 + height: 10
22 + )
23 + let maskPath = UIBezierPath(
24 + roundedRect: view.bounds,
25 + byRoundingCorners: corners,
26 + cornerRadii: cornerRadii
27 + )
28 + let maskLayer = CAShapeLayer()
29 + maskLayer.path = maskPath.cgPath
30 + maskLayer.frame = view.bounds
31 + myScrollView.layer.mask = maskLayer
32 + // Do any additional setup after loading the view.
33 + }
34 +
35 +
36 + /*
37 + // MARK: - Navigation
38 +
39 + // In a storyboard-based application, you will often want to do a little preparation before navigation
40 + override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
41 + // Get the new view controller using segue.destination.
42 + // Pass the selected object to the new view controller.
43 + }
44 + */
45 +
46 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3 + <device id="retina6_1" orientation="portrait" appearance="light"/>
4 + <dependencies>
5 + <deployment identifier="iOS"/>
6 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
7 + <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8 + <capability name="System colors in document resources" minToolsVersion="11.0"/>
9 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 + </dependencies>
11 + <objects>
12 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="Coupons" customModule="WarplySDKFrameworkIOS" customModuleProvider="target">
13 + <connections>
14 + <outlet property="myScrollView" destination="SHV-Vg-A8P" id="dzS-Na-cRH"/>
15 + </connections>
16 + </placeholder>
17 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
18 + <view contentMode="scaleToFill" id="iN0-l3-epB">
19 + <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
20 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21 + <subviews>
22 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Όλα τα κουπόνια μου" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sU1-BM-nPc">
23 + <rect key="frame" x="126.5" y="63" width="161.5" height="21"/>
24 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
25 + <nil key="textColor"/>
26 + <nil key="highlightedColor"/>
27 + </label>
28 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="ic_back" translatesAutoresizingMaskIntoConstraints="NO" id="DSk-ym-fZV">
29 + <rect key="frame" x="20" y="63" width="24" height="21"/>
30 + <accessibility key="accessibilityConfiguration" identifier="ic_back"/>
31 + <constraints>
32 + <constraint firstAttribute="height" constant="17" id="dvj-RN-g0D"/>
33 + <constraint firstAttribute="width" constant="20" id="y3w-1z-hQx"/>
34 + </constraints>
35 + </imageView>
36 + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SHV-Vg-A8P">
37 + <rect key="frame" x="0.0" y="113" width="414" height="783"/>
38 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
39 + <viewLayoutGuide key="contentLayoutGuide" id="Kj4-MW-egz"/>
40 + <viewLayoutGuide key="frameLayoutGuide" id="KT3-60-7Kp"/>
41 + </scrollView>
42 + </subviews>
43 + <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
44 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
45 + <constraints>
46 + <constraint firstItem="sU1-BM-nPc" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="RLg-Ad-dUB"/>
47 + </constraints>
48 + <point key="canvasLocation" x="137.68115942028987" y="95.758928571428569"/>
49 + </view>
50 + </objects>
51 + <resources>
52 + <image name="ic_back" width="16.5" height="13.5"/>
53 + <systemColor name="systemBackgroundColor">
54 + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
55 + </systemColor>
56 + </resources>
57 +</document>
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
15 - (void) setToStage; 15 - (void) setToStage;
16 - (void) setLang:(NSString*) lang; 16 - (void) setLang:(NSString*) lang;
17 - (UIViewController *) openProfile:(UIViewController*)controller :(UIWindow*) window; 17 - (UIViewController *) openProfile:(UIViewController*)controller :(UIWindow*) window;
18 +- (UIViewController *) openCoupons:(UIViewController*)controller :(UIWindow*) window;
18 - (void) applicationDidEnterBackground:(UIApplication *)application; 19 - (void) applicationDidEnterBackground:(UIApplication *)application;
19 - (void) applicationWillEnterForeground:(UIApplication *)application; 20 - (void) applicationWillEnterForeground:(UIApplication *)application;
20 - (void) applicationDidBecomeActive:(UIApplication *)application; 21 - (void) applicationDidBecomeActive:(UIApplication *)application;
......
...@@ -54,6 +54,12 @@ NSString *LANG; ...@@ -54,6 +54,12 @@ NSString *LANG;
54 return profileViewController; 54 return profileViewController;
55 } 55 }
56 56
57 +
58 +- (UIViewController *) openCoupons:(UIViewController*)controller :(UIWindow*) window {
59 + UIView *myCoupons = [[[NSBundle mainBundle] loadNibNamed:@"Coupons" owner:self options:nil] objectAtIndex:0];
60 + return myCoupons;
61 +}
62 +
57 /////////////////////////////////////////////////////////////////////////////////////////////////// 63 ///////////////////////////////////////////////////////////////////////////////////////////////////
58 - (void)applicationDidEnterBackground:(UIApplication *)application 64 - (void)applicationDidEnterBackground:(UIApplication *)application
59 { 65 {
......
...@@ -5,19 +5,42 @@ ...@@ -5,19 +5,42 @@
5 // Created by Βασιλης Σκουρας on 13/1/22. 5 // Created by Βασιλης Σκουρας on 13/1/22.
6 // 6 //
7 7
8 +#if canImport(SwiftUI)
8 import SwiftUI 9 import SwiftUI
9 import WarplySDKFrameworkIOS 10 import WarplySDKFrameworkIOS
10 11
11 -@available(iOS 13.0.0, *) 12 +class DataModel {
13 + var data: AnyObject?
14 +
15 + init() { //initializer method
16 + let instanceOfMyApi = MyApi()
17 + let couponSets = instanceOfMyApi.getCouponSets(withActive: true, andVisible: true, andUuids: nil)
18 + let coupons = instanceOfMyApi.getCoupons() as AnyObject?
19 +
20 +
21 + if let myDictionary = coupons as? [String : AnyObject] {
22 + self.data = myDictionary["result"] as AnyObject
23 + }
24 + }
25 +
26 + var getData: AnyObject? {
27 + get { // getter
28 + return data ?? nil
29 + }
30 + }
31 +}
32 +
33 +
34 +@available(iOS 11.0.0, *)
12 struct ProfileView: View { 35 struct ProfileView: View {
13 36
14 - let uiscreen = UIScreen.main.bounds 37 + var data:AnyObject? = DataModel().getData
15 - @State private var bottomRect: CGRect = .zero 38 +
39 + var uiscreen = UIScreen.main.bounds
40 +// @State private var bottomRect: CGRect = .zero
16 var body: some View { 41 var body: some View {
17 ScrollView { 42 ScrollView {
18 VStack { 43 VStack {
19 - let instanceOfMyApi = MyApi()
20 - var myJson = instanceOfMyApi.getCoupons() as AnyObject?
21 44
22 ZStack { 45 ZStack {
23 Image("ic_back", bundle: Bundle(identifier:"framework.warp.ly.warplySDKFrameworkIOS")) 46 Image("ic_back", bundle: Bundle(identifier:"framework.warp.ly.warplySDKFrameworkIOS"))
...@@ -29,32 +52,24 @@ struct ProfileView: View { ...@@ -29,32 +52,24 @@ struct ProfileView: View {
29 .offset( y: self.uiscreen.height * 0.04) 52 .offset( y: self.uiscreen.height * 0.04)
30 } 53 }
31 .frame(width: self.uiscreen.width) 54 .frame(width: self.uiscreen.width)
32 -// Rectangle() 55 + let dataArray:[NSDictionary] = (data as! NSArray).compactMap({ $0 as? NSDictionary })
33 -// 56 +
34 -// .foregroundStyle( 57 + ForEach(dataArray, id: \.self) { item in
35 -// .linearGradient( 58 +
36 -// colors: [Color.init(UIColor(red: 82.0/255.0, green: 223.0/255.0, blue: 90.0/255.0, alpha: 1.0)), Color.init(UIColor(red: 29.0/255.0, green: 168.0/255.0, blue: 122.0/255.0, alpha: 1.0)), Color.init(UIColor(red: 4.0/255.0, green: 120.0/255.0, blue: 190.0/255.0, alpha: 1.0))], 59 +
37 -// startPoint: .leading, 60 + ZStack {
38 -// endPoint: .trailing 61 + Image("logo", bundle: Bundle(identifier:"framework.warp.ly.warplySDKFrameworkIOS"))
39 -// ) 62 + .resizable()
40 -// ) 63 + .frame(width: self.uiscreen.height * 0.04, height: self.uiscreen.height * 0.04, alignment: .topLeading)
41 -// 64 + .cornerRadius(CGFloat(self.uiscreen.height * 0.02))
42 -// .frame(width: self.uiscreen.width * 0.9, 65 + .offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.14, y: -self.uiscreen.height * 0.07)
43 -// height: self.uiscreen.height * 0.15, 66 +
44 -// alignment: .topLeading) 67 + }.background(
45 -// .cornerRadius(CGFloat(7)) 68 + Image("Background")
46 -// .offset(x: self.uiscreen.width * 0.0025, y: self.uiscreen.height * 0.08) 69 + .resizable()
47 - ZStack { 70 + .edgesIgnoringSafeArea(.all)
48 - Image("logo", bundle: Bundle(identifier:"framework.warp.ly.warplySDKFrameworkIOS")) 71 + .frame(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
49 - .resizable() 72 + )
50 - .frame(width: self.uiscreen.height * 0.04, height: self.uiscreen.height * 0.04, alignment: .topLeading)
51 - .cornerRadius(CGFloat(self.uiscreen.height * 0.02))
52 - .offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.14, y: -self.uiscreen.height * 0.07)
53 - Image("logo", bundle: Bundle(identifier:"framework.warp.ly.warplySDKFrameworkIOS"))
54 - .resizable()
55 - .frame(width: self.uiscreen.width * 0.24, height: self.uiscreen.height * 0.038, alignment: .topLeading)
56 - .cornerRadius(CGFloat(self.uiscreen.height * 0.02))
57 - .offset(x: self.uiscreen.width / 2 - self.uiscreen.width * 0.2, y: -self.uiscreen.height * 0.07)
58 } 73 }
59 Text("Χριστίνα Γεωργίου") 74 Text("Χριστίνα Γεωργίου")
60 .frame( width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.04, alignment: .leading) 75 .frame( width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.04, alignment: .leading)
...@@ -69,7 +84,7 @@ struct ProfileView: View { ...@@ -69,7 +84,7 @@ struct ProfileView: View {
69 .frame(width:self.uiscreen.width, height:self.uiscreen.height ) 84 .frame(width:self.uiscreen.width, height:self.uiscreen.height )
70 } 85 }
71 } 86 }
72 - 87 +#endif
73 //struct ProfileView_Previews: PreviewProvider { 88 //struct ProfileView_Previews: PreviewProvider {
74 // static var previews: some View { 89 // static var previews: some View {
75 // ProfileView() 90 // ProfileView()
......