Skip to content

Commit 73137f4

Browse files
robert-smartbearDariaKunoichiRobert Bartoszewski
authored
Added LoadingIndicatorView that allows the User to defer ending of a ViewLoad (#474)
* Create loading indicator component for UIKit (#454) * Block all the spans in view hierarchy for data loading phase (#459) * Access ViewLoadInstrumentation through BugsnagPerformanceImpl * New loading indicators handling * Added more LoadingIndicator E2E tests --------- Co-authored-by: Daria Bialobrzeska <88393714+DariaKunoichi@users.noreply.github.com> Co-authored-by: Robert Bartoszewski <robert.smartbear@gmail.com>
1 parent 6394adc commit 73137f4

35 files changed

+981
-17
lines changed

BugsnagPerformance.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,22 @@
8383
1C68DBA12E535D06002621D1 /* BugsnagPerformanceAppStartSpanQuery.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C68DBA02E535D01002621D1 /* BugsnagPerformanceAppStartSpanQuery.mm */; };
8484
1C68DBA32E535DF2002621D1 /* BugsnagPerformanceAppStartTypePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C68DBA22E535DEE002621D1 /* BugsnagPerformanceAppStartTypePlugin.h */; };
8585
1C68DBA52E535E21002621D1 /* BugsnagPerformanceAppStartTypePlugin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C68DBA42E535E1E002621D1 /* BugsnagPerformanceAppStartTypePlugin.mm */; };
86+
1C3C0C612E2922080037B416 /* BugsnagPerformanceLoadingIndicatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C3C0C602E2922000037B416 /* BugsnagPerformanceLoadingIndicatorView.h */; settings = {ATTRIBUTES = (Public, ); }; };
87+
1C60EB452E43F4BE00D46E88 /* BugsnagPerformanceLoadingIndicatorView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C60EB442E43F4BE00D46E88 /* BugsnagPerformanceLoadingIndicatorView.mm */; };
8688
8A80DA8B2966CE940035BDA9 /* BugsnagPerformance.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72E4BB63359EA30E80116E2A /* BugsnagPerformance.framework */; };
8789
8A80DA912966CEB30035BDA9 /* ConfigurationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A80DA80296588840035BDA9 /* ConfigurationTests.swift */; };
8890
960EECF12B23DF9B009FAA11 /* BugsnagPerformanceTrackedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960EECED2B237561009FAA11 /* BugsnagPerformanceTrackedViewController.swift */; };
8991
960EECF32B24CA24009FAA11 /* BugsnagPerformanceTrackedViewContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 960EECF22B24C89A009FAA11 /* BugsnagPerformanceTrackedViewContainer.h */; settings = {ATTRIBUTES = (Public, ); }; };
9092
962CE7CE2E60766000380522 /* ViewLoadInstrumentationStateRepository.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE7CD2E60765C00380522 /* ViewLoadInstrumentationStateRepository.h */; };
9193
962CE7D02E60766E00380522 /* ViewLoadInstrumentationStateRepositoryImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE7CF2E60766800380522 /* ViewLoadInstrumentationStateRepositoryImpl.h */; };
9294
962CE7D32E60768400380522 /* ViewLoadInstrumentationStateRepositoryImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 962CE7D22E60768000380522 /* ViewLoadInstrumentationStateRepositoryImpl.mm */; };
95+
962CE7D52E60967A00380522 /* BugsnagPerformanceLoadingIndicatorView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE7D42E60967500380522 /* BugsnagPerformanceLoadingIndicatorView+Private.h */; };
9396
962CE7DD2E60987600380522 /* ViewLoadEarlyPhaseHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE7DC2E60986300380522 /* ViewLoadEarlyPhaseHandler.h */; };
9497
962CE7DF2E60988100380522 /* ViewLoadEarlyPhaseHandlerImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE7DE2E60987A00380522 /* ViewLoadEarlyPhaseHandlerImpl.h */; };
9598
962CE7E12E60988800380522 /* ViewLoadEarlyPhaseHandlerImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 962CE7E02E60988500380522 /* ViewLoadEarlyPhaseHandlerImpl.mm */; };
99+
962CE7E72E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 962CE7E62E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.mm */; };
100+
962CE7E82E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE7E52E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.h */; };
101+
962CE7E92E6123E700380522 /* ViewLoadLoadingIndicatorsHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE7E42E6123E700380522 /* ViewLoadLoadingIndicatorsHandler.h */; };
96102
962CE8042E6519D900380522 /* NetworkInstrumentationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE8032E6519CE00380522 /* NetworkInstrumentationState.h */; };
97103
962CE8062E6519E200380522 /* NetworkInstrumentationState.m in Sources */ = {isa = PBXBuildFile; fileRef = 962CE8052E6519DF00380522 /* NetworkInstrumentationState.m */; };
98104
962CE8082E651A0100380522 /* NetworkInstrumentationStateRepository.h in Headers */ = {isa = PBXBuildFile; fileRef = 962CE8072E6519F800380522 /* NetworkInstrumentationStateRepository.h */; };
@@ -426,6 +432,8 @@
426432
1C68DBA02E535D01002621D1 /* BugsnagPerformanceAppStartSpanQuery.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BugsnagPerformanceAppStartSpanQuery.mm; sourceTree = "<group>"; };
427433
1C68DBA22E535DEE002621D1 /* BugsnagPerformanceAppStartTypePlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagPerformanceAppStartTypePlugin.h; sourceTree = "<group>"; };
428434
1C68DBA42E535E1E002621D1 /* BugsnagPerformanceAppStartTypePlugin.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BugsnagPerformanceAppStartTypePlugin.mm; sourceTree = "<group>"; };
435+
1C3C0C602E2922000037B416 /* BugsnagPerformanceLoadingIndicatorView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagPerformanceLoadingIndicatorView.h; sourceTree = "<group>"; };
436+
1C60EB442E43F4BE00D46E88 /* BugsnagPerformanceLoadingIndicatorView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BugsnagPerformanceLoadingIndicatorView.mm; sourceTree = "<group>"; };
429437
72E4BB63359EA30E80116E2A /* BugsnagPerformance.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BugsnagPerformance.framework; sourceTree = BUILT_PRODUCTS_DIR; };
430438
8A80DA80296588840035BDA9 /* ConfigurationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationTests.swift; sourceTree = "<group>"; };
431439
8A80DA872966CE940035BDA9 /* BugsnagPerformance-iOSTestsSwift.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "BugsnagPerformance-iOSTestsSwift.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -434,9 +442,13 @@
434442
962CE7CD2E60765C00380522 /* ViewLoadInstrumentationStateRepository.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewLoadInstrumentationStateRepository.h; sourceTree = "<group>"; };
435443
962CE7CF2E60766800380522 /* ViewLoadInstrumentationStateRepositoryImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewLoadInstrumentationStateRepositoryImpl.h; sourceTree = "<group>"; };
436444
962CE7D22E60768000380522 /* ViewLoadInstrumentationStateRepositoryImpl.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewLoadInstrumentationStateRepositoryImpl.mm; sourceTree = "<group>"; };
445+
962CE7D42E60967500380522 /* BugsnagPerformanceLoadingIndicatorView+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagPerformanceLoadingIndicatorView+Private.h"; sourceTree = "<group>"; };
437446
962CE7DC2E60986300380522 /* ViewLoadEarlyPhaseHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewLoadEarlyPhaseHandler.h; sourceTree = "<group>"; };
438447
962CE7DE2E60987A00380522 /* ViewLoadEarlyPhaseHandlerImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewLoadEarlyPhaseHandlerImpl.h; sourceTree = "<group>"; };
439448
962CE7E02E60988500380522 /* ViewLoadEarlyPhaseHandlerImpl.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewLoadEarlyPhaseHandlerImpl.mm; sourceTree = "<group>"; };
449+
962CE7E42E6123E700380522 /* ViewLoadLoadingIndicatorsHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewLoadLoadingIndicatorsHandler.h; sourceTree = "<group>"; };
450+
962CE7E52E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewLoadLoadingIndicatorsHandlerImpl.h; sourceTree = "<group>"; };
451+
962CE7E62E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewLoadLoadingIndicatorsHandlerImpl.mm; sourceTree = "<group>"; };
440452
962CE8032E6519CE00380522 /* NetworkInstrumentationState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkInstrumentationState.h; sourceTree = "<group>"; };
441453
962CE8052E6519DF00380522 /* NetworkInstrumentationState.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NetworkInstrumentationState.m; sourceTree = "<group>"; };
442454
962CE8072E6519F800380522 /* NetworkInstrumentationStateRepository.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkInstrumentationStateRepository.h; sourceTree = "<group>"; };
@@ -711,6 +723,7 @@
711723
0122C21A29019770002D243C /* BugsnagPerformance.h */,
712724
0122C21929019770002D243C /* BugsnagPerformanceConfiguration.h */,
713725
CB0AD76929657381002A3FB6 /* BugsnagPerformanceErrors.h */,
726+
1C3C0C602E2922000037B416 /* BugsnagPerformanceLoadingIndicatorView.h */,
714727
0921F0292A67CBD600C764EB /* BugsnagPerformanceNetworkRequestInfo.h */,
715728
963726DB2DF0B43500C739E6 /* BugsnagPerformancePlugin.h */,
716729
963726DC2DF0B43500C739E6 /* BugsnagPerformancePluginContext.h */,
@@ -737,6 +750,7 @@
737750
0122C21D29019770002D243C /* BugsnagPerformance.mm */,
738751
0122C21C29019770002D243C /* BugsnagPerformanceConfiguration.mm */,
739752
CB0AD7672965734F002A3FB6 /* BugsnagPerformanceErrors.m */,
753+
1C60EB442E43F4BE00D46E88 /* BugsnagPerformanceLoadingIndicatorView.mm */,
740754
0921F02A2A67CBD600C764EB /* BugsnagPerformanceNetworkRequestInfo.m */,
741755
963726DF2DF0B4AD00C739E6 /* BugsnagPerformancePluginContext.m */,
742756
963726C72DEAB1FC00C739E6 /* BugsnagPerformancePriority.m */,
@@ -769,6 +783,7 @@
769783
CBE8EA15294B528100702950 /* BugsnagPerformanceImpl.mm */,
770784
CB78819B29E587CE00A58906 /* BugsnagPerformanceLibrary.h */,
771785
CB78819A29E587CE00A58906 /* BugsnagPerformanceLibrary.mm */,
786+
962CE7D42E60967500380522 /* BugsnagPerformanceLoadingIndicatorView+Private.h */,
772787
963726E12DF101DF00C739E6 /* BugsnagPerformancePluginContext+Private.h */,
773788
963726C92DEAB23E00C739E6 /* BugsnagPerformancePriority+Private.h */,
774789
963726CB2DEAB25200C739E6 /* BugsnagPerformancePriority+Private.m */,
@@ -1162,6 +1177,9 @@
11621177
963829402E5726D400404F3A /* ViewLoadLifecycleHandler.h */,
11631178
963829422E57536B00404F3A /* ViewLoadLifecycleHandlerImpl.h */,
11641179
963829442E57537600404F3A /* ViewLoadLifecycleHandlerImpl.mm */,
1180+
962CE7E42E6123E700380522 /* ViewLoadLoadingIndicatorsHandler.h */,
1181+
962CE7E52E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.h */,
1182+
962CE7E62E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.mm */,
11651183
);
11661184
path = Lifecycle;
11671185
sourceTree = "<group>";
@@ -1259,6 +1277,8 @@
12591277
962CE8352E67972300380522 /* NetworkSpanFactoryImpl.h in Headers */,
12601278
962CE7CE2E60766000380522 /* ViewLoadInstrumentationStateRepository.h in Headers */,
12611279
963726C12DEA4E5700C739E6 /* BugsnagPerformancePriority.h in Headers */,
1280+
962CE7E82E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.h in Headers */,
1281+
962CE7E92E6123E700380522 /* ViewLoadLoadingIndicatorsHandler.h in Headers */,
12621282
CB7FD930299D2EF200499E13 /* BugsnagPerformanceSpanOptions.h in Headers */,
12631283
965FBD152DF24D3300D6BACB /* Logging.h in Headers */,
12641284
9638292E2E56149100404F3A /* ViewLoadInstrumentationSystemUtils.h in Headers */,
@@ -1296,6 +1316,7 @@
12961316
962CE8282E67189800380522 /* NetworkEarlyPhaseHandlerImpl.h in Headers */,
12971317
09F23A8C2CE351ED00F0D769 /* BugsnagSwiftTools.h in Headers */,
12981318
0921F02B2A67CBD600C764EB /* BugsnagPerformanceNetworkRequestInfo.h in Headers */,
1319+
962CE7D52E60967A00380522 /* BugsnagPerformanceLoadingIndicatorView+Private.h in Headers */,
12991320
963726CA2DEAB24900C739E6 /* BugsnagPerformancePriority+Private.h in Headers */,
13001321
962CE7DF2E60988100380522 /* ViewLoadEarlyPhaseHandlerImpl.h in Headers */,
13011322
964B785F2D504FD800FF077D /* BugsnagPerformanceSpanCondition+Private.h in Headers */,
@@ -1354,6 +1375,7 @@
13541375
962CE80F2E6521F800380522 /* BSGURLSessionPerformanceDelegate.h in Headers */,
13551376
0122C24B29019770002D243C /* ViewLoadInstrumentation.h in Headers */,
13561377
963829382E5623F100404F3A /* ViewLoadSwizzlingHandlerImpl.h in Headers */,
1378+
1C3C0C612E2922080037B416 /* BugsnagPerformanceLoadingIndicatorView.h in Headers */,
13571379
CBEC51B8296D8386009C0CE3 /* Persistence.h in Headers */,
13581380
963829212E5542A700404F3A /* AppStartupInstrumentationStateSnapshot.h in Headers */,
13591381
9638291B2E54B48E00404F3A /* AppStartupLifecycleHandler.h in Headers */,
@@ -1739,6 +1761,7 @@
17391761
963726C82DEAB1FC00C739E6 /* BugsnagPerformancePriority.m in Sources */,
17401762
0122C23C29019770002D243C /* BugsnagPerformanceConfiguration.mm in Sources */,
17411763
963726D02DEAB36B00C739E6 /* BSGPrioritizedStore.mm in Sources */,
1764+
962CE7E72E6123E700380522 /* ViewLoadLoadingIndicatorsHandlerImpl.mm in Sources */,
17421765
CBEBE59229F2783C00BF0B4F /* Swizzle.mm in Sources */,
17431766
963726E82DF1DFD100C739E6 /* BSGPluginManager.m in Sources */,
17441767
962CE7E12E60988800380522 /* ViewLoadEarlyPhaseHandlerImpl.mm in Sources */,
@@ -1749,6 +1772,7 @@
17491772
962CE80C2E651A1600380522 /* NetworkInstrumentationStateRepositoryImpl.mm in Sources */,
17501773
CBEC51C1296DB312009C0CE3 /* JSON.mm in Sources */,
17511774
963726BF2DE8D99E00C739E6 /* BugsnagPerformanceSpanQuery.m in Sources */,
1775+
1C60EB452E43F4BE00D46E88 /* BugsnagPerformanceLoadingIndicatorView.mm in Sources */,
17521776
CBEBE59B29F671A800BF0B4F /* Instrumentation.mm in Sources */,
17531777
1C68DBA52E535E21002621D1 /* BugsnagPerformanceAppStartTypePlugin.mm in Sources */,
17541778
0986B7C02B287C9D00BD2CA3 /* WeakSpansList.mm in Sources */,

