Manos Chorianopoulos

SectionModel fixes

......@@ -10,7 +10,7 @@ import Foundation
// MARK: - Section Types
enum SectionType {
public enum SectionType {
case myRewardsProfileInfo // MyRewardsProfileInfoTableViewCell
case myRewardsBannerOffers // MyRewardsBannerOffersScrollTableViewCell
case myRewardsHorizontalCouponsets // MyRewardsOffersScrollTableViewCell
......@@ -21,7 +21,7 @@ enum SectionType {
case staticContent // Any cell that displays static content
}
enum ItemType {
public enum ItemType {
case profile // ProfileModel
case campaigns // [CampaignItemModel]
case couponSets // [CouponSetItemModel]
......@@ -33,18 +33,18 @@ enum ItemType {
// MARK: - SectionModel
struct SectionModel {
let sectionType: SectionType // MANDATORY - defines which cell to use
let title: String? // OPTIONAL - section title
let items: [Any]? // OPTIONAL - array of items (nil for sections with no items)
let itemType: ItemType? // OPTIONAL - type of items in the array
let count: Int? // OPTIONAL - explicit count (computed from items.count if nil)
let metadata: [String: Any]? // OPTIONAL - additional section-specific data
public struct SectionModel {
public let sectionType: SectionType // MANDATORY - defines which cell to use
public let title: String? // OPTIONAL - section title
public let items: [Any]? // OPTIONAL - array of items (nil for sections with no items)
public let itemType: ItemType? // OPTIONAL - type of items in the array
public let count: Int? // OPTIONAL - explicit count (computed from items.count if nil)
public let metadata: [String: Any]? // OPTIONAL - additional section-specific data
}
// MARK: - SectionModel Extensions
extension SectionModel {
public extension SectionModel {
// Convenience initializer for sections with items
init(sectionType: SectionType, title: String? = nil, items: [Any], itemType: ItemType, metadata: [String: Any]? = nil) {
self.sectionType = sectionType
......