Skip to content

Support launch storyboards as splash screens on iOS#1165

Merged
yogevbd merged 10 commits into
wix:masterfrom
ryanmasondavies:master
Jan 14, 2018
Merged

Support launch storyboards as splash screens on iOS#1165
yogevbd merged 10 commits into
wix:masterfrom
ryanmasondavies:master

Conversation

@ryanmasondavies
Copy link
Copy Markdown
Contributor

Apple's docs recommend the use of storyboards as launch screens:

Because device screen sizes vary, launch screen sizes vary too. To accommodate this, you can provide a launch screen as an Xcode storyboard or as a set of static images for the devices your app supports. Using an Xcode storyboard is the recommended approach, as storyboards are flexible and adaptable. You can use a single storyboard to manage all of your launch screens. To learn about implementing adaptable interfaces, see Auto Layout Guide.

This PR changes -[RCCManager showSplashScreen] so that it checks first for a launch storyboard, then for a launch xib, and then for launch images. If none of these are found, it defaults to showing a view controller with a white background.

  • The code used for looking for a launch image is unchanged.
  • The xib code is made slightly safer by checking that the class of the xib first object is a UIView.
  • Class methods are used for all of these things as none of them need to refer to self.
  • Grouped Splash Screen related methods under a #pragma mark and moved getBridge and getAppWindow to the top of the file.

In my tests, this works beautifully. I would be interested to know if it still works correctly for images and xibs.

Any feedback much appreciated.

@tmaly1980
Copy link
Copy Markdown

Does this have anything to do with why I'm getting a blank white screen with my fatal errors? Seems like something to do with storyboard files.

https://stackoverflow.com/questions/46206139/error-screen-with-white-background

@yogevbd yogevbd merged commit c02c540 into wix:master Jan 14, 2018
@yogevbd
Copy link
Copy Markdown
Collaborator

yogevbd commented Jan 14, 2018

Closes #2168, #2476

chilinh added a commit to chilinh/react-native-navigation that referenced this pull request Jan 15, 2018
* r_master:
  fixed storyboard crash
  Support launch storyboards as splash screens on iOS (wix#1165)
  Force UiManager to measure SideMenu
  Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants