Skip to content

Commit 8cec2a7

Browse files
refactor: allow accessing details of groups in the hosting project
1 parent 26c2527 commit 8cec2a7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

LifetimeTracker.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "LifetimeTracker"
3-
s.version = "1.6.1"
3+
s.version = "1.6.2"
44
s.summary = "Framework to visually warn you when retain cycle / leak happens."
55
s.description = <<-DESC
66
Mini framework that can surface retain cycle issues sooner.

Sources/LifetimeTracker.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ public extension LifetimeTrackable {
121121

122122
internal var trackedGroups = [String: EntriesGroup]()
123123

124-
enum LifetimeState {
124+
public enum LifetimeState {
125125
case valid
126126
case leaky
127127
}
128128

129129
public final class Entry {
130-
var maxCount: Int
131-
let name: String
132-
fileprivate(set) var count: Int
133-
fileprivate(set) var pointers: Set<String>
130+
public fileprivate(set) var maxCount: Int
131+
public let name: String
132+
public fileprivate(set) var count: Int
133+
public fileprivate(set) var pointers: Set<String>
134134

135135
init(name: String, maxCount: Int) {
136136
self.maxCount = maxCount
@@ -148,16 +148,16 @@ public extension LifetimeTrackable {
148148
}
149149
}
150150

151-
var lifetimeState: LifetimeState {
151+
public var lifetimeState: LifetimeState {
152152
return count > maxCount ? .leaky : .valid
153153
}
154154
}
155155

156156
@objc public final class EntriesGroup: NSObject {
157-
var maxCount: Int = 0
158-
var name: String? = nil
159-
fileprivate(set) var count: Int = 0
160-
fileprivate(set) var entries = [String: Entry]()
157+
public fileprivate(set) var maxCount: Int = 0
158+
public fileprivate(set) var name: String? = nil
159+
public fileprivate(set) var count: Int = 0
160+
public fileprivate(set) var entries = [String: Entry]()
161161
private var usedMaxCountOverride = false
162162

163163
init(name: String) {
@@ -166,7 +166,7 @@ public extension LifetimeTrackable {
166166
}
167167
}
168168

169-
var lifetimeState: LifetimeState {
169+
public var lifetimeState: LifetimeState {
170170
// Mark the group as leaky if the count per group highter than it's max count
171171
guard count <= maxCount else {
172172
return .leaky

0 commit comments

Comments
 (0)