Xcode 7 - Launch Screen localization doesn't work - swift

I've created a splash screen in Swift using Xcode 7. I've generated localizations as in the photo for different languages, but it doesn't work:
Can anybody help?

Ok I fix it after i create InfoPlist.strings and create splash screen for each language and add below in each file
"UILaunchStoryboardName" = "LaunchScreen";
"UILaunchStoryboardName" = "LaunchScreenSP";

Add two Launch Screen storyboards
You can find your info.plist added a key named "UILaunchStoryboardName"
Add an infoPlist.string file
Change the UILaunchStoryboardName = "ENLaunchScreen"; in your infoPlist.string to the name of storyboard you wanted

Another solution, you can set some basic image at the launch screen, then create a view in app delegate and add in to window's subviews, also bring to front pretend that this is Launch screen.
now you can configure this view by code.
last use DispatchQueue asyncAfter to remove this view.

Related

How to reuse UIControl from iPhone xib to iPad xib

I am converting my application into Universal, So I have created iPad xib with ~ipad.xib extension. Now I want to use all the old UIControls used in iPhone.xib in iPad.xib without recreating and connecting, Is there any way to reuse it? I have checked in one SO question he mentioned copied and used it in iPad. How to do it?
First take back up of your application.GO to your app target section and right click there u will get three option like Duplicate, Delete, Project Editor Help....Now Select Duplicate it will show alert like below image. Now select "Duplicate and Transition to iPad".Xcode will generate all xib's for iPad with connections.Copy all xibs of iPad to original application.
just select all controls make copy & paste in new .Xib .

How To Port an iPhone Application to the iPad (Storyboard)

I just finished my iPhone app and I want to make it Universal. I've read a few posts already but they're a bit old (2010 or so).
What I got:
Simple iPhone app, recently created (iOS 5 - Storyboard), with three screens.
My app represents a table with three cards that you can flip touching them. The user can input (on the second screen) text to be displayed on the cards.
When I created the project I checked "Universal" so I have two Storyboards. After that nothing else I did had to do with iPad (except for a line on my "contact support" email option where I used UIModalPresentationPageSheet).
What I'd like to accomplish:
Same app on the iPad: my application is so straightforward I don't have any use for split views or details. I just want the same objects and layout but with bigger and better graphics (table, cards, etc).
I like it because it'd make a great introduction-level migration.
I have no idea where to start. When I run the iPad simulator a white screen comes up and that's it.
Well this is done.
As with almost everything, this is pretty easy once you know what to do.
I'd say that for those cases like mine, where the UI doesn't change in more than sizes or (x,y) coordinates the process could be summarized like this:
Replicate every UI element on the iPad Storyboard (copy and paste will do) and adjust position and size as you see fit
Re-wire everything again. Every button, segue (you'll have to add the segue name again too), etc.
Verify within your code every place where your UI is affected (e.g. x,y coordinates), identify whether the app is running on an iPhone or iPad, and divide your code accordingly
If you have any localization on the application you'll have to update the new UI elements on the iPad Storyboard
Select the target for testing on the simulator and try it out
In order to identify in which device the app is running you can use the following:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
//I'm running on the iPad
} else {
//I'm running on the iPhone
}
And that's it. Again, in a simple case like mine the reuse of code is absolute (100%), the new code you'll have to add is minimum (basically IF statements where needed), and the UI elements duplication is as easy as copy and paste.
I hope this is useful to someone else and if you have recommendations to improve this they're more than welcomed.
Open the Storyboard file in finder,Copy your iPhone-Storyboard and rename it Main-iPad.storyboard
Inside xCode, right click on the storyboard -> “open as” -> “Source Code”
Search for targetRuntime="iOS.CocoaTouch"and make it targetRuntime="iOS.CocoaTouch.iPad"
Now save everything and reopen Xcode -> the iPad-Storyboard contains the same as the iPhone-file but everyting could be disarranged you have to arrange it by your self.
Finally to get the iPad format also change the code in the MainStoryboard_iPad.storyboard from: to
Then go to your "StroryBoardEx-Info.plist" file,search for "Main nib file base name (iPad)" and make it "Main-iPad.storyboard"
If you just want to reuse your iphone storyboard, just go to your project settings. In TARGETS tab Info, there are rows 'Main storyboard file base name' and 'Main storyboard file base name (iPad)'. Just edit the iPad one to have the same value as the other. In my case I had to edit it as 'Main storyboard file base name (iPad)' with value 'MainStoryboard_iPhone'.

