Skip to content

Commit

Permalink
feat!: rename method fixAlerts -> enableAlertSupport (#1)
Browse files Browse the repository at this point in the history
This change affects the installation steps and breaks existing
installations.
  • Loading branch information
rkbhochalya authored Mar 25, 2022
1 parent 28fee24 commit 9e8fe18
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If you are using RN >= 0.60, only run `npx pod-install`. Then rebuild your proje
To enable this, please follow the steps below:
1. Open your `/ios/{projectName}/AppDelegate.m` file
1. At the top of the file, import the OverrideColorScheme module: `#import <OverrideColorScheme.h>`
1. And then, within your existing `didFinishLaunchingWithOptions` method, add `[OverrideColorScheme fixAlerts];` to the top of the method (see below).
1. And then, within your existing `didFinishLaunchingWithOptions` method, add `[OverrideColorScheme enableAlertSupport];` to the top of the method (see below).

```Objective-C

Expand All @@ -34,7 +34,7 @@ To enable this, please follow the steps below:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[OverrideColorScheme fixAlerts]; // <--- and add this line
[OverrideColorScheme enableAlertSupport]; // <--- and add this line
//...
}
```
Expand Down
2 changes: 1 addition & 1 deletion example/ios/OverrideColorSchemeExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
moduleName:@"OverrideColorSchemeExample"
initialProperties:nil];

[OverrideColorScheme fixAlerts];
[OverrideColorScheme enableAlertSupport];

if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
Expand Down
2 changes: 1 addition & 1 deletion ios/OverrideColorScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
@class OverrideColorScheme;

@interface OverrideColorScheme : NSObject
+ (void)fixAlerts;
+ (void)enableAlertSupport;
@end
2 changes: 1 addition & 1 deletion ios/OverrideColorScheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OverrideColorScheme: NSObject {
}

@objc
static func fixAlerts() {
static func enableAlertSupport() {
UIAlertController.swizzle()
}
}

0 comments on commit 9e8fe18

Please sign in to comment.