From e90d6a07a99e6f2e137ee7349a6e6c74bb923e1d Mon Sep 17 00:00:00 2001 From: david Date: Mon, 13 May 2024 16:18:31 +0900 Subject: [PATCH 1/4] update SushiBeltTrackerItem properties access --- Sources/SushiBelt/SushiBeltTrackerItem.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/SushiBelt/SushiBeltTrackerItem.swift b/Sources/SushiBelt/SushiBeltTrackerItem.swift index 62a693b..4570874 100644 --- a/Sources/SushiBelt/SushiBeltTrackerItem.swift +++ b/Sources/SushiBelt/SushiBeltTrackerItem.swift @@ -40,11 +40,11 @@ public struct SushiBeltTrackerItem { return self.isTracked ? .tracked : .tracking } - var rect: SushiBeltTrackerItemRect - var isTracked: Bool = false - var currentVisibleRatio: CGFloat = 0.0 - var objectiveVisibleRatio: CGFloat = 0.0 - var timestamp: Date + public var rect: SushiBeltTrackerItemRect + public var isTracked: Bool = false + public var currentVisibleRatio: CGFloat = 0.0 + public var objectiveVisibleRatio: CGFloat = 0.0 + public var timestamp: Date public init(id: Identifier, rect: SushiBeltTrackerItemRect) { self.id = id From d02090e06fd65d6f78e9c61fd34e466767a730fc Mon Sep 17 00:00:00 2001 From: david Date: Mon, 13 May 2024 16:26:06 +0900 Subject: [PATCH 2/4] read only (private(set)) --- Sources/SushiBelt/SushiBeltTrackerItem.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/SushiBelt/SushiBeltTrackerItem.swift b/Sources/SushiBelt/SushiBeltTrackerItem.swift index 4570874..6e35707 100644 --- a/Sources/SushiBelt/SushiBeltTrackerItem.swift +++ b/Sources/SushiBelt/SushiBeltTrackerItem.swift @@ -40,11 +40,11 @@ public struct SushiBeltTrackerItem { return self.isTracked ? .tracked : .tracking } - public var rect: SushiBeltTrackerItemRect - public var isTracked: Bool = false - public var currentVisibleRatio: CGFloat = 0.0 - public var objectiveVisibleRatio: CGFloat = 0.0 - public var timestamp: Date + public private(set) var rect: SushiBeltTrackerItemRect + public private(set) var isTracked: Bool = false + public private(set) var currentVisibleRatio: CGFloat = 0.0 + public private(set) var objectiveVisibleRatio: CGFloat = 0.0 + public private(set) var timestamp: Date public init(id: Identifier, rect: SushiBeltTrackerItemRect) { self.id = id From a3216703381c865717e3c4fba18e12ad87e132c1 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 13 May 2024 16:54:22 +0900 Subject: [PATCH 3/4] isTracked, currentVisibleRatio, objectiveVisibleRatio make to interanal access --- Sources/SushiBelt/SushiBeltTrackerItem.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/SushiBelt/SushiBeltTrackerItem.swift b/Sources/SushiBelt/SushiBeltTrackerItem.swift index 6e35707..d239484 100644 --- a/Sources/SushiBelt/SushiBeltTrackerItem.swift +++ b/Sources/SushiBelt/SushiBeltTrackerItem.swift @@ -41,10 +41,10 @@ public struct SushiBeltTrackerItem { } public private(set) var rect: SushiBeltTrackerItemRect - public private(set) var isTracked: Bool = false - public private(set) var currentVisibleRatio: CGFloat = 0.0 - public private(set) var objectiveVisibleRatio: CGFloat = 0.0 public private(set) var timestamp: Date + var isTracked: Bool = false + var currentVisibleRatio: CGFloat = 0.0 + var objectiveVisibleRatio: CGFloat = 0.0 public init(id: Identifier, rect: SushiBeltTrackerItemRect) { self.id = id From 4e42b799e438ff1d155f4c9ec61940ebf73f50cd Mon Sep 17 00:00:00 2001 From: david Date: Mon, 13 May 2024 17:20:08 +0900 Subject: [PATCH 4/4] fix: remove private(set) --- Sources/SushiBelt/SushiBeltTrackerItem.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SushiBelt/SushiBeltTrackerItem.swift b/Sources/SushiBelt/SushiBeltTrackerItem.swift index d239484..dffe1c6 100644 --- a/Sources/SushiBelt/SushiBeltTrackerItem.swift +++ b/Sources/SushiBelt/SushiBeltTrackerItem.swift @@ -40,7 +40,7 @@ public struct SushiBeltTrackerItem { return self.isTracked ? .tracked : .tracking } - public private(set) var rect: SushiBeltTrackerItemRect + public var rect: SushiBeltTrackerItemRect public private(set) var timestamp: Date var isTracked: Bool = false var currentVisibleRatio: CGFloat = 0.0