Viewbased project is not using MainWindow.xib

I am using x-code 4 and any time I start a "view based application" (say "Test") IB opens up and creates 6 files. 1)TestAppDelicate.h 2)TestAppDelicate.m 3)MainWindow.xib 4)TestViewController.h 5)TestViewController.m 6)TestViewController.xib
Now the Main Interface is set to MainWindow yet when I run the app it always starts up the TestViewController.xib not mainwindow.
The problem is If I change from iPhone to Universal app it creates a MainWindow-ipad.xib that is unusable. How do I get it to use mainwindow?
Is this a bug? Or am I doing something wrong or am I uninformed?
The MainWindow.xib creates the root window and sets it's view controller to the TestViewController. TestViewController's contents are created in the TestViewController.xib.
In other words, you ARE using the main window.

Adding iPad XIB to a View Based Application Template Application in XCode 4

I've created a View Based Application in XCode4; when creating the application I selected iPhone as the Device Family:
The application was created with the following files:
I designed the UI on the TestushViewController.xib file and without adding any code in the Delegate files, the application is uploading immediately to the TestushViewController.xib view and I'm very happy about it.
Now I want to add an iPad xib. How do I do that?
(I knew how to do it in XCode 3, but I used some code in the Delegate file, and now if I try to use the same code it doesn't work because the template default implementation works differently - Apple uses #class TestushViewController and self.window.rootViewController = self.viewController and it goes directly to the iPhone.xib. I don't know how to go around it without changing the entire thing to the way it was done in XCode3)
You'll need to structure your code in a similar way that the Window Template does. The file structure that template uses when the "Universal" option is ticked at creation is:
App Name/
AppNameAppDelegate
iPhone/
AppNameAppDelegate_iPhone
MainWindow_iPhone.xib
iPad/
AppNameAppDelegate_iPad
MainWindow_iPad.xib
The iPhone and iPad AppDelegates are simply subclasses of the AppNameAppDelegate
#interface YourAppNameAppDelegate_iPhone : YourAppNameAppDelegate {}
In your target summary you can set what .xib file is initially loaded for each device. It is called the "Main Interface" and has a pulldown menu.
Quite frankly, if you're wanting to do a universal app (iPhone + iPad) it's probably easier just to start with the Window Template and add in your view controllers instead of starting with the View template and trying to change it up.

Phonegap - How do i make the statusbar black?

Pretty simple one that I just seemingly can't find the answer to.
How can i change the iPhone statusbar (thin bar right at the top with the reception/batter etc) from default grey to black in my PhoneGap iPhone application?
Thanks,
Glen
A PhoneGap-iPhone application is just a regular Xcode iPhone project.
Add UIStatusBarStyle:UIStatusBarStyleBlackOpaque to your Info.plist.
Open your Xcode project (e.g. MyApp.xcodeproj)
Open your Info.plist file (e.g. MyApp-Info.plist)
Add a new row:
Key: Status bar style
Value: Opaque black style
If you are viewing the RAW Key/Value pairs, then use:
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
You can right-click in MyApp-Info.plist to toggle the RAW Key/Value pairs.
just set
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
When a PhoneGap Project is created, there is an <ApplicationName>AppDelegate.m file created in the project.
Inside of the (void)viewDidLoad method, you can make modifications to the view however you choose.