iOS - dependent constraints console output with autolayout - ios

I am making an iOS app that uses popovers on several occasions. I get the following output message to the console every time one specific popover is dismissed (but not when any of the other popovers are dismissed):
All dependent constraints should have been removed from the engine and also from the view's list of dependent constraints
I have searched Google and this site for that phrase and nothing has come up. I am not sure why it would happen for only one popover and not others. Would it have something to do with its view controller? The popover itself? I am an autolayout novice, so there may be something simple I'm missing. Any ideas?

I too had this issue i solved it by removing the Use AutoLayout checkbox from the XIB, the auto layout XIB is present in the file inspector option.
Hope this helps

Related

UITableViewCell's contents disappear when app run in simulator

UITableViewCell shows up in Main.storyboard but doesn't show up in simulator.
I'm using Main.storyboard. In my simple experiment with Swift, I added a TableView, then put a UITableViewCell in it, and then I put an image and a label under the cell's content. It looks okay in Main.storyboard but when I run the project, the content disappear. All I did is purely on Main.storyboard and not touching the .swift file yet.
Here are the links of screenshots of my simple work:
How my app looks in Main.storyboard
How it looks when I run Xcode simulator on iPhone 8, the tableview cell's content disappear
I have searched the problem through the stackoverflow and found a related question here: 'UIImageView doesn't show up in simulator', then I followed the recommended solutions from the forum but still didn't solve the bug.
What I have done so far to solve the bug:
Check if every item in my view has four constraints defining X, Y position, width and height.
Try to check and uncheck the autolayout flag for my Main.storyboard
Make sure my tableview cell's contents (and everything inside my view) has alpha set to 1
Well I haven't check how things looks in my .xib file.
I would like to know if this is a bug, or just a problem in my settings?
I'm quite new to Xcode, swift, and iOS app. Any help or suggestion would be greatly appreciated. If you have the same problem with me, I would like to know your case as well.
The only reason your cell doesn't show up in the simulator is because your tableview is dynamic.
Dynamic table views have data that is loaded at runtime, where there isn't a fixed number of cells, and every cell has the same layout. The Apple tutorial is a good place to start. It guides you through on how to use a tableview/tableviewcontroller.
There is no way around it: You have to code in .swift files if you want to use dynamic table views.
If you are going to use static table views, on the other hand, the number of cells is fixed, and the data is not loaded at runtime. You can use static tableviews if you don't want anything to do with code at the moment.
I had a similar problem. I solved it by deleting constraints for the affected view and starting all over.

Storyboard of a mockup

I am working on an e-commerce based app, and the designer has passed on the mockup to me. !
This is the mockup the designer has passed.
I am working on storyboard of this mockup and I have managed to get to this level as of now.
There are several views and features which cannot be included in this storyboard now because of the limited space. I know the designer has passed on me the rendered view, which can be seen on scrolling the app.
I wonder which could be the best approach to include all these views in a single storyboard or render them in a single view.
I have looked onto using xib files and calling them from my viewcontroller class, which could be a possible solution. But, I want to know, what could be the best solution?
Best solution is use Storyboard so that you have all screens at one place. But keep one thing in mind that start doing the whole project in XCODE 8 storyboard (Because XCODE 7 and 8 storyboards are not fully compatible with each other). So that you get compatibility with previous iOS versions also (< iOS 10)
Now as far as design is concerned, I would like to suggest you use autolayouts and proportional layout.
your View controller will always have self.view. Start on that view. First add navigation controller (with root view controller as your first prefered view controller on app start) or simply add one toolbar. Then add one UIScrollView to whole remaining space. Then start with your design inside UIScrollView. Don't forget to provide contentSize of UIScrollView.
For any help, feel free to ask.
The best solution would be using a tableView with multiple prototype cells for this kind of problem. Well, going through the concept as mentioned, I could easily scroll in the storyboard and maintain my design as per the mockup.

Can't add missing constraints Xcode 6

