Showing
2 changed files
with
7 additions
and
7 deletions
No preview for this file type
| ... | @@ -15,7 +15,7 @@ import UIKit | ... | @@ -15,7 +15,7 @@ import UIKit |
| 15 | 15 | ||
| 16 | var coupons:Array<swiftApi.CouponItemModel> = [] | 16 | var coupons:Array<swiftApi.CouponItemModel> = [] |
| 17 | 17 | ||
| 18 | - override func viewDidLoad() { | 18 | + public override func viewDidLoad() { |
| 19 | super.viewDidLoad() | 19 | super.viewDidLoad() |
| 20 | 20 | ||
| 21 | getCouponsRequest() | 21 | getCouponsRequest() |
| ... | @@ -60,20 +60,20 @@ import UIKit | ... | @@ -60,20 +60,20 @@ import UIKit |
| 60 | // MARK: - TableView | 60 | // MARK: - TableView |
| 61 | extension CouponsViewController: UITableViewDelegate, UITableViewDataSource{ | 61 | extension CouponsViewController: UITableViewDelegate, UITableViewDataSource{ |
| 62 | 62 | ||
| 63 | - func numberOfSections(in tableView: UITableView) -> Int { | 63 | + public func numberOfSections(in tableView: UITableView) -> Int { |
| 64 | return 1 | 64 | return 1 |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | 67 | + public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| 68 | return self.coupons.count | 68 | return self.coupons.count |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | 71 | + public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 72 | return 120.0 + 30.0 | 72 | return 120.0 + 30.0 |
| 73 | // return UITableViewAutomaticDimension | 73 | // return UITableViewAutomaticDimension |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | 76 | + public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| 77 | let cell = tableView.dequeueReusableCell(withIdentifier: "CouponsTableViewCellId", for: indexPath) as! CouponsTableViewCell | 77 | let cell = tableView.dequeueReusableCell(withIdentifier: "CouponsTableViewCellId", for: indexPath) as! CouponsTableViewCell |
| 78 | 78 | ||
| 79 | cell.configureCell(coupon: coupons[indexPath.row]) | 79 | cell.configureCell(coupon: coupons[indexPath.row]) |
| ... | @@ -81,10 +81,10 @@ extension CouponsViewController: UITableViewDelegate, UITableViewDataSource{ | ... | @@ -81,10 +81,10 @@ extension CouponsViewController: UITableViewDelegate, UITableViewDataSource{ |
| 81 | return cell | 81 | return cell |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | 84 | + public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| 85 | 85 | ||
| 86 | let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) | 86 | let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) |
| 87 | - let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as UIViewController | 87 | + let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! CouponBarcodeViewController |
| 88 | vc.coupon = coupons[indexPath.row] | 88 | vc.coupon = coupons[indexPath.row] |
| 89 | self.navigationController?.pushViewController(vc, animated: true) | 89 | self.navigationController?.pushViewController(vc, animated: true) |
| 90 | } | 90 | } | ... | ... |
-
Please register or login to post a comment