Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2025-07-23 17:37:14 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
472d8bf66824eff4453f1ed0cf066c7e59df482d
472d8bf6
1 parent
c8ea360a
SectionModel fixes
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/models/SectionModel.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
472d8bf
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/models/SectionModel.swift
View file @
472d8bf
...
...
@@ -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
...
...
Please
register
or
login
to post a comment