I have just finished an app which I will only be releasing on the iPhone, no iPads. Clearly there are different sized iPhones so I had to fix up a few layout issues in my project.
Apparently a nice way to approach this is to simply select the views and 'add missing constraints'.
When doing this I get the following error message:
I have tried clearing the constraints, but no look.
When I click 'reveal diagnostics in finder' I am directed to zip file named 'IB-layout-diagnostics_2015-07-08_13-57-41_336000' containing log files and simply can't decrypt it.
Has it something to do with the fact that I have the app completed, and am accessing some of the views programatically in Swift?
In the development info I have the device set to iPhone, the device orientation to Portrait, and I have 'Use Auto Layout' and 'Size Classes' checked.
Any ideas why I'm getting this error? Thanks in advance.
This answer may not be specific enough. But if anyone else is having the same problem this is the solution I found:
Copy all views from inside the Table View Cell, into some other temporary View Controller
Delete all views from Table View Cell
Select all Views in Controller and add missing constraints (Works now!)
Add views back to Table View Cell
If anyone has an alternative solution which can be explained to me, feel free to answer or edit this one. Thanks.

Why don't my views show up in Storyboards and are greyed out in the left pane?

I am experiencing a weird bug in Storyboards.
I set up a UITableViewController with prototype cells and set some autolayout constraints. Everything fine until here.
Then, I had to move the whole project directory into another folder. This is a normal action I believe that shouldn't lead to any problems since the app and all the files are pretty much self-contained.
However, since I moved the project, the prototype cells in the UITableView are shown empty within my Storyboard, but the subviews are still showing up in the left pane where all the scenes and views are shown... Only that they are greyed out (see the screenshot)... Does anyone know what this means? I also looked into the XML of the Storyboard file, but everything seemed normal to me in there...
Any ideas?
EDIT: Strange thing also is that the IBOutlets from the custom classes still are set and link to the views in the storyboard... but only in the left pane, not in the storyboard itself.
Just found an answer myself, it was because Size Classes were reset after I moved the project...
Greying out views is Xcode's standard behaviour when the views are only set for a specific size class which is currently not selected!
I had set the size classes for my UIViewController to Compact - Any, this is what it looks like in proper state:
The problem occurs when I change the size classes to another one (e.g. Any - Any):
This happened to me because I copy and pasted some of my views from nib into storybaord. Turning size classes off, and turning it back on fixed the issue. This can be done in File inspector, using a checkbox named Use Size Classes

Typing in one UITextField results in not being able to type in any other UITextField with a UIViewController, UIScrollView and AutoLayouts

I have a simple application with a view controller consisting off 3 UITextFields, a DatePicker and a Segment Control.
I have spent a ton of time getting my ViewController scrollable with AutoLayout and a UIScrollView (entirely in Storyboard). The problem I'm getting now though is when I start typing in any one of the UITextFields, I'm suddenly not able to type in any of the other text fields, though I can dismiss the keyboard, select dates in the DatePicker and select segments in the Segment Control.
This was of course not the case before implementing the scroll view and this is only occurring on the actual device rather than in the simulator (emphasising the importance of testing on a device).
I have read through a few SO answers but none of them seem to work.
Please see a screenshot of how my views are set up:
I've also gone onto the UIScrollView and ensured the following three are unticked:
I've enabled and disabled each of them individually but with no luck.
It took a ton of time to get the AutoLayouts working so I honestly hope I won't have to adjust too much here.
My thinking is that because I'm trying to click on a textField, perhaps the View is treating that as I'm wanting to scroll also. Though of course, when I first invoke this view controller, I can click on the 1st, 2nd or 3rd TextField while scrolling, so that makes sense no sense.
One SO question said it was a bug during the iOS 7 beta phases, but my device is running iOS 7.0.4.
My scrollview doesn't have an outlet because this entire procedure was done using Storyboards, but I'm happy to create one if need be.
Reading the Apple docs, it looks like delaysContentTouches is exactly what's required here, but that's turned off in my UIScrollVIew.
Basically any suggestions or assistance with this would be massively appreciated - it's driving me mad!

Resources