I have observed two different scenarios in Object Library present in Utilities pane of Xcode 5. Below are screenshot for the same.
The Second Object Library appears apparently in utilities. When to use the Second Object Library? Also, when does this library appears?
It happend to me lot of times and I think it's just a visual bug. It should be caused by the fact that Xcode is still loading all the elements of the scene. Anyways if it persists you should try this: in the Build Settings, change the "iOS Deployment Target" pulldown to a different SDK, then change it back. After that, you should get iOS objects back.
Related
I'd like to take my existing iPhone app and modify its layout/number of screens for an iPad.
I began by duplicating the Target with "Duplicate and Transition to iPad".
But I'm unsure where to go after that. I'll need a new Storyboard and some of the functions/viewControllers/views will need to be modified. Where/how do I do that?
All I can find are very old solutions that are no longer valid or leave too much out:
How to convert iPhone app to iPad app
This is the best one I've found, but again not current and still leaves a lot out:
http://innovationm.co/convert-iphone-application-to-universal-application/
I no longer see a "Universal" option. I am guessing that selecting all of these accomplish the same thing?
First, edit your target to make sure it is set for both iPhone and iPad:
Second, using two different storyboards is unusual nowadays, but you can easily do it. In your Info.plist configure two entries (using Raw Keys and Values): UIMainStoryboardFile and UIMainStoryboardFile~ipad. The result is that your app will load one storyboard for an iPhone and a different storyboard for an iPad.
Note that with a newer created project that uses window scenes under iOS 13 and later, you would configure UIApplicationSceneManifest and UIApplicationSceneManifest~ipad to specify different UISceneStoryboardFile values.
Here's a downloadable project that demonstrates the newer structure:
https://github.com/mattneub/Programming-iOS-Book-Examples/tree/master/bk1ch09p358universal
I have been trying to fix the compilation issues for the open source project https://github.com/gontovnik/DGRunkeeperSwitch with XCode6.4. I seem to have fixed all the issues but unsure of how to fix the following errors:
DGRunkeeperSwitch/DGRunkeeperSwitchExample/Base.lproj/LaunchScreen.storyboard: Launch screens may not use instances of IBUISceneExitPlaceholder.,
DGRunkeeperSwitch/DGRunkeeperSwitchExample/Base.lproj/LaunchScreen.storyboard: Launch screens may only have one top level object, which must be a UIView or a kind of UIViewController.
and
DGRunkeeperSwitch/DGRunkeeperSwitchExample/Base.lproj/LaunchScreen.storyboard: Launch screens may not use instances of IBUIStoryboardEntryPointIndicator.
Can someone please provide some pointers on how to go about fixing these errors?
Delete Your file LaunchScreen.StoryBoard, and then clear "LaunchScreen" in Lauch Screen File as photo. Done. Or you can add file LauchScreen.xib to your project, and then chose it in Launch Screen File as photo
"Requirements: Xcode 7-beta or higher." There's likely something new in the LaunchScreen.storyboard that trips up Xcode 6.
Since the launch screen is not a critical/essential part of the sample code, the easiest fix is to delete the existing launch screen, then create a new one in Xcode 6.
Update:
A launch screen is a splash screen that appears while your app launches. It doesn't have its own view controller, and is not the entry point for an app.
The example's navigation controller is the app's initial scene.
Update 2:
It's not that it's not fixable. Someone with the time and skill could rewrite it to remove the dependencies. Yet it does work as is with Xcode 7, so it's not really practical to fork it.
The error messages really are self-descriptive, but you may have introduced some of the problems by making some inadvertent/unintentional changes that broke it.
You could upgrade your tools and project to Xcode 7, find a different third-party component to replace this one, find someone who will fix it for you, or brush up on your skills and rewrite it yourself.
first you delete your launch screen and then delete UItests, you can find uitests in your project build settings under target files
After upgrading to Xcode 6.3 (release version), Xcode now freeze every time I open a XIB/Storyboard file that includes an IB_DESIGNABLE view that uses a custom font for any projects and includes a custom font (not necessarily to have reference to that font in that XIB/Storyboard). The freeze occurs after opening the .xib file and then attempting to switch to any other file. Xcode hangs and must be force quit.
I have opened a bug report with Apple. (Bug 20483867).
Right now, I have two work arounds.
Download and use Xcode 6.2 from Apple.
Remove the IB_DESIGNABLE tags from the custom view header files.
This is likely an Apple bug, but does anyone have a better work around or solution?
I've already suggested an edit for a more accurate description.
It only happens when your project contains a custom font.
It'll freeze just by visiting any Storyboard/XIB that contains an IBDesignable custom view, not even referencing to that font in your Storyboard/XIB.
My workaround is to use have an older version of Xcode also installed (Xcode 6.3 beta or Xcode 6.2) and use that to update your Interface Builder files, and never open it in 6.3. open those Storyboard/XIB in a new window in Xcode with option+shift+click the file in the project tree.
Whenever you encounter the freeze, I use this command to clear the saved state just for that project.
rm -rf YourProject.xcodeproj/project.xcworkspace/xcuserdata
Xcode 6.3.1 fixes the problem with custom fonts and IB_DESIGNABLE views in a Storyboard. Update via the Mac App Store, and you should be good.
Response from Apple: Link to Developer Forums on Apple
Thank you all for your reports. We are tracking this on our end and working hard to resolve it. Unfortunately we don't have a great workaround, but here are two options to get you going:
If Xcode is hanging on launch because a storyboard/XIB using a custom font/IBDesignable was previously open: remove the "UserInterfaceState.xcuserstate" file inside the xcodeproj of the project you are opening, it would be at a path like this: My App.xcodeproj/project.xcworkspace/xcuserdata/yourusername.xcuserdatad/UserInterfaceState.xcuserstate
If you really need to edit the storyboard/XIB file containing the custom font with Xcode 6.3:
Make a copy of your storyboard/XIB file as a backup
Open the storyboard/XIB file in a text editor
Remove XML tags named "fontDescription" that reference your custom font, for example: . Removing this tag will revert the font to the standard system font.
Make outlets to the objects using the custom font and at runtime set the font of those objects to your custom font, for example in an override of viewDidLoad or awakeFromNib on your view controller
IMPORTANT NOTE: we never recommend hand editing storyboard/XIB files. However we recognize this issue is preventing many of you from editing your documents and wanted to provide a workaround with the caveat that any hand editing may result in corruption of your document.
Same problem for me. Removing IB_DESIGNABLE fixes the problem.. Going back to 6.2 doesn't work for me as I'm testing apps on device with iOS 8.3 - Xcode 6.2 can't run apps on devices with iOS 8.3 :(
Another workaround is to change the file extensions to all of your font files and load the changed file names from Info.plist.
This way you can keep IBDesignables and still use your custom fonts, but wont be able to see them in the Font Picker in Interface Builder.
All custom fonts that were peviously set from Interface Builder will continue to work, but in order to change them or to set another custom fonts, you will have to do it either from code or to modify the Storyboard or Nib files from text editor in order to set the font name.
I don't have an answer but found out that simply force-quitting and restarting will re-launch Xcode in the exact same situation. To just be able to restart Xcode, remove the folder ~/Library/Saved Application State/com.apple.dt.Xcode.savedState.
This bug has been fixed in the 6.4 Xcode beta that came out today. Go to the dev center and log in to download it.
Xcode 8.1 - if you have a view with Navigation (in my case it was top Bar opaque Navigation Bar), just try to set property "top Bar" to None.
As a workaround,I just commented out all the #IBDesignable markup in my handful of custom components that use this. When I did that, yes I lose ability to tweak the settings in Interface Builder, but it allowed me to at least open the .xib files w/out XCode crashing.
I will simply un-comment those #IBDesignable lines when Apple comes up w/ a fix.
#O. Kurnenkov's answer worked for me. It didn't have anything to do with IB_Designable nor custom fonts, Cocoapods, etc.
For some reason having an "Opaque Navigation Bar" causes the nib file (it doesn't seem to affect storyboards) to constantly change y position; this can be seen in the Size Inspector where the y position will flicker between 0 and 64. This is happening to me with Xcode 8.2 (8C38).
My guess here is that this causes Xcode to constantly update the layout thus draining resources and causing it to hang/freeze.
The solution is to use any of the "Translucent" options, Inferred, or None.
Hope this helps!
Notice the object library in the attached screen shot, at the right bottom.
It's different to the usual one I'm used to work on, I clicked to open an XIB and it was gone and I don't know how to get this one back. Is it even useful ?
I scrolled through it and found many more controls like Bevel Button, Secure Text Field....etc.
Those are elements for OSX. Xcode seems to to know that this is an iOS project if no Interface Builder file is opened. If you open the Interface Builder, Xcode realizes that this is an iOS project and only shows iOS elements.
I have an xcode project for an app I am in the middle of developing. Recently I saved my xcode project, and then moved a single button using the arrow keys, somehow causing xcode to crash. Several re-opening attempts failed, as I saved just prior to the crash, and xcode would then simply crash upon opening.
After restarting the computer to no avail, I opened the project in xcode 5 developer preview, didn't upgrade the app to xcode 5, and then was able to open it in xcode 4 again. However, for some reason a bunch of IULabel I had created with important text were missing. After closer inspection, I found that I had some UITextFields that were also missing. When I inspected the connection in my header file, I could right click the outlet and select the UITextField. It turns out the X coordinate was set to -345, so it was missing because it was out of my view.
I suspect all of my missing UILabels are similarly out of my view, but since they aren't explicitly connecting to my header, I have no way of selecting them manually, and I can find any way of searching for them or selecting them, since they are out of my view.
Does anyone know how I might be able to select these missing UILabels so that I can change their faulty X coordinates?
Thanks!
All UI elements you have used in your storyboard/xib should be available in the left sidebar of the interface editor.
If the sidebar is not visible you have to click the little round button at the bottom.