Skip to content

Commit 9151fa6

Browse files
authored
Update Core's docs to be Swift first. (#9458)
1 parent 33a7467 commit 9151fa6

File tree

4 files changed

+26
-25
lines changed

4 files changed

+26
-25
lines changed

FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,21 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success) NS_SWIFT_NAME(FirebaseAppVo
2626
/**
2727
* The entry point of Firebase SDKs.
2828
*
29-
* Initialize and configure FIRApp using +[FIRApp configure]
29+
* Initialize and configure `FirebaseApp` using `FirebaseApp.configure()`
3030
* or other customized ways as shown below.
3131
*
3232
* The logging system has two modes: default mode and debug mode. In default mode, only logs with
3333
* log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent
3434
* to device. The log levels that Firebase uses are consistent with the ASL log levels.
3535
*
36-
* Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this
37-
* argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled,
36+
* Enable debug mode by passing the `-FIRDebugEnabled` argument to the application. You can add this
37+
* argument in the application's Xcode scheme. When debug mode is enabled via `-FIRDebugEnabled`,
3838
* further executions of the application will also be in debug mode. In order to return to default
39-
* mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled.
39+
* mode, you must explicitly disable the debug mode with the application argument
40+
* `-FIRDebugDisabled`.
4041
*
41-
* It is also possible to change the default logging level in code by calling setLoggerLevel: on
42-
* the FIRConfiguration interface.
42+
* It is also possible to change the default logging level in code by calling
43+
* `FirebaseConfiguration.shared.setLoggerLevel(_:)` with the desired level.
4344
*/
4445
NS_SWIFT_NAME(FirebaseApp)
4546
@interface FIRApp : NSObject
@@ -75,31 +76,31 @@ NS_SWIFT_NAME(FirebaseApp)
7576
// clang-format on
7677

7778
/**
78-
* Returns the default app, or nil if the default app does not exist.
79+
* Returns the default app, or `nil` if the default app does not exist.
7980
*/
8081
+ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(app());
8182

8283
/**
83-
* Returns a previously created FIRApp instance with the given name, or nil if no such app exists.
84-
* This method is thread safe.
84+
* Returns a previously created `FirebaseApp` instance with the given name, or `nil` if no such app
85+
* exists. This method is thread safe.
8586
*/
8687
+ (nullable FIRApp *)appNamed:(NSString *)name NS_SWIFT_NAME(app(name:));
8788

8889
/**
89-
* Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This
90-
* method is thread safe.
90+
* Returns the set of all extant `FirebaseApp` instances, or `nil` if there are no `FirebaseApp`
91+
* instances. This method is thread safe.
9192
*/
9293
@property(class, readonly, nullable) NSDictionary<NSString *, FIRApp *> *allApps;
9394

9495
/**
95-
* Cleans up the current FIRApp, freeing associated data and returning its name to the pool for
96-
* future use. This method is thread safe.
96+
* Cleans up the current `FirebaseApp`, freeing associated data and returning its name to the pool
97+
* for future use. This method is thread safe.
9798
*/
9899
- (void)deleteApp:(FIRAppVoidBoolCallback)completion;
99100

100101
/**
101-
* FIRApp instances should not be initialized directly. Call +[FIRApp configure],
102-
* +[FIRApp configureWithOptions:], or +[FIRApp configureWithNames:options:] directly.
102+
* `FirebaseApp` instances should not be initialized directly. Call `FirebaseApp.configure()`,
103+
* `FirebaseApp.configure(options:)`, or `FirebaseApp.configure(name:options:)` directly.
103104
*/
104105
- (instancetype)init NS_UNAVAILABLE;
105106

@@ -114,7 +115,7 @@ NS_SWIFT_NAME(FirebaseApp)
114115
@property(nonatomic, copy, readonly) FIROptions *options;
115116

116117
/**
117-
* Gets or sets whether automatic data collection is enabled for all products. Defaults to `YES`
118+
* Gets or sets whether automatic data collection is enabled for all products. Defaults to `true`
118119
* unless `FirebaseDataCollectionDefaultEnabled` is set to `NO` in your app's Info.plist. This value
119120
* is persisted across runs of the app so that it can be set once when users have consented to
120121
* collection.

FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ NS_SWIFT_NAME(FirebaseConfiguration)
3131

3232
/**
3333
* Sets the logging level for internal Firebase logging. Firebase will only log messages
34-
* that are logged at or below loggerLevel. The messages are logged both to the Xcode
34+
* that are logged at or below `loggerLevel`. The messages are logged both to the Xcode
3535
* console and to the device's log. Note that if an app is running from AppStore, it will
36-
* never log above FIRLoggerLevelNotice even if loggerLevel is set to a higher (more verbose)
36+
* never log above `.notice` even if `loggerLevel` is set to a higher (more verbose)
3737
* setting.
3838
*
3939
* @param loggerLevel The maximum logging level. The default level is set to FIRLoggerLevelNotice.

FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ NS_SWIFT_NAME(FirebaseOptions)
3838
@property(nonatomic, copy, nullable) NSString *APIKey NS_SWIFT_NAME(apiKey);
3939

4040
/**
41-
* The bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]` when not set
41+
* The bundle ID for the application. Defaults to `Bundle.mainBundle.bundleID()` when not set
4242
* manually or in a plist.
4343
*/
4444
@property(nonatomic, copy) NSString *bundleID;
@@ -107,17 +107,17 @@ NS_SWIFT_NAME(FirebaseOptions)
107107
* let options = FirebaseOptions(contentsOfFile: path)
108108
* }
109109
* ```
110-
* Note that it is not possible to customize FirebaseOptions for Firebase Analytics which expects a
111-
* static file named `GoogleServices-Info.plist` -
110+
* Note that it is not possible to customize `FirebaseOptions` for Firebase Analytics which expects
111+
* a static file named `GoogleServices-Info.plist` -
112112
* https://github.com/firebase/firebase-ios-sdk/issues/230.
113-
* Returns nil if the plist file does not exist or is invalid.
113+
* Returns `nil` if the plist file does not exist or is invalid.
114114
*/
115115
- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath NS_DESIGNATED_INITIALIZER;
116116

117117
/**
118-
* Initializes a customized instance of FirebaseOptions with required fields. Use the mutable
118+
* Initializes a customized instance of `FirebaseOptions` with required fields. Use the mutable
119119
* properties to modify fields for configuring specific services. Note that it is not possible to
120-
* customize FirebaseOptions for Firebase Analytics which expects a static file named
120+
* customize `FirebaseOptions` for Firebase Analytics which expects a static file named
121121
* `GoogleServices-Info.plist` - https://github.com/firebase/firebase-ios-sdk/issues/230.
122122
*/
123123
- (instancetype)initWithGoogleAppID:(NSString *)googleAppID

SwiftDashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tasks for additional Swift improvements.
1717
| **SwiftUI Lifecycle** || n/a | n/a || n/a |n/a | n/a || n/a | n/a | n/a | n/a || n/a || n/a |n/a |
1818
| **SwiftUI Interop** || n/a ||| n/a ||| n/a || n/a || n/a | n/a | n/a || n/a |n/a |
1919
| **Property Wrappers** ||||||||| 6 |||||||||
20-
| **Swift Doc Scrub** ||||| |||||||||||||
20+
| **Swift Doc Scrub** ||||| |||||||||||||
2121

2222
### Other Projects
2323
- Tooling to surface full list of automatically generated Swift API from Objective C and validate.

0 commit comments

Comments
 (0)