-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
780 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,3 +111,7 @@ xcode-frameworks | |
|
||
vendor/ | ||
.bundle/ | ||
|
||
config.yaml | ||
venv/ | ||
Podfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Core/Core/Configuration/Combine/Config/AgreementConfig.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// AgreementConfig.swift | ||
// Core | ||
// | ||
// Created by Muhammad Umer on 11/13/23. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol AgreementConfigProtocol { | ||
var privacyPolicyURL: URL? { get } | ||
var tosURL: URL? { get } | ||
} | ||
|
||
private enum AgreementKeys: String { | ||
case privacyPolicyURL = "PRIVACY_POLICY_URL" | ||
case tosURL = "TOS_URL" | ||
} | ||
|
||
public class AgreementConfig: NSObject, AgreementConfigProtocol { | ||
public var privacyPolicyURL: URL? | ||
public var tosURL: URL? | ||
|
||
init(dictionary: [String: AnyObject]) { | ||
privacyPolicyURL = (dictionary[AgreementKeys.privacyPolicyURL.rawValue] as? String).flatMap(URL.init) | ||
tosURL = (dictionary[AgreementKeys.tosURL.rawValue] as? String).flatMap(URL.init) | ||
super.init() | ||
} | ||
} | ||
|
||
private let key = "AGREEMENT_URLS" | ||
extension Config { | ||
public var agreementConfig: AgreementConfigProtocol { | ||
return AgreementConfig(dictionary: self[key] as? [String: AnyObject] ?? [:]) | ||
} | ||
} |
Oops, something went wrong.