Skip to content

Commit

Permalink
Renaming views to internal class
Browse files Browse the repository at this point in the history
  • Loading branch information
ijunaid committed Jul 26, 2023
1 parent 25d6fd9 commit 565ee9a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
26 changes: 13 additions & 13 deletions Countly.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ - (void)startWithConfig:(CountlyConfig *)config
#if (TARGET_OS_IOS || TARGET_OS_TV)
if ([config.features containsObject:CLYAutoViewTracking])
{
CountlyViewTracking.sharedInstance.isEnabledOnInitialConfig = YES;
[CountlyViewTracking.sharedInstance startAutoViewTracking];
CountlyViewTrackingInternal.sharedInstance.isEnabledOnInitialConfig = YES;
[CountlyViewTrackingInternal.sharedInstance startAutoViewTracking];
}
#endif

Expand Down Expand Up @@ -257,7 +257,7 @@ - (void)suspend
if (!CountlyCommon.sharedInstance.manualSessionHandling)
[CountlyConnectionManager.sharedInstance endSession];

[CountlyViewTracking.sharedInstance pauseView];
[CountlyViewTrackingInternal.sharedInstance pauseView];

[CountlyPersistency.sharedInstance saveToFile];
}
Expand Down Expand Up @@ -285,7 +285,7 @@ - (void)resume
if (!CountlyCommon.sharedInstance.manualSessionHandling)
[CountlyConnectionManager.sharedInstance beginSession];

[CountlyViewTracking.sharedInstance resumeView];
[CountlyViewTrackingInternal.sharedInstance resumeView];

isSuspended = NO;
}
Expand All @@ -308,7 +308,7 @@ - (void)applicationWillTerminate:(NSNotification *)notification

CountlyConnectionManager.sharedInstance.isTerminating = YES;

[CountlyViewTracking.sharedInstance endView];
[CountlyViewTrackingInternal.sharedInstance endView];

[CountlyConnectionManager.sharedInstance sendEvents];

Expand Down Expand Up @@ -700,11 +700,11 @@ - (void)recordEvent:(NSString *)key segmentation:(NSDictionary *)segmentation co

if ([key isEqualToString:kCountlyReservedEventView])
{
event.PVID = CountlyViewTracking.sharedInstance.previousViewID ?: @"";
event.PVID = CountlyViewTrackingInternal.sharedInstance.previousViewID ?: @"";
}
else
{
event.CVID = CountlyViewTracking.sharedInstance.currentViewID ?: @"";
event.CVID = CountlyViewTrackingInternal.sharedInstance.currentViewID ?: @"";
}

// Check if the event is a reserved event
Expand Down Expand Up @@ -953,43 +953,43 @@ - (void)recordView:(NSString *)viewName;
{
CLY_LOG_I(@"%s %@", __FUNCTION__, viewName);

[CountlyViewTracking.sharedInstance startView:viewName customSegmentation:nil];
[CountlyViewTrackingInternal.sharedInstance startView:viewName customSegmentation:nil];
}

- (void)recordView:(NSString *)viewName segmentation:(NSDictionary *)segmentation
{
CLY_LOG_I(@"%s %@ %@", __FUNCTION__, viewName, segmentation);

[CountlyViewTracking.sharedInstance startView:viewName customSegmentation:segmentation];
[CountlyViewTrackingInternal.sharedInstance startView:viewName customSegmentation:segmentation];
}

#if (TARGET_OS_IOS || TARGET_OS_TV)
- (void)addExceptionForAutoViewTracking:(NSString *)exception
{
CLY_LOG_I(@"%s %@", __FUNCTION__, exception);

[CountlyViewTracking.sharedInstance addExceptionForAutoViewTracking:exception.copy];
[CountlyViewTrackingInternal.sharedInstance addExceptionForAutoViewTracking:exception.copy];
}

- (void)removeExceptionForAutoViewTracking:(NSString *)exception
{
CLY_LOG_I(@"%s %@", __FUNCTION__, exception);

[CountlyViewTracking.sharedInstance removeExceptionForAutoViewTracking:exception.copy];
[CountlyViewTrackingInternal.sharedInstance removeExceptionForAutoViewTracking:exception.copy];
}

- (void)setIsAutoViewTrackingActive:(BOOL)isAutoViewTrackingActive
{
CLY_LOG_I(@"%s %d", __FUNCTION__, isAutoViewTrackingActive);

CountlyViewTracking.sharedInstance.isAutoViewTrackingActive = isAutoViewTrackingActive;
CountlyViewTrackingInternal.sharedInstance.isAutoViewTrackingActive = isAutoViewTrackingActive;
}

- (BOOL)isAutoViewTrackingActive
{
CLY_LOG_I(@"%s", __FUNCTION__);

return CountlyViewTracking.sharedInstance.isAutoViewTrackingActive;
return CountlyViewTrackingInternal.sharedInstance.isAutoViewTrackingActive;
}
#endif

