Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Create ShowOffer Method
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseMonteiro committed May 30, 2024
1 parent 8fd354c commit 2b79f27
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
21 changes: 17 additions & 4 deletions TikiClient/Classes/OptInService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,23 @@ import Foundation


public class OptInService {
public static func showOffer(){

public static var offer: Offer?
public static var step: OfferFlowStep?
public static var offerList: [Offer]?

public static func showOffer(offer: Offer){
OptInService.step = .offers
for permission in offer.permissions {
if(!(permission?.isAuthorized())!){
OptInService.step = .permissions
permission?.requestAuth()
}
}
OptInService.offer = offer
}
public static func showSettings(){


public static func showSettings(offers: [Offer]){
OptInService.step = .settings
OptInService.offerList = offers
}
}
8 changes: 3 additions & 5 deletions TikiClient/Classes/UI/OfferFlowSteps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import Foundation

public enum OfferFlowStep{
case none,
allowTrackAsk,
deniedTrack,
linkCard,
deniedLinkCard
case offers,
permissions,
settings
}

0 comments on commit 2b79f27

Please sign in to comment.