3

I am trying to create launch screen in an older iOS App using Xcode 8. I need .xib launch screen but Xcode is creating Launch Screen.storyboard. Could anyone suggest please.

Thank you in advance.

Ashwini Chougale
  • 1,093
  • 10
  • 26
Yas
  • 71
  • 1
  • 10

1 Answers1

11

Add your desired launch screen .xib file to your project, and in your General section in "App icons and launch images" subsection select in launch screen file your desired xib file

Creating the xib file (in top menu go to File -> Menu -> File..) enter image description here

Setting the xib file as launch screen enter image description here

Community
  • 1
  • 1
Reinier Melian
  • 20,519
  • 3
  • 38
  • 55
  • Thank you for your answer. How I can add xib file? – Yas Aug 22 '17 at 03:25
  • @Yas check my answer and let me know if you need further orientations – Reinier Melian Aug 22 '17 at 03:30
  • Yes I checked that option. I want to ask that how I can create LaunchScreen.xib? From Xcode I am trying to File-> New -> Launch Screen but it is creating .storyboard file but I want .xib file. – Yas Aug 22 '17 at 03:37
  • @Yas instead of select launch Screen in the template selection you need select View, I can post an image – Reinier Melian Aug 22 '17 at 03:38
  • @Yas any xib file can be used for LaunchScreen – Reinier Melian Aug 22 '17 at 03:41
  • @Yas What is the problem if you've .storyboard instead of .xib for launch screen? – Imad Ali Aug 22 '17 at 03:43
  • @ReinierMelian thank you for the suggestion. I did that and got launch screen but app doesn't work after that and stop with the error "Application tried to push a nil view controller on target" – Yas Aug 22 '17 at 03:50
  • Did you set a class to your created xib? is not needed maybe that is the error now @Yas this works was tested, try if you want with an empty project – Reinier Melian Aug 22 '17 at 03:54
  • @Yas also check if you accidentally change your app main interface – Reinier Melian Aug 22 '17 at 03:57
  • @ReinierMelian No I didn't set any class.. Sorry, I am not sure about this as I am not much aware with iOS app development. If I remove the launch screen, then app works fine. – Yas Aug 22 '17 at 04:00
  • @Yas can you post your code in some dropbox or github or google drive? i can review and setting up your xib file as launch screen if your want to – Reinier Melian Aug 22 '17 at 04:05
  • @ReinierMelian posting all code won't be feasible for me due to some limitations. I really appreciate your intension and help. Could you please suggest me something to check and fix it? – Yas Aug 22 '17 at 04:09
  • Its works for an example project I can post an example an you can find the issue in your real project? @Yas – Reinier Melian Aug 22 '17 at 04:12
  • @ReinierMelian Okay, I can check that. Is there any other step involved for creating launch screen. As I only created a new view and added image in that and then selected launch screen file. – Yas Aug 22 '17 at 04:16
  • @Yas that is all, no more steps are required, i will post an example on github – Reinier Melian Aug 22 '17 at 04:20
  • Thank you @ReinierMelian – Yas Aug 22 '17 at 04:36
  • @Yas let me know, I had pushed again to the repo with an image in the launchScreen I think you talk something about that – Reinier Melian Aug 22 '17 at 04:53
  • Yes I checked the App and it is working fine. but in my case I am getting error after launch screen "Application tried to push a nil view controller on target". There might be something wrong. – Yas Aug 22 '17 at 04:59
  • @Yas google this "Application tried to push a nil view controller on target" there are some many answers for that issue check – Reinier Melian Aug 22 '17 at 05:14