Showing
7 changed files
with
49 additions
and
2 deletions
... | @@ -7,7 +7,7 @@ | ... | @@ -7,7 +7,7 @@ |
7 | <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> | 7 | <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> |
8 | <dict> | 8 | <dict> |
9 | <key>orderHint</key> | 9 | <key>orderHint</key> |
10 | - <integer>0</integer> | 10 | + <integer>1</integer> |
11 | </dict> | 11 | </dict> |
12 | </dict> | 12 | </dict> |
13 | </dict> | 13 | </dict> | ... | ... |
... | @@ -13,6 +13,7 @@ | ... | @@ -13,6 +13,7 @@ |
13 | 1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A9028A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf */; }; | 13 | 1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A9028A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf */; }; |
14 | 1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A9128A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf */; }; | 14 | 1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A9128A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf */; }; |
15 | 1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */ = {isa = PBXBuildFile; productRef = 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */; }; | 15 | 1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */ = {isa = PBXBuildFile; productRef = 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */; }; |
16 | + 1E4410B128F5855000859F92 /* CampaignCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E4410B028F5855000859F92 /* CampaignCategory.swift */; }; | ||
16 | 1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */; }; | 17 | 1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */; }; |
17 | 1E87A9EF28C2021200C79F90 /* ContextualViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */; }; | 18 | 1E87A9EF28C2021200C79F90 /* ContextualViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */; }; |
18 | 1EA1AF0A2835346A008998AA /* CouponsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */; }; | 19 | 1EA1AF0A2835346A008998AA /* CouponsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */; }; |
... | @@ -174,6 +175,7 @@ | ... | @@ -174,6 +175,7 @@ |
174 | 1E108A9028A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_bold_italic.ttf; sourceTree = "<group>"; }; | 175 | 1E108A9028A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_bold_italic.ttf; sourceTree = "<group>"; }; |
175 | 1E108A9128A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_bold.ttf; sourceTree = "<group>"; }; | 176 | 1E108A9128A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_bold.ttf; sourceTree = "<group>"; }; |
176 | 1E108A9728A3FA9B0008B8E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; | 177 | 1E108A9728A3FA9B0008B8E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; |
178 | + 1E4410B028F5855000859F92 /* CampaignCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CampaignCategory.swift; sourceTree = "<group>"; }; | ||
177 | 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponBarcodeViewController.swift; sourceTree = "<group>"; }; | 179 | 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponBarcodeViewController.swift; sourceTree = "<group>"; }; |
178 | 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContextualViewController.swift; sourceTree = "<group>"; }; | 180 | 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContextualViewController.swift; sourceTree = "<group>"; }; |
179 | 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponsTableViewCell.swift; sourceTree = "<group>"; }; | 181 | 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponsTableViewCell.swift; sourceTree = "<group>"; }; |
... | @@ -462,6 +464,7 @@ | ... | @@ -462,6 +464,7 @@ |
462 | E6A77A35282BB4CB0045BBA8 /* MakeItAPresentViewController.swift */, | 464 | E6A77A35282BB4CB0045BBA8 /* MakeItAPresentViewController.swift */, |
463 | E6A7785A282933E40045BBA8 /* Helpers */, | 465 | E6A7785A282933E40045BBA8 /* Helpers */, |
464 | E6A77861282933E50045BBA8 /* Main.storyboard */, | 466 | E6A77861282933E50045BBA8 /* Main.storyboard */, |
467 | + 1E4410B028F5855000859F92 /* CampaignCategory.swift */, | ||
465 | 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */, | 468 | 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */, |
466 | 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */, | 469 | 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */, |
467 | 1EB236AA28816B680063777A /* ShareViewController.swift */, | 470 | 1EB236AA28816B680063777A /* ShareViewController.swift */, |
... | @@ -943,6 +946,7 @@ | ... | @@ -943,6 +946,7 @@ |
943 | E6A7794A282933E70045BBA8 /* FMDatabaseAdditions.m in Sources */, | 946 | E6A7794A282933E70045BBA8 /* FMDatabaseAdditions.m in Sources */, |
944 | E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */, | 947 | E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */, |
945 | 1ECA079128D9E3BA00D2BDE0 /* CSMButton.swift in Sources */, | 948 | 1ECA079128D9E3BA00D2BDE0 /* CSMButton.swift in Sources */, |
949 | + 1E4410B128F5855000859F92 /* CampaignCategory.swift in Sources */, | ||
946 | E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */, | 950 | E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */, |
947 | A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */, | 951 | A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */, |
948 | E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */, | 952 | E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */, | ... | ... |
... | @@ -7,7 +7,7 @@ | ... | @@ -7,7 +7,7 @@ |
7 | <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> | 7 | <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> |
8 | <dict> | 8 | <dict> |
9 | <key>orderHint</key> | 9 | <key>orderHint</key> |
10 | - <integer>1</integer> | 10 | + <integer>0</integer> |
11 | </dict> | 11 | </dict> |
12 | </dict> | 12 | </dict> |
13 | </dict> | 13 | </dict> | ... | ... |
No preview for this file type
1 | +// | ||
2 | +// CampaignCategory.swift | ||
3 | +// SwiftWarplyFramework | ||
4 | +// | ||
5 | +// Created by Manos Chorianopoulos on 11/10/22. | ||
6 | +// | ||
7 | + | ||
8 | +import Foundation | ||
9 | + | ||
10 | +public class CampaignCategory: Codable { | ||
11 | + | ||
12 | + // attributes | ||
13 | + public var name: String? | ||
14 | + public var index: Int | ||
15 | + public var items: Array<swiftApi.CampaignItemModel> | ||
16 | + | ||
17 | + // initialization | ||
18 | + public init(_ name: String) { | ||
19 | + self.name = name == "ΑΛΛΕΣ" ? name : String(name.dropFirst()) | ||
20 | + self.index = Int(name.prefix(1)) ?? 0 | ||
21 | + self.items = [swiftApi.CampaignItemModel]() | ||
22 | + } | ||
23 | + | ||
24 | + public init(_ name: String, index: Int) { | ||
25 | + self.name = name == "ΑΛΛΕΣ" ? name : String(name.dropFirst()) | ||
26 | + self.index = index | ||
27 | + self.items = [swiftApi.CampaignItemModel]() | ||
28 | + } | ||
29 | +} | ||
30 | + | ||
31 | +enum CampaignCategoryFactory { | ||
32 | + static func create(withTitle title: String) -> CampaignCategory { | ||
33 | + | ||
34 | + var index = 100 | ||
35 | + let indexChr:Character = title[title.index(title.startIndex, offsetBy: 1)] | ||
36 | + if indexChr.isNumber { | ||
37 | + index = indexChr.wholeNumberValue! | ||
38 | + } | ||
39 | + | ||
40 | + return CampaignCategory(title, index: index) | ||
41 | + } | ||
42 | +} | ||
43 | + |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment