Skip to content

Commit 0b0a346

Browse files
committed
ref: Convert SentryUIDevice to Swift
1 parent 3ec47ae commit 0b0a346

14 files changed

+122
-155
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
0A9E917128DC7E7000FB4182 /* SentryInternalCDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A9E917028DC7E7000FB4182 /* SentryInternalCDefines.h */; };
5151
0AAE201E28ED9B9400D0CD80 /* SentryReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AAE201D28ED9B9400D0CD80 /* SentryReachability.m */; };
5252
0AAE202128ED9BCC00D0CD80 /* SentryReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AAE202028ED9BCC00D0CD80 /* SentryReachability.h */; };
53-
0ADC33EC28D9BB780078D980 /* SentryUIDeviceWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ADC33EB28D9BB780078D980 /* SentryUIDeviceWrapper.m */; };
54-
0ADC33EE28D9BB890078D980 /* SentryUIDeviceWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0ADC33ED28D9BB890078D980 /* SentryUIDeviceWrapper.h */; };
5553
0ADC33F128D9BE940078D980 /* TestSentryUIDeviceWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ADC33EF28D9BE690078D980 /* TestSentryUIDeviceWrapper.swift */; };
5654
0AE455AD28F584D2006680E5 /* SentryReachabilityTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AE455AC28F584D2006680E5 /* SentryReachabilityTests.m */; };
5755
15360CCF2432777500112302 /* SentrySessionTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 15360CCE2432777400112302 /* SentrySessionTracker.m */; };
@@ -1110,6 +1108,7 @@
11101108
FA8E58F12E0AD4270049F69D /* SentryDispatchQueueWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8E58F02E0AD4220049F69D /* SentryDispatchQueueWrapper.swift */; };
11111109
FA90FAA82E06614E008CAAE8 /* SentryExtraPackages.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */; };
11121110
FA90FAFD2E070A3B008CAAE8 /* SentryURLRequestFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90FAFC2E070A3B008CAAE8 /* SentryURLRequestFactory.swift */; };
1111+
FAAB2F972E4D345800FE8B7E /* SentryUIDeviceWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAAB2F962E4D344F00FE8B7E /* SentryUIDeviceWrapper.swift */; };
11131112
FAB359982E05D7E90083D5E3 /* SentryEventSwiftHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FAB359972E05D7E90083D5E3 /* SentryEventSwiftHelper.h */; };
11141113
FAB3599A2E05D8080083D5E3 /* SentryEventSwiftHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB359992E05D8080083D5E3 /* SentryEventSwiftHelper.m */; };
11151114
FAB7BBA92E2577A6007301E1 /* SentryModels+Serializable.h in Headers */ = {isa = PBXBuildFile; fileRef = FAB7BBA82E2577A2007301E1 /* SentryModels+Serializable.h */; };
@@ -1285,8 +1284,6 @@
12851284
0A9E917028DC7E7000FB4182 /* SentryInternalCDefines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryInternalCDefines.h; path = include/SentryInternalCDefines.h; sourceTree = "<group>"; };
12861285
0AAE201D28ED9B9400D0CD80 /* SentryReachability.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryReachability.m; sourceTree = "<group>"; };
12871286
0AAE202028ED9BCC00D0CD80 /* SentryReachability.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryReachability.h; path = include/SentryReachability.h; sourceTree = "<group>"; };
1288-
0ADC33EB28D9BB780078D980 /* SentryUIDeviceWrapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryUIDeviceWrapper.m; sourceTree = "<group>"; };
1289-
0ADC33ED28D9BB890078D980 /* SentryUIDeviceWrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryUIDeviceWrapper.h; path = include/SentryUIDeviceWrapper.h; sourceTree = "<group>"; };
12901287
0ADC33EF28D9BE690078D980 /* TestSentryUIDeviceWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryUIDeviceWrapper.swift; sourceTree = "<group>"; };
12911288
0AE455AC28F584D2006680E5 /* SentryReachabilityTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryReachabilityTests.m; sourceTree = "<group>"; };
12921289
15360CCE2432777400112302 /* SentrySessionTracker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentrySessionTracker.m; sourceTree = "<group>"; };
@@ -2455,6 +2452,7 @@
24552452
FA8E58F02E0AD4220049F69D /* SentryDispatchQueueWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryDispatchQueueWrapper.swift; sourceTree = "<group>"; };
24562453
FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraPackages.swift; sourceTree = "<group>"; };
24572454
FA90FAFC2E070A3B008CAAE8 /* SentryURLRequestFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryURLRequestFactory.swift; sourceTree = "<group>"; };
2455+
FAAB2F962E4D344F00FE8B7E /* SentryUIDeviceWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUIDeviceWrapper.swift; sourceTree = "<group>"; };
24582456
FAB359972E05D7E90083D5E3 /* SentryEventSwiftHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryEventSwiftHelper.h; path = include/SentryEventSwiftHelper.h; sourceTree = "<group>"; };
24592457
FAB359992E05D8080083D5E3 /* SentryEventSwiftHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryEventSwiftHelper.m; sourceTree = "<group>"; };
24602458
FAB7BBA82E2577A2007301E1 /* SentryModels+Serializable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryModels+Serializable.h"; path = "include/SentryModels+Serializable.h"; sourceTree = "<group>"; };
@@ -2842,8 +2840,6 @@
28422840
7B7D873524864C9D00D2ECFF /* SentryCrashDefaultMachineContextWrapper.m */,
28432841
7B7A30C524B48321005A4C6E /* SentryCrashWrapper.h */,
28442842
7B7A30C724B48389005A4C6E /* SentryCrashWrapper.m */,
2845-
0ADC33ED28D9BB890078D980 /* SentryUIDeviceWrapper.h */,
2846-
0ADC33EB28D9BB780078D980 /* SentryUIDeviceWrapper.m */,
28472843
62C97D372CC64E4900DDA204 /* SentryUncaughtNSExceptions.h */,
28482844
62C97D392CC64E6B00DDA204 /* SentryUncaughtNSExceptions.m */,
28492845
);
@@ -4760,6 +4756,7 @@
47604756
FA67DCCC2DDBD4EA00896B02 /* Helper */ = {
47614757
isa = PBXGroup;
47624758
children = (
4759+
FAAB2F962E4D344F00FE8B7E /* SentryUIDeviceWrapper.swift */,
47634760
FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */,
47644761
FA67DCC82DDBD4EA00896B02 /* Log */,
47654762
FA67DCC92DDBD4EA00896B02 /* SentryBaggageSerialization.swift */,
@@ -4883,7 +4880,6 @@
48834880
92E5F3D62CDBB3BF00B7AD98 /* SentrySampling.h in Headers */,
48844881
92672BB629C9A2A9006B021C /* SentryBreadcrumb+Private.h in Headers */,
48854882
03BCC38E27E2A377003232C7 /* SentryProfilingConditionals.h in Headers */,
4886-
0ADC33EE28D9BB890078D980 /* SentryUIDeviceWrapper.h in Headers */,
48874883
848A451A2BBF8D33006AAAEC /* SentryContinuousProfiler.h in Headers */,
48884884
8E133FA625E72EB400ABD0BF /* SentrySamplingContext.h in Headers */,
48894885
0A9BF4E428A114B50068D266 /* SentryViewHierarchyIntegration.h in Headers */,
@@ -5586,6 +5582,7 @@
55865582
7BDB03BB2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m in Sources */,
55875583
FA6FC0A32E0B5ACE00ED2669 /* SentrySdkPackage.swift in Sources */,
55885584
D8739D142BEE5049007D2F66 /* SentryRRWebSpanEvent.swift in Sources */,
5585+
FAAB2F972E4D345800FE8B7E /* SentryUIDeviceWrapper.swift in Sources */,
55895586
7B6C5EDE264E8DF00010D138 /* SentryFramesTracker.m in Sources */,
55905587
D84F833E2A1CC401005828E0 /* SentrySwiftAsyncIntegration.m in Sources */,
55915588
7B6438AB26A70F24000D0F65 /* UIViewController+Sentry.m in Sources */,
@@ -5714,7 +5711,6 @@
57145711
63FE70D720DA4C1000CDBAE8 /* SentryCrashMonitor_MachException.c in Sources */,
57155712
7B96572226830D2400C66E25 /* SentryScopeSyncC.c in Sources */,
57165713
0A9BF4E228A114940068D266 /* SentryViewHierarchyIntegration.m in Sources */,
5717-
0ADC33EC28D9BB780078D980 /* SentryUIDeviceWrapper.m in Sources */,
57185714
7BBD188B244841FB00427C76 /* SentryHttpDateParser.m in Sources */,
57195715
D8AFC03D2BDA79BF00118BE1 /* SentryReplayVideoMaker.swift in Sources */,
57205716
840A11122B61E27500650D02 /* SentrySamplerDecision.m in Sources */,

SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# import "SentryAppStartTracker.h"
1111
# import "SentryDisplayLinkWrapper.h"
1212
# import "SentryFramesTracker+TestInit.h"
13-
# import "SentryUIDeviceWrapper.h"
1413
# import "SentryUIViewControllerPerformanceTracker.h"
1514
#endif // SENTRY_HAS_UIKIT
1615

Sources/Sentry/SentryCrashWrapper.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#import "SentryNSProcessInfoWrapper.h"
88
#import "SentryScope+PrivateSwift.h"
99
#import "SentryScope.h"
10-
#import "SentryUIDeviceWrapper.h"
10+
#import "SentrySwift.h"
1111
#import <SentryCrashCachedData.h>
1212
#import <SentryCrashDebug.h>
1313
#import <SentryCrashMonitor_System.h>

Sources/Sentry/SentryDependencyContainer.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#import "SentrySwift.h"
2121
#import "SentrySystemWrapper.h"
2222
#import "SentryThreadInspector.h"
23-
#import "SentryUIDeviceWrapper.h"
2423
#import <SentryAppStateManager.h>
2524
#import <SentryCrash.h>
2625
#import <SentryCrashWrapper.h>
@@ -49,10 +48,6 @@
4948
# import <SentryWatchdogTerminationBreadcrumbProcessor.h>
5049
#endif // SENTRY_HAS_UIKIT
5150

52-
#if TARGET_OS_IOS
53-
# import "SentryUIDeviceWrapper.h"
54-
#endif // TARGET_OS_IOS
55-
5651
#if TARGET_OS_OSX
5752
# import "SentryNSApplication.h"
5853
#endif
@@ -168,7 +163,7 @@ - (instancetype)init
168163

169164
_notificationCenterWrapper = [NSNotificationCenter defaultCenter];
170165
#if SENTRY_HAS_UIKIT
171-
_uiDeviceWrapper = [[SentryUIDeviceWrapper alloc] init];
166+
_uiDeviceWrapper = [[DefaultSentryUIDeviceWrapper alloc] init];
172167
_application = [[SentryUIApplication alloc]
173168
initWithNotificationCenterWrapper:_notificationCenterWrapper
174169
dispatchQueueWrapper:_dispatchQueueWrapper];

Sources/Sentry/SentryExtraContextProvider.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66

77
@class SentryCrashWrapper;
88
@class SentryNSProcessInfoWrapper;
9-
@class SentryUIDeviceWrapper;
10-
11-
#if TARGET_OS_IOS && SENTRY_HAS_UIKIT
12-
@class SentryUIDeviceWrapper;
13-
#endif // TARGET_OS_IOS && SENTRY_HAS_UIKIT
9+
@protocol SentryUIDeviceWrapper;
1410

1511
NS_ASSUME_NONNULL_BEGIN
1612

@@ -23,7 +19,7 @@ SENTRY_NO_INIT
2319
- (instancetype)initWithCrashWrapper:(SentryCrashWrapper *)crashWrapper
2420
processInfoWrapper:(SentryNSProcessInfoWrapper *)processInfoWrapper
2521
#if TARGET_OS_IOS && SENTRY_HAS_UIKIT
26-
deviceWrapper:(SentryUIDeviceWrapper *)deviceWrapper
22+
deviceWrapper:(id<SentryUIDeviceWrapper>)deviceWrapper
2723
#endif // TARGET_OS_IOS && SENTRY_HAS_UIKIT
2824
;
2925

Sources/Sentry/SentryExtraContextProvider.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#import "SentryCrashWrapper.h"
44
#import "SentryLogC.h"
55
#import "SentryNSProcessInfoWrapper.h"
6-
#import "SentryUIDeviceWrapper.h"
6+
#import "SentrySwift.h"
77

88
NSString *const kSentryProcessInfoThermalStateNominal = @"nominal";
99
NSString *const kSentryProcessInfoThermalStateFair = @"fair";
@@ -16,7 +16,7 @@ @interface SentryExtraContextProvider ()
1616
@property (nonatomic, strong) SentryNSProcessInfoWrapper *processInfoWrapper;
1717

1818
#if TARGET_OS_IOS && SENTRY_HAS_UIKIT
19-
@property (nonatomic, strong) SentryUIDeviceWrapper *deviceWrapper;
19+
@property (nonatomic, strong) id<SentryUIDeviceWrapper> deviceWrapper;
2020
#endif // TARGET_OS_IOS && SENTRY_HAS_UIKIT
2121

2222
@end
@@ -26,7 +26,7 @@ @implementation SentryExtraContextProvider
2626
- (instancetype)initWithCrashWrapper:(id)crashWrapper
2727
processInfoWrapper:(id)processInfoWrapper
2828
#if TARGET_OS_IOS && SENTRY_HAS_UIKIT
29-
deviceWrapper:(SentryUIDeviceWrapper *)deviceWrapper
29+
deviceWrapper:(id<SentryUIDeviceWrapper>)deviceWrapper
3030
#endif // TARGET_OS_IOS && SENTRY_HAS_UIKIT
3131
{
3232
if (self = [super init]) {

Sources/Sentry/SentrySDKInternal.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#endif // TARGET_OS_MAC
3535

3636
#if SENTRY_HAS_UIKIT
37-
# import "SentryUIDeviceWrapper.h"
3837
# import "SentryUIViewControllerPerformanceTracker.h"
3938
# if TARGET_OS_IOS
4039
# import "SentryFeedbackAPI.h"

Sources/Sentry/SentryUIDeviceWrapper.m

Lines changed: 0 additions & 91 deletions
This file was deleted.

Sources/Sentry/include/HybridPublic/SentryDependencyContainer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#endif // SENTRY_UIKIT_AVAILABLE
5252

5353
#if SENTRY_HAS_UIKIT
54-
@class SentryUIDeviceWrapper;
54+
@protocol SentryUIDeviceWrapper;
5555
#endif // TARGET_OS_IOS
5656

5757
#if !TARGET_OS_WATCH
@@ -100,7 +100,7 @@ SENTRY_NO_INIT
100100
#endif // !TARGET_OS_WATCH
101101

102102
#if SENTRY_HAS_UIKIT
103-
@property (nonatomic, strong) SentryUIDeviceWrapper *uiDeviceWrapper;
103+
@property (nonatomic, strong) id<SentryUIDeviceWrapper> uiDeviceWrapper;
104104
#endif // TARGET_OS_IOS
105105

106106
#pragma mark - Lazy Dependencies

Sources/Sentry/include/SentryUIDeviceWrapper.h

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)