fix: Tags -> Anlytics

This commit is contained in:
2023-12-08 11:29:29 +01:00
parent 09c153ba65
commit 3fc2fd9bac
21 changed files with 930 additions and 550 deletions

View File

@ -0,0 +1,28 @@
//
// AnalyticsCategory.swift
//
//
// Created by Loris Perret on 05/12/2023.
//
import Foundation
class AnalyticsCategory {
let id: String // OnBoarding
var definitions = [AnalyticsDefinition]()
init(id: String) {
self.id = id
}
func hasOneOrMoreMatchingTags(tags: [String]) -> Bool {
let allTags = definitions.flatMap { $0.tags }
let allTagsSet = Set(allTags)
let intersection = Set(tags).intersection(allTagsSet)
if intersection.isEmpty {
return false
}
return true
}
}