xcode storyboard mirroring effect - xcode

Am using Xcode 9.1 and my Xcode error while dragging objects from object panel in storyboard its mirroring automatically as shown in picture .need help in solving this !

Very odd. At first I thought it was simply rendering for a RtL locale but I don't imagine the chrome around the rendered view should be mirrored as well. Out of curiosity are you testing a Right-to-Left locale? If so, does this persist when that preference is disabled?
Otherwise I'd try cleaning the project, restarting Xcode, and removing your .xcuserdatad file, in that order.

Related

missing alignment guides in xcode interface builder

I am new to programming on the Apple Mac. I have followed a programming guide supplied in the Mac Developer Library to program a basic GUI program called TrackMix. In this program you place a textbox, a vertical slider and a button control on the view window. Initially, on dragging the specific object, say the textbox, to the window, a set of alignment guides (dotted blue lines) would automatically appear on the canvas when the object is dragged over it. I dont know what has happened, but now those guides have disappeared when I execute the same action of dragging objects to the window. When the object being dragged is over the window a small green dot, with a plus sign in it, appears on the bottom of the object. I have carefully retraced my steps to be exactly the same as stated in the Developer Library, but still the problem persist. Have I, perhaps, involuntarily changed some Xcode settings or what? I am at the end of my wits! PS: I am using Xcode 7.
You have to toggle the menu item "Editor > Canvas > Snap To Guides" in Storyboard. I hope that helps
I am not sure whether this will be helpful, but I just had the same problem and the only thing which worked was re-installing Xcode (7.3) and trashing all of the Xcode preferences.
Good luck.

How to fix: disabling size classes in Xcode 6.2 trashes storyboard UI but keeps guides

[EDITED] After spending a couple of days on a iPad app (utility s/w for myself; not for release), I accidentally clicked on disabling size classes in Xcode (6.2). I only want to turn off Auto Layout temporarily so I could figure out why my popover scene was not rendering.
Now, all the UI elements are gone but the guidelines for both the main scene and the popover scene are still around. History seemingly shows nothing that will bring back the UI elements. I closed the Xcode project and opened it again, but only the red guidelines are visible.
Has anyone run into this? Any idea how to fix this? [EDIT] I'm referring specifically to the UI elements and getting them all back -- else I'm going to have to spend a couple of hours reconstructing and positioning them. I browsed StackOverflow and Google Search but I've not seen any relevant suggestions.
First, when disabling auto layout it will disable the size classes as well.
I would suggest that you update your Xcode to 6.3. Then that will probably be gone.
Hope that helps :)
Edit
regarding the comment
First off I would print the frames of the UIElements to see whether they are still on the screen. (Using `println("(button.frame)")
Then, if they are not there, change their frames / centres) to somewhere on the screen.
If they are in the bounds, check their sizes to make sure they are large enough to be visible. If they are then make sure they are not hidden and their alpha is 1.
In storyboard you can open the side-bar and then change the element's position in the Attributes inspector as shown here:

Constraints keep going haywire every time I reopen an XCode project

Every time I close and reopen XCode 6 beta 6, my previously-happy constraints are messed up and I have to click on the yellow dot to get to the "Misplaced Views" thingy, then click on each yellow triangle, choose Update Frame, and click Fix Misplacement to correct the problem. Is this a bug in the beta or have I done something wrong, perhaps? Constraints in XCode (to me, at least) are horrible things to tame at the best of times, so maybe it's not a bug?
Once fixed, and XCode neither complains about nor renders the widgets badly, it's fine. But as soon as I close then reopen the project, they're messed up again.
I have experienced the same thing on a project I'm working on. What I've observed is a circular connection among the views in the storyboard in question, so that it's possible to segue around and around a particular path or paths. The views are all embedded in a TabBarController, and each tab has its own NavigationController.
So for instance:
Activity View (programmatically selected tab), segue to ...
Detail View, segue to ...
Profile View (programmatically selected tab), segue to ...
Item View, segue to ...
Detail view
... and so on
This seems to introduce random screwups to the views.
What I have not yet done is test this by removing the circular segue paths. I'm not sure I ever will, since the circular segue paths are part of the functionality of the app. But I'm pretty sure that was about where this weird behavior got introduced. I'll be interested to hear whether the same is true of your project.

When I build my app my simulator looks different from my viewcontroller.xib

I was making a user interface using storyboards and when I built my app to see how it would look in the iOS simulator it didn't look like the viewcontroller in the storyboard (some of the buttons were moved around and I had to move one button way down so it was in the place i wanted it to be). Does anyone know why this is?
Yes, the reason is auto layout, it will automatically position elements on a relative basis depending on the device you're running.
You can turn autolayout off, or build for all devices at once and keep it on.
You may want to read iOS Auto Layout Demystified by Erica Sadun which goes in depth to the world of autolayout.

iPad incorrect rendering of Objects

We just set up a whole bunch of development MacBooks in our office. We all set up the computers exactly the same as far as I can tell (just installing xcode and not changing any settings). We even distributed the exact same xcode project to everyone to test whether or not everyone was set up correctly. For some reason though, my iPad simulator incorrectly renders the positions of Objects on the UIView controller.
I can make a really basic application and slap down a UIView controller with the storyboard editor in xcode 4.3.1 (newest version ATM), and add a button to it. When I run this on the simulator, it will look fine on the iPhone one, but when I try to view it in the iPad, it seems that some elements will scale to the iPad resolution fine, but others will not. The components that do not, seem to be in the place that they would be if they had been rendered on the iPhone.
The weirdest part of this problem is that I can't find anyone online who has had this same issue. I have already tried deleting and re-installing xcode and the same thing still happens. I fear I might have to re-install the OS and start from scratch.
How it looks on the iPhone simulator:
And on the iPad simulator:
I don't think that's an SDK issue, I bet that you are writing code that fits for the iPhone screen and not for the larger iPad screen.
I think that you added just the button and is Autoresizing Mask is not set properly.
I've done some measurement an it seems that:
The distance from the top of the view is in fixed (~360px);
The width is fixed (~260px);
You need to give the button a fixed distance from the bottom (as it should stay on under the plot) and remove the left fixed margin so it can be centered.
You need to take a look at the UIViewAutoresizingMask for the UIView's autoresizingMask property.
button.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;

Resources