-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #555 from SourcePointUSA/DIA-3558_expand_usnat_con…
…sent_object DIA-3558 expand usnat consent object
- Loading branch information
Showing
11 changed files
with
291 additions
and
132 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
ConsentViewController/Classes/Consents/SPConsentable.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,38 @@ | ||
// | ||
// SPConsentable.swift | ||
// Pods | ||
// | ||
// Created by Andre Herculano on 29.02.24. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol Consentable { | ||
var id: String { get } | ||
var consented: Bool { get } | ||
} | ||
|
||
@objcMembers public class SPConsentable: NSObject, Consentable, Codable { | ||
enum CodingKeys: String, CodingKey { | ||
case id = "_id" | ||
case consented | ||
} | ||
|
||
public let id: String | ||
public let consented: Bool | ||
|
||
override open var description: String { | ||
"SPConsentable(id: \(id), consented: \(consented))" | ||
} | ||
|
||
init(id: String, consented: Bool) { | ||
self.id = id | ||
self.consented = consented | ||
} | ||
|
||
override public func isEqual(_ object: Any?) -> Bool { | ||
guard let other = object as? SPConsentable else { return false } | ||
|
||
return other.id == id && other.consented == consented | ||
} | ||
} |
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
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
Oops, something went wrong.