Sources/BugsnagPerformance/Private/BugsnagPerformanceImpl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#import <BugsnagPerformance/BugsnagPerformanceConfiguration.h>
1212
#import <BugsnagPerformance/BugsnagPerformanceViewType.h>
13+
#import <BugsnagPerformance/BugsnagPerformanceLoadingIndicatorView.h>
1314

1415
#import "BugsnagPerformanceSpan+Private.h"
1516
#import "OtlpUploader.h"
@@ -84,6 +85,8 @@ class BugsnagPerformanceImpl: public PhasedStartup {
8485
return [spanControlProvider_ getSpanControlsWithQuery:query];
8586
}
8687

88+
void loadingIndicatorWasAdded(BugsnagPerformanceLoadingIndicatorView *loadingViewIndicator) noexcept;
89+
8790
private:
8891
std::shared_ptr<Persistence> persistence_;
8992
std::shared_ptr<PersistentState> persistentState_;

Sources/BugsnagPerformance/Private/BugsnagPerformanceImpl.mm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,11 @@
446446
}
447447
}
448448

449+
void BugsnagPerformanceImpl::loadingIndicatorWasAdded(BugsnagPerformanceLoadingIndicatorView *loadingViewIndicator) noexcept {
450+
this->instrumentation_->loadingIndicatorWasAdded(loadingViewIndicator);
451+
}
452+
453+
449454
void BugsnagPerformanceImpl::onWorkInterval() noexcept {
450455
BSGLogTrace(@"BugsnagPerformanceImpl::onWorkInterval()");
451456
batch_->allowDrain();
@@ -610,7 +615,7 @@
610615

611616
BugsnagPerformanceSpan *BugsnagPerformanceImpl::startViewLoadPhaseSpan(NSString *className, NSString *phase,
612617
BugsnagPerformanceSpanContext *parentContext) noexcept {
613-
auto span = tracer_->startViewLoadPhaseSpan(className, phase, parentContext);
618+
auto span = tracer_->startViewLoadPhaseSpan(className, phase, parentContext, @[]);
614619
[span internalSetMultipleAttributes:spanAttributesProvider_->viewLoadPhaseSpanAttributes(className, phase)];
615620
return span;
616621
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// BugsnagPerformanceLoadingIndicatorView+Private.h
3+
// BugsnagPerformance
4+
//
5+
// Created by Robert Bartoszewski on 28/08/2025.
6+
// Copyright © 2025 Bugsnag. All rights reserved.
7+
//
8+
9+
#import <BugsnagPerformance/BugsnagPerformanceSpanCondition.h>
10+
#import <BugsnagPerformance/BugsnagPerformanceLoadingIndicatorView.h>
11+
12+
@interface BugsnagPerformanceLoadingIndicatorView()
13+
14+
- (void)addCondition:(BugsnagPerformanceSpanCondition *)condition;
15+
- (void)addConditions:(NSArray<BugsnagPerformanceSpanCondition *> *)conditions;
16+
- (void)closeAllConditions;
17+
18+
@end

Sources/BugsnagPerformance/Private/Instrumentation/Instrumentation.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#pragma once
1010

11+
#import <BugsnagPerformance/BugsnagPerformanceLoadingIndicatorView.h>
12+
1113
#import "../PhasedStartup.h"
1214
#import "AppStartupInstrumentation/AppStartupInstrumentation.h"
1315
#import "NetworkInstrumentation/NetworkInstrumentation.h"
@@ -50,6 +52,8 @@ class Instrumentation: public PhasedStartup {
5052
CFAbsoluteTime appStartDuration() noexcept { return appStartupInstrumentation_->appStartDuration(); }
5153
CFAbsoluteTime timeSinceAppFirstBecameActive() noexcept { return appStartupInstrumentation_->timeSinceAppFirstBecameActive(); }
5254

55+
void loadingIndicatorWasAdded(BugsnagPerformanceLoadingIndicatorView *loadingViewIndicator) noexcept { viewLoadInstrumentation_->loadingIndicatorWasAdded(loadingViewIndicator); }
56+
5357
private:
5458
Instrumentation() = delete;
5559

Sources/BugsnagPerformance/Private/Instrumentation/Instrumentation.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#import "ViewLoadInstrumentation/State/ViewLoadInstrumentationStateRepositoryImpl.h"
1515
#import "ViewLoadInstrumentation/Lifecycle/ViewLoadLifecycleHandlerImpl.h"
1616
#import "ViewLoadInstrumentation/Lifecycle/ViewLoadEarlyPhaseHandlerImpl.h"
17+
#import "ViewLoadInstrumentation/Lifecycle/ViewLoadLoadingIndicatorsHandlerImpl.h"
1718
#import "NetworkInstrumentation/State/NetworkInstrumentationStateRepositoryImpl.h"
1819
#import "NetworkInstrumentation/System/BSGURLSessionPerformanceDelegate.h"
1920
#import "NetworkInstrumentation/System/NetworkInstrumentationSystemUtilsImpl.h"
@@ -67,10 +68,12 @@
6768
auto spanFactory = std::make_shared<ViewLoadSpanFactoryImpl>(tracer, spanAttributesProvider);
6869
auto repository = std::make_shared<ViewLoadInstrumentationStateRepositoryImpl>();
6970
auto earlyPhaseHandler = std::make_shared<ViewLoadEarlyPhaseHandlerImpl>(tracer);
71+
auto loadingIndicatorsHandler = std::make_shared<ViewLoadLoadingIndicatorsHandlerImpl>(repository);
7072
auto lifecycleHandler = std::make_shared<ViewLoadLifecycleHandlerImpl>(earlyPhaseHandler,
7173
spanAttributesProvider,
7274
spanFactory,
7375
repository,
76+
loadingIndicatorsHandler,
7477
[BugsnagPerformanceCrossTalkAPI sharedInstance]);
7578

7679
return std::make_shared<ViewLoadInstrumentation>(systemUtils, swizzlingHandler, lifecycleHandler);

Sources/BugsnagPerformance/Private/Instrumentation/ViewLoadInstrumentation/Lifecycle/ViewLoadLifecycleHandler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#import <UIKit/UIKit.h>
1010
#import <BugsnagPerformance/BugsnagPerformanceConfiguration.h>
11+
#import <BugsnagPerformance/BugsnagPerformanceLoadingIndicatorView.h>
1112
#import "../State/ViewLoadInstrumentationState.h"
1213
#import "../System/ViewLoadSwizzlingCallbacks.h"
1314

@@ -28,6 +29,7 @@ class ViewLoadLifecycleHandler {
2829
ViewLoadSwizzlingOriginalImplementationCallback originalImplementation) noexcept = 0;
2930
virtual void onViewDidLayoutSubviews(UIViewController *viewController,
3031
ViewLoadSwizzlingOriginalImplementationCallback originalImplementation) noexcept = 0;
32+
virtual void onLoadingIndicatorWasAdded(BugsnagPerformanceLoadingIndicatorView *loadingIndicator) noexcept = 0;
3133
virtual ~ViewLoadLifecycleHandler() {}
3234
};
3335
}

0 commit comments

Comments
 (0)