Showing
15 changed files
with
67 additions
and
40 deletions
No preview for this file type
... | @@ -1405,7 +1405,7 @@ public final class WarplySDK { | ... | @@ -1405,7 +1405,7 @@ public final class WarplySDK { |
1405 | showDialog(controller, "Δεν υπάρχει σύνδεση", "Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.") | 1405 | showDialog(controller, "Δεν υπάρχει σύνδεση", "Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.") |
1406 | } else { | 1406 | } else { |
1407 | let tempCampaign = CampaignItemModel() | 1407 | let tempCampaign = CampaignItemModel() |
1408 | - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) | 1408 | + let storyboard = UIStoryboard(name: "Main", bundle: Bundle.frameworkBundle) |
1409 | let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController | 1409 | let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController |
1410 | let url = getMarketPassMapUrl() | 1410 | let url = getMarketPassMapUrl() |
1411 | let params = constructCampaignParams(campaign: tempCampaign, isMap: true) | 1411 | let params = constructCampaignParams(campaign: tempCampaign, isMap: true) |
... | @@ -1431,7 +1431,7 @@ public final class WarplySDK { | ... | @@ -1431,7 +1431,7 @@ public final class WarplySDK { |
1431 | showDialog(controller, "Δεν υπάρχει σύνδεση", "Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.") | 1431 | showDialog(controller, "Δεν υπάρχει σύνδεση", "Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.") |
1432 | } else { | 1432 | } else { |
1433 | if let superMarketCampaign = getSupermarketCampaign() { | 1433 | if let superMarketCampaign = getSupermarketCampaign() { |
1434 | - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) | 1434 | + let storyboard = UIStoryboard(name: "Main", bundle: Bundle.frameworkBundle) |
1435 | let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController | 1435 | let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController |
1436 | let url = constructCampaignUrl(superMarketCampaign) | 1436 | let url = constructCampaignUrl(superMarketCampaign) |
1437 | let params = constructCampaignParams(superMarketCampaign) | 1437 | let params = constructCampaignParams(superMarketCampaign) | ... | ... |
... | @@ -17,6 +17,11 @@ public class MyEmptyClass { | ... | @@ -17,6 +17,11 @@ public class MyEmptyClass { |
17 | // } | 17 | // } |
18 | 18 | ||
19 | public static func resourceBundle() -> Bundle? { | 19 | public static func resourceBundle() -> Bundle? { |
20 | + #if SWIFT_PACKAGE | ||
21 | + // For SPM, resources are in Bundle.module | ||
22 | + return Bundle.module | ||
23 | + #else | ||
24 | + // For CocoaPods, use existing logic | ||
20 | let frameworkBundle = Bundle(for: MyEmptyClass.self) | 25 | let frameworkBundle = Bundle(for: MyEmptyClass.self) |
21 | 26 | ||
22 | // Try ResourcesBundle.bundle first (for local development) | 27 | // Try ResourcesBundle.bundle first (for local development) |
... | @@ -33,6 +38,28 @@ public class MyEmptyClass { | ... | @@ -33,6 +38,28 @@ public class MyEmptyClass { |
33 | 38 | ||
34 | // Final fallback to framework bundle itself | 39 | // Final fallback to framework bundle itself |
35 | return frameworkBundle | 40 | return frameworkBundle |
41 | + #endif | ||
36 | } | 42 | } |
37 | 43 | ||
38 | } | 44 | } |
45 | + | ||
46 | +// MARK: - Bundle Extensions for SPM Support | ||
47 | +extension Bundle { | ||
48 | + /// Returns the appropriate bundle for XIB files and storyboards | ||
49 | + static var frameworkBundle: Bundle { | ||
50 | + #if SWIFT_PACKAGE | ||
51 | + return Bundle.module | ||
52 | + #else | ||
53 | + return Bundle(for: MyEmptyClass.self) | ||
54 | + #endif | ||
55 | + } | ||
56 | + | ||
57 | + /// Returns the appropriate bundle for resources (images, fonts, etc.) | ||
58 | + static var frameworkResourceBundle: Bundle? { | ||
59 | + #if SWIFT_PACKAGE | ||
60 | + return Bundle.module | ||
61 | + #else | ||
62 | + return MyEmptyClass.resourceBundle() | ||
63 | + #endif | ||
64 | + } | ||
65 | +} | ... | ... |
... | @@ -50,7 +50,7 @@ extension UIViewController { | ... | @@ -50,7 +50,7 @@ extension UIViewController { |
50 | let view = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40)) | 50 | let view = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40)) |
51 | let imageView = UIImageView(frame: CGRect(x: 10, y: 12, width: 15, height: 15)) | 51 | let imageView = UIImageView(frame: CGRect(x: 10, y: 12, width: 15, height: 15)) |
52 | 52 | ||
53 | - if let imgBackArrow = UIImage(named: icon, in: MyEmptyClass.resourceBundle(), compatibleWith: nil) { | 53 | + if let imgBackArrow = UIImage(named: icon, in: Bundle.frameworkResourceBundle, compatibleWith: nil) { |
54 | imageView.image = imgBackArrow | 54 | imageView.image = imgBackArrow |
55 | } | 55 | } |
56 | view.addSubview(imageView) | 56 | view.addSubview(imageView) |
... | @@ -115,7 +115,7 @@ extension UIViewController { | ... | @@ -115,7 +115,7 @@ extension UIViewController { |
115 | let customInfoView = UIView(frame: CGRect(x: 0, y: 0, width: 24, height: 24)) | 115 | let customInfoView = UIView(frame: CGRect(x: 0, y: 0, width: 24, height: 24)) |
116 | 116 | ||
117 | // Create the UIImageView for the custom info image | 117 | // Create the UIImageView for the custom info image |
118 | - let infoImageView = UIImageView(image: UIImage(named: "info_icon", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)) // Your custom image | 118 | + let infoImageView = UIImageView(image: UIImage(named: "info_icon", in: Bundle.frameworkResourceBundle, compatibleWith: nil)) // Your custom image |
119 | infoImageView.contentMode = .scaleAspectFit // Adjust to fit the image correctly | 119 | infoImageView.contentMode = .scaleAspectFit // Adjust to fit the image correctly |
120 | infoImageView.frame = customInfoView.bounds // Set the image to fill the view | 120 | infoImageView.frame = customInfoView.bounds // Set the image to fill the view |
121 | 121 | ... | ... |
... | @@ -16,6 +16,6 @@ import UIKit | ... | @@ -16,6 +16,6 @@ import UIKit |
16 | } | 16 | } |
17 | 17 | ||
18 | func configureCell(data: OfferModel) { | 18 | func configureCell(data: OfferModel) { |
19 | - backgroundImage.image = UIImage(named: data.bannerImage, in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 19 | + backgroundImage.image = UIImage(named: data.bannerImage, in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
20 | } | 20 | } |
21 | } | 21 | } | ... | ... |
... | @@ -29,7 +29,7 @@ protocol MyRewardsBannerOffersScrollTableViewCellDelegate: AnyObject { | ... | @@ -29,7 +29,7 @@ protocol MyRewardsBannerOffersScrollTableViewCellDelegate: AnyObject { |
29 | super.awakeFromNib() | 29 | super.awakeFromNib() |
30 | // Initialization code | 30 | // Initialization code |
31 | 31 | ||
32 | - profileImage.image = UIImage(named: "profile_pic_default", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 32 | + profileImage.image = UIImage(named: "profile_pic_default", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
33 | 33 | ||
34 | profileButton.addTarget(self, action: #selector(profileButtonTapped), for: .touchUpInside) | 34 | profileButton.addTarget(self, action: #selector(profileButtonTapped), for: .touchUpInside) |
35 | 35 | ||
... | @@ -45,7 +45,7 @@ protocol MyRewardsBannerOffersScrollTableViewCellDelegate: AnyObject { | ... | @@ -45,7 +45,7 @@ protocol MyRewardsBannerOffersScrollTableViewCellDelegate: AnyObject { |
45 | 45 | ||
46 | 46 | ||
47 | // Register XIBs for collection view cells | 47 | // Register XIBs for collection view cells |
48 | - collectionView.register(UINib(nibName: "MyRewardsBannerOfferCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell") | 48 | + collectionView.register(UINib(nibName: "MyRewardsBannerOfferCollectionViewCell", bundle: Bundle.frameworkBundle), forCellWithReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell") |
49 | 49 | ||
50 | // Fix background colors | 50 | // Fix background colors |
51 | collectionView.backgroundColor = UIColor.clear | 51 | collectionView.backgroundColor = UIColor.clear | ... | ... |
... | @@ -32,8 +32,8 @@ import UIKit | ... | @@ -32,8 +32,8 @@ import UIKit |
32 | } | 32 | } |
33 | 33 | ||
34 | func configureCell(data: OfferModel) { | 34 | func configureCell(data: OfferModel) { |
35 | - bannerImage.image = UIImage(named: data.bannerImage, in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 35 | + bannerImage.image = UIImage(named: data.bannerImage, in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
36 | - favoriteImage.image = UIImage(named: data.isFavorite ? "favorite_filled" : "favorite_empty", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 36 | + favoriteImage.image = UIImage(named: data.isFavorite ? "favorite_filled" : "favorite_empty", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
37 | 37 | ||
38 | let discountSymbol = | 38 | let discountSymbol = |
39 | data.discountType == "percentage" ? "%" | 39 | data.discountType == "percentage" ? "%" |
... | @@ -61,6 +61,6 @@ import UIKit | ... | @@ -61,6 +61,6 @@ import UIKit |
61 | expirationLabel.font = UIFont(name: "PingLCG-Regular", size: 13) | 61 | expirationLabel.font = UIFont(name: "PingLCG-Regular", size: 13) |
62 | expirationLabel.textColor = UIColor(rgb: 0x00111B) | 62 | expirationLabel.textColor = UIColor(rgb: 0x00111B) |
63 | 63 | ||
64 | - logoImage.image = UIImage(named: data.merchantLogo, in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 64 | + logoImage.image = UIImage(named: data.merchantLogo, in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
65 | } | 65 | } |
66 | } | 66 | } | ... | ... |
... | @@ -37,7 +37,7 @@ protocol MyRewardsOffersScrollTableViewCellDelegate: AnyObject { | ... | @@ -37,7 +37,7 @@ protocol MyRewardsOffersScrollTableViewCellDelegate: AnyObject { |
37 | allButtonLabel.frame.size.height = allButtonLabel.intrinsicContentSize.height | 37 | allButtonLabel.frame.size.height = allButtonLabel.intrinsicContentSize.height |
38 | 38 | ||
39 | // Register XIBs for collection view cells | 39 | // Register XIBs for collection view cells |
40 | - collectionView.register(UINib(nibName: "MyRewardsOfferCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "MyRewardsOfferCollectionViewCell") | 40 | + collectionView.register(UINib(nibName: "MyRewardsOfferCollectionViewCell", bundle: Bundle.frameworkBundle), forCellWithReuseIdentifier: "MyRewardsOfferCollectionViewCell") |
41 | 41 | ||
42 | // Fix background colors | 42 | // Fix background colors |
43 | collectionView.backgroundColor = UIColor.clear | 43 | collectionView.backgroundColor = UIColor.clear | ... | ... |
... | @@ -28,7 +28,7 @@ protocol ProfileCouponFiltersTableViewCellDelegate: AnyObject { | ... | @@ -28,7 +28,7 @@ protocol ProfileCouponFiltersTableViewCellDelegate: AnyObject { |
28 | titleLabel.text = "Τα κουπόνια μου" | 28 | titleLabel.text = "Τα κουπόνια μου" |
29 | 29 | ||
30 | // Register XIBs for collection view cells | 30 | // Register XIBs for collection view cells |
31 | - collectionView.register(UINib(nibName: "ProfileFilterCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "ProfileFilterCollectionViewCell") | 31 | + collectionView.register(UINib(nibName: "ProfileFilterCollectionViewCell", bundle: Bundle.frameworkBundle), forCellWithReuseIdentifier: "ProfileFilterCollectionViewCell") |
32 | 32 | ||
33 | // Fix background colors | 33 | // Fix background colors |
34 | // collectionView.backgroundColor = UIColor.clear | 34 | // collectionView.backgroundColor = UIColor.clear | ... | ... |
... | @@ -32,8 +32,8 @@ import UIKit | ... | @@ -32,8 +32,8 @@ import UIKit |
32 | } | 32 | } |
33 | 33 | ||
34 | func configureCell(data: OfferModel) { | 34 | func configureCell(data: OfferModel) { |
35 | - bannerImage.image = UIImage(named: data.bannerImage, in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 35 | + bannerImage.image = UIImage(named: data.bannerImage, in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
36 | - favoriteImage.image = UIImage(named: data.isFavorite ? "favorite_filled" : "favorite_empty", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 36 | + favoriteImage.image = UIImage(named: data.isFavorite ? "favorite_filled" : "favorite_empty", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
37 | 37 | ||
38 | let discountSymbol = | 38 | let discountSymbol = |
39 | data.discountType == "percentage" ? "%" | 39 | data.discountType == "percentage" ? "%" |
... | @@ -61,7 +61,7 @@ import UIKit | ... | @@ -61,7 +61,7 @@ import UIKit |
61 | expirationLabel.font = UIFont(name: "PingLCG-Regular", size: 13) | 61 | expirationLabel.font = UIFont(name: "PingLCG-Regular", size: 13) |
62 | expirationLabel.textColor = UIColor(rgb: 0x00111B) | 62 | expirationLabel.textColor = UIColor(rgb: 0x00111B) |
63 | 63 | ||
64 | - logoImage.image = UIImage(named: data.merchantLogo, in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 64 | + logoImage.image = UIImage(named: data.merchantLogo, in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
65 | } | 65 | } |
66 | 66 | ||
67 | public override func setSelected(_ selected: Bool, animated: Bool) { | 67 | public override func setSelected(_ selected: Bool, animated: Bool) { | ... | ... |
... | @@ -17,7 +17,7 @@ import UIKit | ... | @@ -17,7 +17,7 @@ import UIKit |
17 | public override func awakeFromNib() { | 17 | public override func awakeFromNib() { |
18 | super.awakeFromNib() | 18 | super.awakeFromNib() |
19 | 19 | ||
20 | - profileImage.image = UIImage(named: "profile_pic_default", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 20 | + profileImage.image = UIImage(named: "profile_pic_default", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
21 | 21 | ||
22 | tagView1.backgroundColor = UIColor(rgb: 0x09914E) | 22 | tagView1.backgroundColor = UIColor(rgb: 0x09914E) |
23 | tagView1.layer.cornerRadius = 4.0 | 23 | tagView1.layer.cornerRadius = 4.0 | ... | ... |
... | @@ -13,7 +13,7 @@ import UIKit | ... | @@ -13,7 +13,7 @@ import UIKit |
13 | public override func awakeFromNib() { | 13 | public override func awakeFromNib() { |
14 | super.awakeFromNib() | 14 | super.awakeFromNib() |
15 | 15 | ||
16 | - questionnaireBannerImage.image = UIImage(named: "questionnaire_banner", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 16 | + questionnaireBannerImage.image = UIImage(named: "questionnaire_banner", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
17 | 17 | ||
18 | } | 18 | } |
19 | 19 | ... | ... |
... | @@ -12,7 +12,7 @@ import UIKit | ... | @@ -12,7 +12,7 @@ import UIKit |
12 | 12 | ||
13 | // MARK: - Initializers | 13 | // MARK: - Initializers |
14 | public convenience init() { | 14 | public convenience init() { |
15 | - self.init(nibName: "CouponViewController", bundle: Bundle(for: MyEmptyClass.self)) | 15 | + self.init(nibName: "CouponViewController", bundle: Bundle.frameworkBundle) |
16 | } | 16 | } |
17 | 17 | ||
18 | public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { | 18 | public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { |
... | @@ -99,13 +99,13 @@ import UIKit | ... | @@ -99,13 +99,13 @@ import UIKit |
99 | infoView.layer.borderWidth = 1.0 | 99 | infoView.layer.borderWidth = 1.0 |
100 | infoView.layer.borderColor = UIColor(red: 0.01, green: 0.05, blue: 0.11, alpha: 0.19).cgColor | 100 | infoView.layer.borderColor = UIColor(red: 0.01, green: 0.05, blue: 0.11, alpha: 0.19).cgColor |
101 | 101 | ||
102 | - infoImage.image = UIImage(named: "info", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 102 | + infoImage.image = UIImage(named: "info", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
103 | - shareImage.image = UIImage(named: "share", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 103 | + shareImage.image = UIImage(named: "share", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
104 | - couponCodeArrowImage.image = UIImage(named: "arrow_down", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 104 | + couponCodeArrowImage.image = UIImage(named: "arrow_down", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
105 | - copyButtonImage.image = UIImage(named: "copy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 105 | + copyButtonImage.image = UIImage(named: "copy", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
106 | - couponQRArrowImage.image = UIImage(named: "arrow_down", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 106 | + couponQRArrowImage.image = UIImage(named: "arrow_down", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
107 | - couponQRImage.image = UIImage(named: "barcode", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 107 | + couponQRImage.image = UIImage(named: "barcode", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
108 | - termsButtonArrowImage.image = UIImage(named: "arrow_down", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 108 | + termsButtonArrowImage.image = UIImage(named: "arrow_down", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
109 | 109 | ||
110 | infoLabel.font = UIFont(name: "PingLCG-Regular", size: 13) | 110 | infoLabel.font = UIFont(name: "PingLCG-Regular", size: 13) |
111 | infoLabel.textColor = UIColor(rgb: 0x020E1C) | 111 | infoLabel.textColor = UIColor(rgb: 0x020E1C) |
... | @@ -154,8 +154,8 @@ import UIKit | ... | @@ -154,8 +154,8 @@ import UIKit |
154 | } | 154 | } |
155 | 155 | ||
156 | private func setupUI(with coupon: OfferModel) { | 156 | private func setupUI(with coupon: OfferModel) { |
157 | - couponImage.image = UIImage(named: coupon.bannerImage, in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 157 | + couponImage.image = UIImage(named: coupon.bannerImage, in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
158 | - favoriteImage.image = UIImage(named: coupon.isFavorite ? "favorite2_filled" : "favorite2_empty", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | 158 | + favoriteImage.image = UIImage(named: coupon.isFavorite ? "favorite2_filled" : "favorite2_empty", in: Bundle.frameworkResourceBundle, compatibleWith: nil) |
159 | 159 | ||
160 | titleLabel.font = UIFont(name: "PingLCG-Bold", size: 24) | 160 | titleLabel.font = UIFont(name: "PingLCG-Bold", size: 24) |
161 | titleLabel.textColor = UIColor(rgb: 0xF2709D) | 161 | titleLabel.textColor = UIColor(rgb: 0xF2709D) | ... | ... |
... | @@ -13,7 +13,7 @@ import UIKit | ... | @@ -13,7 +13,7 @@ import UIKit |
13 | 13 | ||
14 | // MARK: - Initializers | 14 | // MARK: - Initializers |
15 | public convenience init() { | 15 | public convenience init() { |
16 | - self.init(nibName: "MyRewardsViewController", bundle: Bundle(for: MyEmptyClass.self)) | 16 | + self.init(nibName: "MyRewardsViewController", bundle: Bundle.frameworkBundle) |
17 | } | 17 | } |
18 | 18 | ||
19 | public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { | 19 | public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { |
... | @@ -310,8 +310,8 @@ import UIKit | ... | @@ -310,8 +310,8 @@ import UIKit |
310 | // self.navigationController?.setNavigationBarHidden(true, animated: false) | 310 | // self.navigationController?.setNavigationBarHidden(true, animated: false) |
311 | 311 | ||
312 | // Register XIBs for table view cells | 312 | // Register XIBs for table view cells |
313 | - tableView.register(UINib(nibName: "MyRewardsBannerOffersScrollTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "MyRewardsBannerOffersScrollTableViewCell") | 313 | + tableView.register(UINib(nibName: "MyRewardsBannerOffersScrollTableViewCell", bundle: Bundle.frameworkBundle), forCellReuseIdentifier: "MyRewardsBannerOffersScrollTableViewCell") |
314 | - tableView.register(UINib(nibName: "MyRewardsOffersScrollTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "MyRewardsOffersScrollTableViewCell") | 314 | + tableView.register(UINib(nibName: "MyRewardsOffersScrollTableViewCell", bundle: Bundle.frameworkBundle), forCellReuseIdentifier: "MyRewardsOffersScrollTableViewCell") |
315 | 315 | ||
316 | // Set up table view | 316 | // Set up table view |
317 | tableView.delegate = self | 317 | tableView.delegate = self |
... | @@ -417,7 +417,7 @@ import UIKit | ... | @@ -417,7 +417,7 @@ import UIKit |
417 | 417 | ||
418 | private func openCampaignViewController(with index: Int) { | 418 | private func openCampaignViewController(with index: Int) { |
419 | 419 | ||
420 | - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) | 420 | + let storyboard = UIStoryboard(name: "Main", bundle: Bundle.frameworkBundle) |
421 | if let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as? SwiftWarplyFramework.CampaignViewController { | 421 | if let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as? SwiftWarplyFramework.CampaignViewController { |
422 | // vc.campaignUrl = "https://warply.s3.amazonaws.com/dei/campaigns/DehEasterContest_stage/index.html" | 422 | // vc.campaignUrl = "https://warply.s3.amazonaws.com/dei/campaigns/DehEasterContest_stage/index.html" |
423 | vc.campaignUrl = contestUrls[index] | 423 | vc.campaignUrl = contestUrls[index] |
... | @@ -428,14 +428,14 @@ import UIKit | ... | @@ -428,14 +428,14 @@ import UIKit |
428 | } | 428 | } |
429 | 429 | ||
430 | private func openCouponViewController(with offer: OfferModel) { | 430 | private func openCouponViewController(with offer: OfferModel) { |
431 | - let vc = SwiftWarplyFramework.CouponViewController(nibName: "CouponViewController", bundle: Bundle(for: MyEmptyClass.self)) | 431 | + let vc = SwiftWarplyFramework.CouponViewController(nibName: "CouponViewController", bundle: Bundle.frameworkBundle) |
432 | vc.coupon = offer | 432 | vc.coupon = offer |
433 | 433 | ||
434 | self.navigationController?.pushViewController(vc, animated: true) | 434 | self.navigationController?.pushViewController(vc, animated: true) |
435 | } | 435 | } |
436 | 436 | ||
437 | private func openProfileViewController() { | 437 | private func openProfileViewController() { |
438 | - let vc = SwiftWarplyFramework.ProfileViewController(nibName: "ProfileViewController", bundle: Bundle(for: MyEmptyClass.self)) | 438 | + let vc = SwiftWarplyFramework.ProfileViewController(nibName: "ProfileViewController", bundle: Bundle.frameworkBundle) |
439 | 439 | ||
440 | self.navigationController?.pushViewController(vc, animated: true) | 440 | self.navigationController?.pushViewController(vc, animated: true) |
441 | } | 441 | } | ... | ... |
... | @@ -12,7 +12,7 @@ import UIKit | ... | @@ -12,7 +12,7 @@ import UIKit |
12 | 12 | ||
13 | // MARK: - Initializers | 13 | // MARK: - Initializers |
14 | public convenience init() { | 14 | public convenience init() { |
15 | - self.init(nibName: "ProfileViewController", bundle: Bundle(for: MyEmptyClass.self)) | 15 | + self.init(nibName: "ProfileViewController", bundle: Bundle.frameworkBundle) |
16 | } | 16 | } |
17 | 17 | ||
18 | public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { | 18 | public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { |
... | @@ -208,11 +208,11 @@ import UIKit | ... | @@ -208,11 +208,11 @@ import UIKit |
208 | setNavigationTitle("Το προφίλ μου") | 208 | setNavigationTitle("Το προφίλ μου") |
209 | 209 | ||
210 | // Register XIBs for table view cells | 210 | // Register XIBs for table view cells |
211 | - tableView.register(UINib(nibName: "ProfileHeaderTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "ProfileHeaderTableViewCell") | 211 | + tableView.register(UINib(nibName: "ProfileHeaderTableViewCell", bundle: Bundle.frameworkBundle), forCellReuseIdentifier: "ProfileHeaderTableViewCell") |
212 | - tableView.register(UINib(nibName: "ProfileQuestionnaireTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "ProfileQuestionnaireTableViewCell") | 212 | + tableView.register(UINib(nibName: "ProfileQuestionnaireTableViewCell", bundle: Bundle.frameworkBundle), forCellReuseIdentifier: "ProfileQuestionnaireTableViewCell") |
213 | - tableView.register(UINib(nibName: "MyRewardsOffersScrollTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "MyRewardsOffersScrollTableViewCell") | 213 | + tableView.register(UINib(nibName: "MyRewardsOffersScrollTableViewCell", bundle: Bundle.frameworkBundle), forCellReuseIdentifier: "MyRewardsOffersScrollTableViewCell") |
214 | - tableView.register(UINib(nibName: "ProfileCouponFiltersTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "ProfileCouponFiltersTableViewCell") | 214 | + tableView.register(UINib(nibName: "ProfileCouponFiltersTableViewCell", bundle: Bundle.frameworkBundle), forCellReuseIdentifier: "ProfileCouponFiltersTableViewCell") |
215 | - tableView.register(UINib(nibName: "ProfileCouponTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "ProfileCouponTableViewCell") | 215 | + tableView.register(UINib(nibName: "ProfileCouponTableViewCell", bundle: Bundle.frameworkBundle), forCellReuseIdentifier: "ProfileCouponTableViewCell") |
216 | 216 | ||
217 | // Set up table view | 217 | // Set up table view |
218 | tableView.delegate = self | 218 | tableView.delegate = self |
... | @@ -264,7 +264,7 @@ import UIKit | ... | @@ -264,7 +264,7 @@ import UIKit |
264 | } | 264 | } |
265 | 265 | ||
266 | private func openCouponViewController(with offer: OfferModel) { | 266 | private func openCouponViewController(with offer: OfferModel) { |
267 | - let vc = SwiftWarplyFramework.CouponViewController(nibName: "CouponViewController", bundle: Bundle(for: MyEmptyClass.self)) | 267 | + let vc = SwiftWarplyFramework.CouponViewController(nibName: "CouponViewController", bundle: Bundle.frameworkBundle) |
268 | vc.coupon = offer | 268 | vc.coupon = offer |
269 | 269 | ||
270 | self.navigationController?.pushViewController(vc, animated: true) | 270 | self.navigationController?.pushViewController(vc, animated: true) | ... | ... |
-
Please register or login to post a comment