File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
WooCommerce/Classes/ViewRelated/Coupons Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ final class CouponListViewController: UIViewController {
1010 ///
1111 private var emptyStateViewController : UIViewController ?
1212
13+ /// Pull To Refresh Support.
14+ ///
15+ private lazy var refreshControl : UIRefreshControl = {
16+ let refreshControl = UIRefreshControl ( )
17+ refreshControl. addTarget ( self , action: #selector( refreshCouponList) , for: . valueChanged)
18+ return refreshControl
19+ } ( )
20+
1321 private var subscriptions : Set < AnyCancellable > = [ ]
1422
1523 init ( siteID: Int64 ) {
@@ -53,6 +61,13 @@ final class CouponListViewController: UIViewController {
5361 }
5462}
5563
64+ // MARK: - Actions
65+ private extension CouponListViewController {
66+ @objc func refreshCouponList( ) {
67+ viewModel. refreshCoupons ( )
68+ }
69+ }
70+
5671
5772// MARK: - View Configuration
5873//
@@ -66,6 +81,7 @@ private extension CouponListViewController {
6681 tableView. dataSource = self
6782 tableView. estimatedRowHeight = Constants . estimatedRowHeight
6883 tableView. rowHeight = UITableView . automaticDimension
84+ tableView. addSubview ( refreshControl)
6985 }
7086
7187 func registerTableViewCells( ) {
You can’t perform that action at this time.
0 commit comments