From 291df5e4bd728e1f4eb29392e05613e9724fb325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8C=E1=85=A5=E1=86=BC=E1=84=8C=E1=85=B5=E1=84=92?= =?UTF-8?q?=E1=85=A7=E1=86=A8?= Date: Fri, 16 Feb 2024 13:01:34 +0900 Subject: [PATCH] =?UTF-8?q?[#7]=20public=20=ED=95=A8=EC=88=98=EC=97=90=20?= =?UTF-8?q?=EB=AC=B8=EC=84=9C=ED=99=94=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 일부 함수 주석 테스트 - Editer/Structure/Documentation으로 간단하게 추가 가능 --- Sources/YLS-iOS/YLS_iOS.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Sources/YLS-iOS/YLS_iOS.swift b/Sources/YLS-iOS/YLS_iOS.swift index 9682c7b..aed129c 100644 --- a/Sources/YLS-iOS/YLS_iOS.swift +++ b/Sources/YLS-iOS/YLS_iOS.swift @@ -16,6 +16,8 @@ public final class YLS { private init() {} + /// YLS를 초기화하는 함수입니다. + /// - Parameter urlString: 해당하는 서비스의 로깅 시스템 URL 문자열 public func initialize(from urlString: String) { guard let url = URL(string: urlString) else { logger.error("Failure YLS init by - \(urlString)") @@ -25,6 +27,8 @@ public final class YLS { self.url = url } + /// YLS에서 사용할 UserID를 설정하는 함수입니다. + /// - Parameter userID: 로그인된 사용자일 경우에는 UserID, 아닐 경우 nil public func setUserID(of userID: String?) { if let userID { self.hashedUserID = hashUserID(userID: userID) @@ -34,6 +38,10 @@ public final class YLS { logger.info("YLS set hashUserID of \(self.hashedUserID ?? "")") } + /// <#Description#> + /// - Parameters: + /// - name: <#name description#> + /// - extra: <#extra description#> public func logEvent(name: String, extra: [String: Any] = [:]) { guard let hashedUserID else { logger.warning("YLS should init UserID") @@ -53,14 +61,24 @@ public final class YLS { } } + /// <#Description#> + /// - Parameters: + /// - name: <#name description#> + /// - extra: <#extra description#> public func logScreenEvent(screenName name: String, extra: [String: Any] = [:]) { logEvent(name: "\(name)Viewed", extra: extra) } + /// <#Description#> + /// - Parameters: + /// - name: <#name description#> + /// - extra: <#extra description#> public func logTapEvent(buttonName name: String, extra: [String: Any] = [:]) { logEvent(name: "\(name)Tapped", extra: extra) } + /// <#Description#> + /// - Parameter extra: <#extra description#> public func logLeaveEvent(extra: [String: Any] = [:]) { logEvent(name: "User Leaved", extra: extra) flush()