Xcode 8 MainStoryboard showing blue rectangles instead of objects - ios

I have latest version of Xcode 8 official release, and Im seeing blue rectangles borders filled white, instead of normal objects(Labels, Images, etc) on the main storyboard, I Drag an Image, button or anything and it just shows a blue rectangle (I don't see the object inside the rectangle, just an empty blue bordered rectangle), I attach an image for you guys to see, Any clue on how to solve it? Someone else with the same issue? This is happening an all My projects, and just start happening suddenly.. since the first day I was having no issue with this Xcode version.

Solution: Try these three steps.
Editor -> Canvas -> Turn OFF bounds rectangle.
Editor -> Canvas -> Turn ON bounds rectangle.
Editor -> Canvas -> Turn OFF bounds rectangle.

You may have accidentally switched on Layout Rectangles within Editor -> Canvas in Xcode menu.

The contents of my storyboard views were actually not showing AND had blue rectangles, while 'Show Layout Rectangles' was NOT on. I was also surprised to see 'Show Bounds Rectangles' since I never turned them on (awesome Xcode ghost move here)
Note: Even though I did try turning 'Show Bounds Rectangles' off, the blue rectangles remained.
Solution: Restarting the computer. Opened to my storyboard and at least for me, I had to turn off 'Show Bounds Rectangles' because it still remained. I can see my content again, yay!
(seeing on Xcode 8.0)

I tried lots of solution. But there is no permanent fix for this.
Try below line
Editor->Canvas->Bounds Rectangles. (Do this three times.)
Doing this every time is quite annoying. So a solution is u can set some shortcut key (Keybinding).
Go in Xcode-> Settings/Preferences -> Keybinding -> search Bounds Rectangles and set shortcut for that
It will be easy if we use shortcut and save some time.

Related

UITabBar Large Content Size Image (HUD) doesn't display in Large Text mode

iOS 11 has an accessibility feature that shows a large version of a tabbar icon in a pop-up HUD when long pressed. In a WWDC presentation, it was mentioned this just involves turning on:
Settings -> General -> Accessibility -> Larger Text
..and adding:
tabBarItem.largeContentSizeImage = UIImage(named: "myHud")
Alternatively, you can add a vector image as the main tool-bar image, with 'Preserve Vector Data' checked in the asset catalog.
I've tried all combinations of this, and a long press does not show the HUD. I also tested with the Files app on my iPad running iOS 11b4 with no luck. This is the app that was demoed at WWDC.
Is there some other accessibility setting I'm missing to enable this feature? Or is it not available in beta 4?
It isn't enough to turn on Larger Text. You also have to use Larger Text — i.e. slide the slider way to right.
Then it works — well, the HUD appears. But the icon is not being enlarged within the HUD, so I don't quite see the point:
(As you can see, I'm doing this in a test project where I'm experimenting with the vector PDF image feature.)
This feature implementation and an example with tab bar are perfectly explained with illustrations on this accessibility site but here are the outlines :
Under Xcode, import the image to be enlarged with a pdf extension and a x1 resolution in the xcassets catalog.
In the new Image Set, tick Preserve Vector Data and specify Single Scale as Scales attribute.
If a storyboard is used for this image, tick Adjusts Image Size in the Image View section, otherwise put the adjustsImageSizeForAccessibilityContentSizeCategory image property to true in code.
For your tab bar or tool bar used in the application, first repeat the previous 3 steps for each image included in the items to be enlarged in the middle of the screen and then link the accessibility image to its appropriate item.
This feature is available only for the accessibility text sizes.
WARNING : don't forget to check your layout with these new images larger sizes.
For your record, an explanation of the Large Content Viewer is provided in this detailed WWDC video summary if need be ⟹ the UILargeContentViewerItem protocol is an iOS 13 new feature that shows the same HUD that's shown for standard bar items.
You need to go :
Settings > General > Accessibility > Larger Text(set on) > Move slider more then half to the right
Don't forget to set
tabBarItem.largeContentSizeImage = someKindOfImage
And Long press will does the trick.

ios 9, white splash screen instead of launch image, working fine previously, seemingly nothing changed to cause it

When my app launches, I see a white screen, instead of my launch image. I am using a storyboard, as required, and everything was working fine for about 2 months before this. I didn't change anything related to the image or storyboard either, it just started happening. I should mention that this started happening sometime after my first time uploading to TestFlight...but I doubt that is relevant. I have tried changing the constraints of the image to make it smaller than the bounds, and it still doesn't show up, so it isn't the size of the image. Again, I seemingly did nothing to have this start happening. Most of the questions related to my problem on stackoverflow have to do with the user not using a storyboard as required with iOS 9. Please help. Thanks.
UPDATE
I launched it on the simulator (iPad2) and the launch image for that was too small...there was white exposed above and to the right, I'm guessing I need to fix something in the storyboard but I'm not sure what.
UPDATE
I made a new storyboard and assigned the launch-screen config to it, and there is still a white screen.
I deleted the UIImageView and then inserted a new one with dimensions 200 x 200.
I added the image to the UIImageView.
I adjusted the constraints to the same values that I was using before.
Adding the image to the 200 x 200 UIImageView, before adding the constraints, seemed to be the key.
Make sure that one of the view controllers has the Is Initial View Controller checkbox checked in the Attributes Inspector in the right sidebar, that got me.
In project by default you LauchScreen.xib. Put your launch image there and set it’s top, bottom, leading, trailing constraints. Tap your project file and scroll down. There you will see: LauchScreen option and MainStoryboard. Set LauchScreen to your LauchScreen.xib. That’s it))

