iOS: Fix registration for UIContentSizeCategoryDidChangeNotification

Summary:
On an iPhone running iOS 10.3.3, I'm not seeing the UIContentSizeCategoryDidChangeNotification fire when changing the system's font scale setting. Registering for the event on `nil` instead of on the application object fixes the issue.

**Test Plan**

Verified that text in an RN app changes size when you change the system's font scale setting (Settings -> General -> Accessibility -> Larger Text). By default, RN text is supposed to scale with the system setting.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/15522

Differential Revision: D5657449

Pulled By: shergin

fbshipit-source-id: d7a6a730c5cd6eb3833274a1f2029663ad3a7ad2
This commit is contained in:
Adam Comella 2017-08-17 23:36:58 -07:00 committed by Facebook Github Bot
parent 609ee651d6
commit 2b7cb46ddb
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ RCT_EXPORT_MODULE()
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didReceiveNewContentSizeCategory:) selector:@selector(didReceiveNewContentSizeCategory:)
name:UIContentSizeCategoryDidChangeNotification name:UIContentSizeCategoryDidChangeNotification
object:RCTSharedApplication()]; object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didReceiveNewVoiceOverStatus:) selector:@selector(didReceiveNewVoiceOverStatus:)