Popover presentation showing blank/white view in xcode swift - ios

I got a big project where I want to make a popover in 1 of my views, when click on a button.
The problem is that when I click the button it just shows a view with nothing in.
I have tried make a new project and do the same where it works fine, no problems there..
How I done it.
Made a new view, freeform it so it is the size I want.
Den from the button in other view I control+drag over to the new view and choose Present as Popover. But it just wont show the things I have in the new view, where it here is just a label, and have constraint on it show it should be in the middle of the view, and have tried moving it around, to see if any effects with that, but nothing happens..
I also have something else happen when click on the button, but tried removing that, and that did not help either.. Have also tried making button other places in my app, but it is the same problem.
I have not wrote code for it, just done it in the storyboard.
Screenshot from storyboard: http://i.imgur.com/Rj0uaUz.png
Screenshot from app showing the view: http://i.imgur.com/DalGOU1.png

I did found out what the problem was.
I had changed from wAny hAny too wRegular hAny because only making for iPad.
I found out that was mistake to do it this way. Because then the popover show in the app would be wAny hAny instead of the wRegular hAny I was working on in the storyboard..
So changed to wAny hAny and then I instead changed to iPad view under Simulated Metrics instead of to see how it look on iPad.

Related

Xcode storyboard - can't drag to make constraint, items disappear when switch between size classes

In my project I want the iPhone portrait version to stretch a view but the landscape and iPad version to have a specific width so it doesn't stretch since the iPad is wide and so is iPhone in landscape. The problem is, when I set one up, I switch to the other one and everything has disappeared. If I start dragging views from the left panel to the storyboard they appear again, but when I switch to the previous size class everything has disappeared on that one. I also can almost never drag on that ViewController's box to do what I want. For example, if I want to drag from a UIButton to the background of the layout it would normally bring up a menu with 'vertical spacing' etc but now it comes up with 'Outlets Delegate'.
How do I fix these issues? Nothing is working.
Solved it by deleting everything in the ViewController, re-adding everything in w-Any h-Any and adding specific constraints in the relevant size classes.

Label in tableview header doesn't appear on ipad but on iphone

in my universal app I have an UITableViewController embedded in a UINavigationController. When I add a UIView to the top of the tableView and insert a UILabel which is centered in the container, the label is only visible on iPhone but not on iPad.
I tried creating a new testapp, only consisting of these two controllers, the view and the label. It works on both, iPhone and iPad. So I added two new controllers to my app in the same way and made the navigation controller the initial view controller. Label is visible on iPhone but not on iPad.
For me it seems, that I have changed some global settings in the app; on another view I have similar problems with stackViews, but I first concentrate on this "simple" problem...
Any ideas what might be wrong in my app-settings?
tableViewController embedded in navigationController
Take a UIViewController embedded in a UINavigationController. Add View, Label, and TableView and check it
Ok. Now I know what was the problem. Never have checked, what's going on with those size classes.
During development I changed from any/any to a smaller size, not knowing, that this is not only taking effect on the layout in the storyboard. Everything I added after changing did'nt show on iPad.
Solution: Select storyboard, in "File Inspector", uncheck "Use Size Classes"

Second scene view controller constraints issue

I am working on an iOS project when I ran into this problem. When I add second scene view controller and add buttons in it, the buttons don't show up on the simulator in correct place. It is stuck up at the topmost left corner, I am not able to move it down. I tried applying constraints but they are not taking effect. Can someone please guide me? Attaching screenshots of storyboard and simulator
You have the choice to Update Your Frame or update your Constraints
You need to delete and remake new constraints. Right now your constraints are reflected in what is happening when you actually run the app, but when you move the view around in the storyboard, the constraints won't automatically update.
Click on each individual constraint and delete it before you create new constraints with different constants.
You Have to deselect the auto layout from the right side button menu.
Thanks guys for those wonderful answers. I was able to get around this issue yesterday, it is because of device orientation setting, the simulator was running in landscape mode setting, when I changed it to Portrait mode it started working. There is a setting available in bottom part of the view controller which sets the view options for different devices, I had accidentally set it to "wCompact hCompact", this setting will default the image to landscape image of storyboard on simulator. In the simulator though I was viewing it in Portrait mode. Attaching the screenshot with this setting.

XCode can't fix landscape orientation layout in storyboard

I have a simple linear chain of UIViewControllers.
The first one has a show segue to a NavigationViewController, then it goes on the same way with all the others.
When I switch from wCompact-hRegular to wRegular-hCompact to fix the landscape layouts the first viewcontroller doesn't allow me to do anything. The tree diagram at the left side of the storyboard screen shows the views but they are not written in black. They are transparent. Even if I select them and put the coordinates or dimensions nothing happens. There are only a button and a label. Others Controllers are all ok, they can be fixed. What is happening to the first one?
With XCode 6 you can add views, that are only visible in the selected size class (f.e. Compact + Compact). When you change to a different size class the views are disabled. To fix this navigate to the attributes inspector and select installed for any class sizes.

different storyboard in Xcode/iOS simulator

Suddenly my storyboard changed and it only displays one of the four textfields. When I run the code in the iOS simulator, I see all the four text fields.
I'm quite new to Xcode and would like to know how I can change my storyboard back so I see the same as in the simulator. It was right before.
A screenshot:
You probably haven't updated the frames of the text fields to match your auto layout constraints. Click on tie-fighter icon (|-Δ-|) in the button bar under the canvas. Here you can choose "Update frames" for all views.

Resources