Skip to content

Commit

Permalink
fix: text display issue on cocoapod installation (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
xing3523 committed Mar 11, 2024
1 parent f0aa77b commit 1cc54d8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ExampleObjC/ExampleObjC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
LifetimeTrackerDashboardIntegration *dashboardIntegration = [LifetimeTrackerDashboardIntegration new];
[dashboardIntegration setVisibleWhenIssueDetected];
[dashboardIntegration useBarStyle];
[LifetimeTracker setupOnUpdate:^(NSDictionary<NSString *,EntriesGroup *> * groups) {
[LifetimeTracker setupOnLeakDetected:^(Entry * _Nonnull entry, EntriesGroup * _Nonnull group) {
NSLog(@"Leak info:%@-%@",entry.name,group.name);
} onUpdate:^(NSDictionary<NSString *,EntriesGroup *> * groups) {
[dashboardIntegration refreshUIWithTrackedGroups: groups];
}];
return YES;
Expand Down
2 changes: 1 addition & 1 deletion LifetimeTracker.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "LifetimeTracker"
s.version = "1.8.1"
s.version = "1.8.3"
s.summary = "Framework to visually warn you when retain cycle / leak happens."
s.description = <<-DESC
Mini framework that can surface retain cycle issues sooner.
Expand Down
11 changes: 11 additions & 0 deletions Sources/Bundle+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ extension Bundle {
return Bundle(for: LifetimeTracker.self)
#endif
}
static var stringBundle: Bundle {
#if SWIFT_PACKAGE
return Bundle.module
#else
let mainBundle = Bundle(for: LifetimeTracker.self)
if let podBundlePath = mainBundle.path(forResource: "LifetimeTracker", ofType: "bundle") {
return Bundle(path: podBundlePath) ?? mainBundle
}
return mainBundle
#endif
}
}
2 changes: 1 addition & 1 deletion Sources/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import Foundation
internal extension String {

var lt_localized: String {
Bundle.resolvedBundle.localizedString(forKey: self, value: self, table: nil)
Bundle.stringBundle.localizedString(forKey: self, value: self, table: nil)
}
}

0 comments on commit 1cc54d8

Please sign in to comment.