Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2023-10-20 17:24:05 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0884e778bc0211c0568603876b66e1b1bcfbe2fb
0884e778
1 parent
c88f88f1
add UnifiedCouponsViewController part 2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
10 deletions
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsViewController.swift
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
0884e77
...
...
@@ -7,7 +7,7 @@
<key>
Pods-SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
0
</integer>
<integer>
1
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
0884e77
...
...
@@ -7,7 +7,7 @@
<key>
SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
1
</integer>
<integer>
0
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
0884e77
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
0884e77
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsViewController.swift
View file @
0884e77
...
...
@@ -10,22 +10,83 @@ import UIKit
import
SwiftEventBus
@objc
public
class
UnifiedCouponsViewController
:
UIViewController
{
@IBOutlet
weak
var
backgroundImage
:
UIImageView
!
@IBOutlet
weak
var
tableView
:
UITableView
!
public
var
unifiedCoupons
:
Array
<
swiftApi
.
UnifiedCouponModel
>
=
[]
public
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
hidesBottomBarWhenPushed
=
true
SwiftEventBus
.
onBackgroundThread
(
self
,
name
:
"unified_coupons_fetched"
)
{
result
in
// Do any additional setup after loading the view.
DispatchQueue
.
main
.
async
{
self
.
unifiedCoupons
=
swiftApi
()
.
getUnifiedCouponList
()
self
.
tableView
.
reloadData
()
}
}
setBackButton
()
setNavigationTitle
(
"SUPERMARKET DEALS"
)
// backgroundImage.image = UIImage(named: "coupons_scrollview_dark", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
// tableView.clipsToBounds = true
// tableView.layer.cornerRadius = 30
// tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
tableView
.
contentInset
.
top
=
30
}
public
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
swiftApi
()
.
logTrackersEvent
(
"screen"
,
"ActiveUnifiedCouponsScreen"
)
self
.
unifiedCoupons
=
swiftApi
()
.
getUnifiedCouponList
()
self
.
tableView
.
reloadData
()
self
.
navigationController
?
.
hideHairline
()
}
/
*
// MARK: - Navigation
/
/ MARK: - Functions
}
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
// MARK: - TableView
extension
UnifiedCouponsViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
public
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
1
}
public
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
self
.
unifiedCoupons
.
count
}
*/
public
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
130.0
+
8.0
// return UITableViewAutomaticDimension
}
public
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UnifiedCouponsTableViewCellId"
,
for
:
indexPath
)
as!
UnifiedCouponsTableViewCell
cell
.
configureCell
(
coupon
:
unifiedCoupons
[
indexPath
.
row
])
return
cell
}
public
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
couponBarcode
=
unifiedCoupons
[
indexPath
.
row
]
.
_barcode
swiftApi
()
.
logTrackersEvent
(
"click"
,
(
"UnifiedCoupon:"
+
couponBarcode
))
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"UnifiedCouponBarcodeViewController"
)
as!
SwiftWarplyFramework
.
UnifiedCouponBarcodeViewController
vc
.
coupon
=
unifiedCoupons
[
indexPath
.
row
]
vc
.
isFromWallet
=
true
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
...
...
Please
register
or
login
to post a comment