Using PDFs for icon images in Xcode 7.2

I'm attempting to use PDF files as icons in an app I'm working on. The issue I'm encountering is I'm getting inconsistent tint colors.
If I set a button image from interface builder, the icon image shows up black at runtime. Every time. Regardless of what I attempt to set from interface builder.
I tried setting my button icon image via code and instead of showing up black, it's white:
let myGraphicFile = UIImage(named: "myPDFImage")
let myButtonImage = myGraphicFile?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)
myButton.setImage(myButtonImage, forState: .Normal)
From code, regardless of what I attempt to set the tint to, it's always white from code.
I discovered this post relating to Xcode 6.x, but I think it might be dated, as I'm able to partially do it, but I can't set the tint.
Use PDF in XCode for an AppIcon (.appiconset collection)
I create the icons in Inkscape, save as PDF 1.5. I add the file to Images.xcassets. In Images.xcassets' attributes inspector, I'm setting:
Devices to Universal
Scale factor to Single Vector.
Summary: I can get it to show up and scale properly, but it's either black from interface builder or white from code. I suspect I'm missing something re: how to save the file from Inkscape.
Thank you for reading. If you have any suggestions, I welcome them.
I have figured out how to create vector icons with Inkscape. When you use PDFs to display icons in iOS, you need to alter the Attributes Inspector for your icon in xcAssets as follows:
1) Drag the PDF into xcAssets
2) Set devices (I did Universal and it worked fine)
3) If your PDF icon is under 1x, 2x, or 3x size class, drag it to Universal and delete the rest of them.
4) Set Scale Factors to Single Vector.
5) Render as Template Image.
Once it's configured there, then you just treat it was you would any other image in interface builder. It's essentially the same thing I was doing in code, but I don't think it gets done in code...it's gotta be done on xcAssets where the image lives. It's my understanding iOS renders vector images for the size class at run time. I think by attempting to tweak it in code wasn't working because the image had already been rendered.
If anyone has any questions on this, I found this link helpful in resolving my issue.
Additionally, this post covers the topic, too. https://stackoverflow.com/a/25804358/4475605

Xcode 7.1: UILabel added to sizeclass regular/regular shown anywhere

In Xcode 7, I was able to add a UILabel only to the Regular/Regular size-class. I simply selected w: Regular h:Regular below the storyboard and added it to my controller using drag 'n' drop. Once I switched to another size-class, the element was shown as inactive in the document outline on the left. Everything fine.
Now the same approach doesn't seem to work. When I switch to another size-class after the label was added to regular/regular, the UILabel is still active in the document outline and shown when the app is running (on an iPhone for example).
Any pointers or hints more than appreciated! Release notes don't offer any clue. Doesn't look like a wanted behaviour that was mentioned anywhere.

xcode Interface Builder background color preference

It seems odd, so i am likely just missing it in preferences, but how does one change the actual background color of IB in Xcode? Not any of the elements, but the actual blinding white of the standard IB? Too much contrast and when you zoom out, the view controllers almost disappear..
Thanks for any tips..
I've gone ahead and created an Xcode plugin that changes the background color of the storyboard editor. You can find the source at rpendleton/xcode-canvas-color. I've hardcoded it to a light gray color, as shown in the screenshot below, but this can be changed easily.
(Also, I don't think you're missing a setting for it. When I decompiled Xcode, the drawRect method for the background view explicitly called [[NSColor whiteColor] set].)
One doesn’t. Submitting a feature request to Apple is your only hope.
Unfortunately, with recent changes to Xcode, Ryan Pendleton's plugin is no longer a viable option. (unless you are willing to break Xcode's code signing, which can be quite problematic.) However, the good news is that there is now an official solution -- so long as you are willing to upgrade to OS X 10.14 Mojave: Upgrade to OS X 10.14 Mojave and turn on Dark mode. When Dark Mode is enabled, the background in Interface Builder darkens to a nice, eye-pleasing dark gray color. Navigating around a large storyboard is now MUCH easier (and less eye-scorching :) )
Before:
After:

Resources