Expand Down
16 changes: 8 additions & 8 deletions Countly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
3B20A9C42245228700E3D7AE /* CountlyUserDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A99F2245228400E3D7AE /* CountlyUserDetails.h */; settings = {ATTRIBUTES = (Public, ); }; };
3B20A9C52245228700E3D7AE /* CountlyCrashReporter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A9A02245228400E3D7AE /* CountlyCrashReporter.h */; };
3B20A9C72245228700E3D7AE /* CountlyNotificationService.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A9A22245228500E3D7AE /* CountlyNotificationService.h */; };
3B20A9C82245228700E3D7AE /* CountlyViewTracking.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B20A9A32245228500E3D7AE /* CountlyViewTracking.m */; };
3B20A9C82245228700E3D7AE /* CountlyViewTrackingInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B20A9A32245228500E3D7AE /* CountlyViewTrackingInternal.m */; };
3B20A9C92245228700E3D7AE /* CountlyUserDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B20A9A42245228500E3D7AE /* CountlyUserDetails.m */; };
3B20A9CA2245228700E3D7AE /* CountlyConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A9A52245228500E3D7AE /* CountlyConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
3B20A9CB2245228700E3D7AE /* CountlyRemoteConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B20A9A62245228500E3D7AE /* CountlyRemoteConfig.m */; };
3B20A9CC2245228700E3D7AE /* CountlyViewTracking.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A9A72245228500E3D7AE /* CountlyViewTracking.h */; };
3B20A9CC2245228700E3D7AE /* CountlyViewTrackingInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A9A72245228500E3D7AE /* CountlyViewTrackingInternal.h */; };
3B20A9CE2245228700E3D7AE /* CountlyCrashReporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B20A9A92245228500E3D7AE /* CountlyCrashReporter.m */; };
3B20A9CF2245228700E3D7AE /* CountlyDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B20A9AA2245228500E3D7AE /* CountlyDeviceInfo.m */; };
3B20A9D12245228700E3D7AE /* CountlyConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B20A9AC2245228600E3D7AE /* CountlyConfig.m */; };
Expand Down Expand Up @@ -78,11 +78,11 @@
3B20A99F2245228400E3D7AE /* CountlyUserDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyUserDetails.h; sourceTree = "<group>"; };
3B20A9A02245228400E3D7AE /* CountlyCrashReporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyCrashReporter.h; sourceTree = "<group>"; };
3B20A9A22245228500E3D7AE /* CountlyNotificationService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyNotificationService.h; sourceTree = "<group>"; };
3B20A9A32245228500E3D7AE /* CountlyViewTracking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyViewTracking.m; sourceTree = "<group>"; };
3B20A9A32245228500E3D7AE /* CountlyViewTrackingInternal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyViewTrackingInternal.m; sourceTree = "<group>"; };
3B20A9A42245228500E3D7AE /* CountlyUserDetails.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyUserDetails.m; sourceTree = "<group>"; };
3B20A9A52245228500E3D7AE /* CountlyConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyConfig.h; sourceTree = "<group>"; };
3B20A9A62245228500E3D7AE /* CountlyRemoteConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyRemoteConfig.m; sourceTree = "<group>"; };
3B20A9A72245228500E3D7AE /* CountlyViewTracking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyViewTracking.h; sourceTree = "<group>"; };
3B20A9A72245228500E3D7AE /* CountlyViewTrackingInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyViewTrackingInternal.h; sourceTree = "<group>"; };
3B20A9A92245228500E3D7AE /* CountlyCrashReporter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyCrashReporter.m; sourceTree = "<group>"; };
3B20A9AA2245228500E3D7AE /* CountlyDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyDeviceInfo.m; sourceTree = "<group>"; };
3B20A9AC2245228600E3D7AE /* CountlyConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyConfig.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -152,8 +152,8 @@
3B20A9A62245228500E3D7AE /* CountlyRemoteConfig.m */,
3B20A99F2245228400E3D7AE /* CountlyUserDetails.h */,
3B20A9A42245228500E3D7AE /* CountlyUserDetails.m */,
3B20A9A72245228500E3D7AE /* CountlyViewTracking.h */,
3B20A9A32245228500E3D7AE /* CountlyViewTracking.m */,
3B20A9A72245228500E3D7AE /* CountlyViewTrackingInternal.h */,
3B20A9A32245228500E3D7AE /* CountlyViewTrackingInternal.m */,
3B20A9862245225A00E3D7AE /* Info.plist */,
3B20A9832245225A00E3D7AE /* Products */,
);
Expand Down Expand Up @@ -183,7 +183,7 @@
3B20A9B22245228700E3D7AE /* CountlyConnectionManager.h in Headers */,
1A3A576529ED47BD0041B7BE /* CountlyServerConfig.h in Headers */,
1ACA5DC12A309E7F001F770B /* CountlyRemoteConfigInternal.h in Headers */,
3B20A9CC2245228700E3D7AE /* CountlyViewTracking.h in Headers */,
3B20A9CC2245228700E3D7AE /* CountlyViewTrackingInternal.h in Headers */,
3B20A9BF2245228700E3D7AE /* CountlyLocationManager.h in Headers */,
D219374B248AC71C00E5798B /* CountlyPerformanceMonitoring.h in Headers */,
3B20A9BC2245228700E3D7AE /* CountlyCommon.h in Headers */,
Expand Down Expand Up @@ -285,7 +285,7 @@
3B20A9B42245228700E3D7AE /* CountlyPushNotifications.m in Sources */,
3B20A9C92245228700E3D7AE /* CountlyUserDetails.m in Sources */,
3B20A9D12245228700E3D7AE /* CountlyConfig.m in Sources */,
3B20A9C82245228700E3D7AE /* CountlyViewTracking.m in Sources */,
3B20A9C82245228700E3D7AE /* CountlyViewTrackingInternal.m in Sources */,
3B20A9D22245228700E3D7AE /* CountlyLocationManager.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
2 changes: 1 addition & 1 deletion CountlyCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#import "CountlyDeviceInfo.h"
#import "CountlyCrashReporter.h"
#import "CountlyConfig.h"
#import "CountlyViewTracking.h"
#import "CountlyViewTrackingInternal.h"
#import "CountlyFeedbacks.h"
#import "CountlyFeedbackWidget.h"
#import "CountlyPushNotifications.h"
Expand Down
4 changes: 2 additions & 2 deletions CountlyConsentManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ - (void)setConsentForViewTracking:(BOOL)consentForViewTracking
{
CLY_LOG_D(@"Consent for ViewTracking is given.");

[CountlyViewTracking.sharedInstance startAutoViewTracking];
[CountlyViewTrackingInternal.sharedInstance startAutoViewTracking];
}
else
{
CLY_LOG_D(@"Consent for ViewTracking is cancelled.");

[CountlyViewTracking.sharedInstance stopAutoViewTracking];
[CountlyViewTrackingInternal.sharedInstance stopAutoViewTracking];
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion CountlyViewTracking.h → CountlyViewTrackingInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

extern NSString* const kCountlyReservedEventView;

@interface CountlyViewTracking : NSObject
@interface CountlyViewTrackingInternal : NSObject
@property (nonatomic) BOOL isEnabledOnInitialConfig;
@property (nonatomic) NSString* currentViewID;
@property (nonatomic) NSString* previousViewID;
Expand Down
12 changes: 6 additions & 6 deletions CountlyViewTracking.m → CountlyViewTrackingInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#import "CountlyCommon.h"

@interface CountlyViewTracking ()
@interface CountlyViewTrackingInternal ()
@property (nonatomic) NSString* currentView;
@property (nonatomic) NSTimeInterval currentViewStartTime;
@property (nonatomic) NSTimeInterval accumulatedTime;
Expand All @@ -32,14 +32,14 @@ - (void)Countly_viewDidDisappear:(BOOL)animated;
@end
#endif

@implementation CountlyViewTracking
@implementation CountlyViewTrackingInternal

+ (instancetype)sharedInstance
{
if (!CountlyCommon.sharedInstance.hasStarted)
return nil;

static CountlyViewTracking* s_sharedInstance = nil;
static CountlyViewTrackingInternal* s_sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{s_sharedInstance = self.new;});
return s_sharedInstance;
Expand Down Expand Up @@ -188,7 +188,7 @@ - (void)startAutoViewTracking
[self swizzleViewTrackingMethods];

UIViewController* topVC = CountlyCommon.sharedInstance.topViewController;
NSString* viewTitle = [CountlyViewTracking.sharedInstance titleForViewController:topVC];
NSString* viewTitle = [CountlyViewTrackingInternal.sharedInstance titleForViewController:topVC];
[self startView:viewTitle];
}

Expand Down Expand Up @@ -340,7 +340,7 @@ - (void)Countly_viewDidAppear:(BOOL)animated
{
[self Countly_viewDidAppear:animated];

[CountlyViewTracking.sharedInstance performAutoViewTrackingForViewController:self];
[CountlyViewTrackingInternal.sharedInstance performAutoViewTrackingForViewController:self];

if (self.isPageSheetModal)
{
Expand All @@ -367,7 +367,7 @@ - (void)Countly_viewDidDisappear:(BOOL)animated
if (self.presentingVC)
{
CLY_LOG_I(@"A modal view controller with PageSheet presentation style is dismissed on iOS 13+. Forcing auto view tracking with stored presenting view controller.");
[CountlyViewTracking.sharedInstance performAutoViewTrackingForViewController:self.presentingVC];
[CountlyViewTrackingInternal.sharedInstance performAutoViewTrackingForViewController:self.presentingVC];
self.presentingVC = nil;
}
}
Expand Down

0 comments on commit 565ee9a

Please sign in to comment.