Skip to content

Commit 3c60fbd

Browse files
authored
update docs to reference swift > objc (#9279)
1 parent 8b0f760 commit 3c60fbd

29 files changed

+139
-166
lines changed

Crashlytics/Crashlytics/Components/FIRCLSApplication.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ NSString* FIRCLSApplicationGetSDKBundleID(void);
4848
NSString* FIRCLSApplicationGetPlatform(void);
4949

5050
/**
51-
* Returns the Operating System for filtering. Should be kept consistent with Analytics.
51+
* Returns the operating system for filtering. Should be kept consistent with Analytics.
5252
*/
5353
NSString* FIRCLSApplicationGetFirebasePlatform(void);
5454

Crashlytics/Crashlytics/Controllers/FIRCLSExistingReportManager.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ FOUNDATION_EXPORT NSUInteger const FIRCLSMaxUnsentReports;
3434
* been cleared for upload, so there isn't any point in asking for permission
3535
* or possibly spamming end-users if a report gets stuck.
3636
*
37-
* The tricky part is, customers will NOT be alerted in checkForUnsentReports
38-
* for reports in these paths, but when they choose sendUnsentReports / enable data
37+
* The tricky part is, customers will NOT be alerted in `checkForUnsentReports`
38+
* for reports in these paths, but when they choose `sendUnsentReports` / enable data
3939
* collection, reports in those directories will be re-managed. This should be ok and
4040
* just an edge case because reports should only be in processing or prepared for a split second as
4141
* they do on-device symbolication and get converted into a GDTEvent. After a report is handed off
@@ -44,10 +44,10 @@ FOUNDATION_EXPORT NSUInteger const FIRCLSMaxUnsentReports;
4444
@property(nonatomic, readonly) NSUInteger unsentReportsCount;
4545

4646
/**
47-
* This value needs to stay in sync with numUnsentReports, so if there is > 0 numUnsentReports,
48-
* newestUnsentReport needs to return a value. Otherwise it needs to return null.
47+
* This value needs to stay in sync with `numUnsentReports`, so if there is > 0 `numUnsentReports`,
48+
* `newestUnsentReport` needs to return a value. Otherwise it needs to return nil.
4949
*
50-
* FIRCLSContext needs to be initialized before the FIRCrashlyticsReport is instantiated.
50+
* `FIRCLSContext` needs to be initialized before the `CrashlyticsReport` is instantiated.
5151
*/
5252
@property(nonatomic, readonly) FIRCrashlyticsReport *_Nullable newestUnsentReport;
5353

@@ -60,7 +60,7 @@ FOUNDATION_EXPORT NSUInteger const FIRCLSMaxUnsentReports;
6060
/**
6161
* This is important to call once, early in startup, before the
6262
* new report for this run of the app has been created. Any
63-
* reports in ExistingReportManager will be uploaded or deleted
63+
* reports in `ExistingReportManager` will be uploaded or deleted
6464
* and we don't want to do that for the current run of the app.
6565
*
6666
* If there are over MAX_UNSENT_REPORTS valid reports, this will delete them.
@@ -70,7 +70,7 @@ FOUNDATION_EXPORT NSUInteger const FIRCLSMaxUnsentReports;
7070
- (void)collectExistingReports;
7171

7272
/**
73-
* This is the side-effect of calling deleteUnsentReports, or collect_reports setting
73+
* This is the side-effect of calling `deleteUnsentReports`, or collect_reports setting
7474
* being false.
7575
*/
7676
- (void)deleteUnsentReports;

Crashlytics/Crashlytics/Controllers/FIRCLSManagerData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ NS_ASSUME_NONNULL_BEGIN
2828
@protocol FIRAnalyticsInterop;
2929

3030
/*
31-
* Manager Data's purpose is to simplify the adding and removing of
31+
* FIRCLSManagerData's purpose is to simplify the adding and removing of
3232
* dependencies from each of the Manager classes so that it's easier
3333
* to inject mock classes during testing. A lot of the Manager classes
3434
* share these dependencies, but don't use all of them.
3535
*
3636
* If you plan on adding interdependencies between Managers, do not add a pointer
3737
* to the dependency here. Instead add them as a new value to the constructor of
38-
* the Manager, and construct them in FIRCrashlytics. This data structure should
38+
* the Manager, and construct them in FirebaseCrashlytics. This data structure should
3939
* be for Models and other SDKs / Interops Crashlytics depends on.
4040
*/
4141
@interface FIRCLSManagerData : NSObject

Crashlytics/Crashlytics/Controllers/FIRCLSReportManager.m

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
#endif
7676

7777
/**
78-
* A FIRReportAction is used to indicate how to handle unsent reports.
78+
* A FirebaseReportAction is used to indicate how to handle unsent reports.
7979
*/
8080
typedef NS_ENUM(NSInteger, FIRCLSReportAction) {
8181
/** Upload the reports to Crashlytics. */
@@ -85,7 +85,7 @@ typedef NS_ENUM(NSInteger, FIRCLSReportAction) {
8585
};
8686

8787
/**
88-
* This is just a helper to make code using FIRReportAction more readable.
88+
* This is just a helper to make code using FirebaseReportAction more readable.
8989
*/
9090
typedef NSNumber FIRCLSWrappedReportAction;
9191
@implementation NSNumber (FIRCLSWrappedReportAction)
@@ -203,10 +203,9 @@ - (instancetype)initWithManagerData:(FIRCLSManagerData *)managerData
203203
return self;
204204
}
205205

206-
// This method returns a promise that is resolved with a wrapped FIRReportAction once the user has
207-
// indicated whether they want to upload currently cached reports.
208-
// This method should only be called when we have determined there is at least 1 unsent report.
209-
// This method waits until either:
206+
// This method returns a promise that is resolved with a wrapped FirebaseReportAction once the user
207+
// has indicated whether they want to upload currently cached reports. This method should only be
208+
// called when we have determined there is at least 1 unsent report. This method waits until either:
210209
// 1. Data collection becomes enabled, in which case, the promise will be resolved with Send.
211210
// 2. The developer uses the processCrashReports API to indicate whether the report
212211
// should be sent or deleted, at which point the promise will be resolved with the action.

Crashlytics/Crashlytics/DataCollection/FIRCLSDataCollectionToken.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ NS_ASSUME_NONNULL_BEGIN
3535
+ (instancetype)validToken;
3636

3737
/**
38-
* Use this to verify that a token is valid. If this is called on a nil instance, it will return NO.
39-
* @return YES.
38+
* Use this to verify that a token is valid. If this is called on a nil instance, it will return
39+
* false.
40+
* @return true.
4041
*/
4142
- (BOOL)isValid;
4243

Crashlytics/Crashlytics/FIRCLSUserDefaults/FIRCLSUserDefaults.m

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
NSString *const FIRCLSUserDefaultsPathComponent = @"CLSUserDefaults";
3333

3434
/**
35-
* This class is an isolated re-implementation of NSUserDefaults which isolates our storage
35+
* This class is an isolated re-implementation of UserDefaults which isolates our storage
3636
* from that of our customers. This solves a number of issues we have seen in production, firstly
37-
* that customers often delete or clear NSUserDefaults, unintentionally deleting our data.
38-
* Further, we have seen thread safety issues in production with NSUserDefaults, as well as a number
39-
* of bugs related to accessing NSUserDefaults before the device has been unlocked due to the
40-
* NSFileProtection of NSUserDefaults.
37+
* that customers often delete or clear UserDefaults, unintentionally deleting our data.
38+
* Further, we have seen thread safety issues in production with UserDefaults, as well as a number
39+
* of bugs related to accessing UserDefaults before the device has been unlocked due to the
40+
* FileProtection of UserDefaults.
4141
*/
4242
@interface FIRCLSUserDefaults ()
4343
@property(nonatomic, readwrite) BOOL synchronizeWroteToDisk;
@@ -308,13 +308,13 @@ - (NSDictionary *)loadDefaults {
308308

309309
#pragma mark - migration
310310

311-
// This method migrates all keys specified from NSUserDefaults to FIRCLSUserDefaults
311+
// This method migrates all keys specified from UserDefaults to FIRCLSUserDefaults
312312
// To do so, we copy all known key-value pairs into FIRCLSUserDefaults, synchronize it, then
313-
// remove the keys from NSUserDefaults and synchronize it.
313+
// remove the keys from UserDefaults and synchronize it.
314314
- (void)migrateFromNSUserDefaults:(NSArray *)keysToMigrate {
315315
BOOL didFindKeys = NO;
316316

317-
// First, copy all of the keysToMigrate which are stored NSUserDefaults
317+
// First, copy all of the keysToMigrate which are stored UserDefaults
318318
for (NSString *key in keysToMigrate) {
319319
id oldValue = [[NSUserDefaults standardUserDefaults] objectForKey:(NSString *)key];
320320
if (nil != oldValue) {
@@ -324,22 +324,22 @@ - (void)migrateFromNSUserDefaults:(NSArray *)keysToMigrate {
324324
}
325325

326326
if (didFindKeys) {
327-
// First synchronize FIRCLSUserDefaults such that all keysToMigrate in NSUserDefaults are stored
327+
// First synchronize FIRCLSUserDefaults such that all keysToMigrate in UserDefaults are stored
328328
// in FIRCLSUserDefaults. At this point, data is duplicated.
329329
[[FIRCLSUserDefaults standardUserDefaults] synchronize];
330330

331331
for (NSString *key in keysToMigrate) {
332332
[[NSUserDefaults standardUserDefaults] removeObjectForKey:(NSString *)key];
333333
}
334334

335-
// This should be our last interaction with NSUserDefaults. All data is migrated into
335+
// This should be our last interaction with UserDefaults. All data is migrated into
336336
// FIRCLSUserDefaults
337337
[[NSUserDefaults standardUserDefaults] synchronize];
338338
}
339339
}
340340

341341
// This method first queries FIRCLSUserDefaults to see if the key exist, and upon failure,
342-
// searches for the key in NSUserDefaults, and migrates it if found.
342+
// searches for the key in UserDefaults, and migrates it if found.
343343
- (id)objectForKeyByMigratingFromNSUserDefaults:(NSString *)keyToMigrateOrNil {
344344
if (!keyToMigrateOrNil) {
345345
return nil;
@@ -353,10 +353,10 @@ - (id)objectForKeyByMigratingFromNSUserDefaults:(NSString *)keyToMigrateOrNil {
353353
id oldNSUserDefaultsValue =
354354
[[NSUserDefaults standardUserDefaults] objectForKey:keyToMigrateOrNil];
355355
if (!oldNSUserDefaultsValue) {
356-
return nil; // if the value also does not exist in NSUserDefaults, return nil.
356+
return nil; // if the value also does not exist in UserDefaults, return nil.
357357
}
358358

359-
// Otherwise, the key exists in NSUserDefaults. Migrate it to FIRCLSUserDefaults
359+
// Otherwise, the key exists in UserDefaults. Migrate it to FIRCLSUserDefaults
360360
// and then return the associated value.
361361

362362
// First store it in FIRCLSUserDefaults so in the event of a crash, data is not lost.

Crashlytics/Crashlytics/Helpers/FIRCLSCallStackTree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#import <MetricKit/MetricKit.h>
2424

2525
/*
26-
* Helper class for parsing the MXCallStackTree that we receive from MetricKit. Flattens the
26+
* Helper class for parsing the `MXCallStackTree` that we receive from MetricKit. Flattens the
2727
* nested structure into a structure similar to what is used in Crashlytics.
2828
*/
2929
@interface FIRCLSCallStackTree : NSObject

Crashlytics/Crashlytics/Helpers/FIRCLSUtility.m

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,6 @@ bool FIRCLSUnlinkIfExists(const char* path) {
136136
return true;
137137
}
138138

139-
/*
140-
NSString* FIRCLSGenerateUUID(void) {
141-
NSString* string;
142-
143-
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
144-
string = CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, uuid));
145-
CFRelease(uuid);
146-
147-
return string;
148-
}
149-
*/
150-
151139
NSString* FIRCLSNormalizeUUID(NSString* value) {
152140
return [[value stringByReplacingOccurrencesOfString:@"-" withString:@""] lowercaseString];
153141
}
@@ -213,21 +201,6 @@ void FIRCLSRedactUUID(char* value) {
213201
return string;
214202
}
215203

216-
/*
217-
NSString* FIRCLSHashBytes(const void* bytes, size_t length) {
218-
uint8_t digest[CC_SHA1_DIGEST_LENGTH] = {0};
219-
CC_SHA1(bytes, (CC_LONG)length, digest);
220-
221-
NSData* result = [NSData dataWithBytes:digest length:CC_SHA1_DIGEST_LENGTH];
222-
223-
return FIRCLSNSDataToNSString(result);
224-
}
225-
226-
NSString* FIRCLSHashNSData(NSData* data) {
227-
return FIRCLSHashBytes([data bytes], [data length]);
228-
}
229-
*/
230-
231204
void FIRCLSAddOperationAfter(float timeInSeconds, NSOperationQueue* queue, void (^block)(void)) {
232205
dispatch_queue_t afterQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
233206
FIRCLSDispatchAfter(timeInSeconds, afterQueue, ^{

Crashlytics/Crashlytics/Models/FIRCLSInternalReport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ extern NSString *const FIRCLSReportUserCompactedKVFile;
7474
@property(nonatomic, copy, readonly) NSString *installID;
7575

7676
/**
77-
* Returns YES if report contains a signal, mach exception or unhandled exception record, NO
77+
* Returns true if report contains a signal, mach exception or unhandled exception record, false
7878
* otherwise.
7979
**/
8080
@property(nonatomic, assign, readonly) BOOL isCrash;

Crashlytics/Crashlytics/Models/Record/FIRCLSRecordBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@interface FIRCLSRecordBase : NSObject
2626

2727
/**
28-
* Mark the default initializer as unavailable so the subclasses do not have to add the same line
28+
* Mark the default initializer as unavailable so the subclasses do not have to add the same line
2929
**/
3030
- (instancetype)init NS_UNAVAILABLE;
3131

0 commit comments

Comments
 (0)