resgen.swift/Sources/ResgenSwift/Analytics/Model/AnalyticsCategory.swift
Thibaut Schmitt ee5055efa5
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Retours sur la structure du code
2023-12-11 10:24:42 +01:00

33 lines
635 B
Swift

//
// AnalyticsCategory.swift
//
//
// Created by Loris Perret on 05/12/2023.
//
import Foundation
class AnalyticsCategory {
let id: String // OnBoarding
var definitions = [AnalyticsDefinition]()
// MARK: - Init
init(id: String) {
self.id = id
}
// MARK: - Methods
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
}
}