Main.Storyboard Frames Not Updated - ios

I am currently making an app which I plan to submit to the iOS App Store. Normally, when I update my frames in the Main.Storyboard of Xcode, it stays like that. However, now it does not. Whenever I close the app and reopen it later, the frames are not updated. It looks like this:
After I update the frames, it looks like this (what I want it to look like):
The app still looks fine when I run it on the simulator, but I still have 16 warnings in my app. I would like to remove these bugs as (I previously mentioned) I am submitting this app to the iOS App Store. How can I fix this? Thanks.

1)As it showing you have designed the layout in size class width-COMPACT & height-ANY. If you design your storyboard in size class width-ANY & height-ANY it will solve your problem.IT also happened with me.I have changed the size class & updated constraints of all ViewControllers.
2)It now shows a blank view controller. However, You will not get any warnings
3) Now You can make it visible by changing size class of the views inside the controller
select the view ->go to attribute inspector->go to bottom-> select installed & delete earlier selected size class
4)Do it for all views & update the constraints

Related

Custom class not automatically showing up - Swift 3 iOS 10.2 Xcode 8

So I have my app set up with two view controllers. The first one is my initiation screen, where the app starts, and the second is one the user can navigate to. I added the second one later on in my development, but when I went to the right column under the identity inspector, my new Cocoa Touch Class file is not populated for me to select. Now if you ask me to just type it in, I've tried that, it does not seem to connect. I've tested it by printing a simple line in the viewDidLoad() of the new second class when it is loaded in the simulator, but nothing is printed. Any help would be greatly appreciated!! Thanks!
EDIT
Easy fix is:
Select the activity indicator on storyboard and go to identity inspector and copy the object id. as image: ObjectID_ActivityIndicator
Right click the storyboard file which has the view controller you are working at.
Open as > Source Code
Press command + F to find and look for the id you copied previously
Paste this: customClass="yourclassname" customModule="moduleNAme" customModuleProvider="target"(don't change this target word, you can choose desired module from identity inspector if any).
Command + S to save it and again right click on storyboard file > openAs> Interface builder
Now select activity indicator again and go to identity inspector. You will now see it there. You can also change it as per requirement.
Enjoy. I faced this problem today and found no help online. My class and module field were greyed out. Tried this fix and it worked.
Note: Make sure your custom class is accessible and is in app directory i.e it's not highlighted in red color but gives a normal look.
I have seen a problem like this where the solution was to change the "Module" to a specific value, close the storyboard, reopen it and delete the "Module" setting (assuming it was originally blank or restore it to its original value). This happened in project with many targets and their names may have changed.

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 crash on opening storyboard

I am developing an app for iOS with Xamarin. Lately, I haven't been able to access my storyboard file in Xcode or compile my app anymore because Xcode crashes right away when opening the .storyboard file.
The error message is the following:
ASSERTION FAILURE <br>
Details: Creating an out of band arbitration unit with a view (<IBUITableViewCell: 0x7fa88d13a5d0>) as the root under another view (<IBUITableView: 0x7fa88cf000e0>) is not yet implemented.<br>The view would need to be in two arbitration units, the one above for positioning constraints, and the root of the one below for sizing constraints. <br>But then that means that subviews cannot have constraints that affect the size of the view, so the view must have ibExternalTranslatesAutoresizingMaskIntoConstraints set to YES.
<br>Object: <IBUITableViewCell: 0x7fa88d13a5d0>
<br>Method: -ibArbitrationUnitWasCreatedWithReceiverAsRootUnderParent:
I tried rebasing my storyboard to the last version that worked (the one the app was submitted to the app store) and weirdly, even that version didn't work.
My plan was to manually remove and every view controller and add them one by one to figure out where the error is.
However I don't understand why XCode crashes when opening the storyboard and not just shows me exactly where the error in my xml is.
So if anyone has encountered this problem before and has a better way to fix it than to manually do it, I would really appreciate any help.
ibExternalTranslatesAutoresizingMaskIntoConstraints needs to be YES
Sounds like the Storyboard was created with an older Xamarin.iOS that introduce this issue.
The fastest solution is to open the storyboard in vi (or Xcode / View As Source, or another text editor of your choice, and replace all translatesAutoresizingMaskIntoConstraints="NO" with "".
Save the file, re-open it in the Storyboard editor and fix your contraints.

WatchKit reloadRootControllersWithNames causing error, with pageController or after push/pop

I have a basic watchkit app that loads a page based navigation of 3 interface controllers. This works well, but I'd then like to trigger an action to remove the page-control and essentially revert back to the original InterfaceController that was present when the app first loads.
// load page based control, with 3 views. this works ok
[WKInterfaceController reloadRootControllersWithNames:#[#"pageController1",#"pageController2",#"pageController3"]
contexts:#[#"data1",#"data2",#"data3"]];
// attempt to reload original interface controller, identified by storyboard id
[WKInterfaceController reloadRootControllersWithNames:#[#"myInterfaceController"] contexts:#[#{}]];
The page based navigation remove, the original navigation loads after a short spinner. However it fails to function correctly and original Actions result in this error.
Extension[6766:123665] *********** ERROR
-[SPRemoteInterface _interfaceControllerClientIDForControllerID:] clientIdentifier for interfaceControllerID:(null) not found
Is there a better way to cleanly reload the original InterfaceController?
EDIT, 2/19
It seems there are some other actions that are causing this error too. For instance, if segue to a second InterfaceController and then popController to get back, the error often appears. It is always related to a secondary call to this function.
[WKInterfaceController reloadRootControllersWithNames: contexts:]
EDIT2, 3/18
As previously mentioned, this is reproducible 100% of the time by doing the seguePush, the popController, then attempting to reloadRootControllersWithNames.
If the seguePush/popController is not done beforehand, then the reloadRootControllersWithNames will work fine.
This situation seems to be in addition to the multi->single-multi instance of this bug.
This is actually not a bug because according to Apple:
You cannot combine hierarchical and page-based interface styles. At design time, you must choose the style that best suits your app’s content and design for that style.
So unfortunately, we can't mix Hierarchical and Page-based navigation patterns within the same Watch app.
Just one of many limitations we have to deal with when developing apps for  Watch
This is a bug in WatchKit in Xcode 6.2 Beta 5. Please dupe the following radar on Apple's Bug Reporting System to help raise the priority to get this fixed.
In the meantime, a workaround that I've found can be found on the dev forums. What you can do is add a dummy interface controller to any single interface controller page set so you always have two. This will fix the error until Apple get's the bug fixed (hopefully in Beta 6). Please dupe!
I was able to solve my instance of this problem by not using popController on a pushed view controller. Instead I use a reloadRootControllersWithNames in place of the popController.
How this allows both push and paging, via an example:
Push a view controller
reloadRootControllersWithNames to return to the original controller. (The transition is not quite as animated, but is sufficient)
Create page based view controller.
reloadRootControllersWithNames to return to the original controller
Repeat 1 or 3 as needed.
This eliminates the error at the cost of non-animated popControllers, and allows partial pushing and paging. It would not allow more complex push navigation though.
There may be a better method of navigating to a sub interface controller without a push call, but I'm not aware of it on the watch yet.
None or the answers above worked for me. This problem began when I changed the icon names for the app and the watch app name. I solved it like this:
1) Click on your Watch app Target > Capabilities > make sure app Group
is in ON.
2) Make sure the App Group is selected.
3) Clic on the circled arrow Refresh icon (this will apparently just
refresh this thing if you already had it)
4-Repeat steps 1-3, but for your Watch App EXTENSION target too.
5-Click on the Scheme button (on the right side of the STOP button),
and clic on Edit Schemes.
6-Click Run > Info 7-In executable select your target (Actually it
should already be selecting but opening this window seems to
refresh the option, and wipe the error)
Apparently all these things above are not updated automatically when you change the icon name (Target names) and you have to go to those menus and open them to refresh them manually. Shame on Apple perhaps?

why storyboard ui elements not showing on UIViewController in xcode 6?

I am new to IOS development. I am developing an app for IOS 8 devices. I used storyboard for my design yesterday my storyboard showing all UI design but today morning it show blank UIViewController no UI element vision please see in screen shot and very strange thing is that when i run my app all ui element visible in my device. I google but dont find any solution please help me out. Thank you in advance.
It looks to me like you are using size class and you went into a particular size class and added these views. Now you are back in Any size class, so the views are not there (that is why they are greyed out in the document outline at the left). They are available only for that particular size class. If you switch back to it again, whatever it was, you will see them again. Basically, you have created conditional views - the condition being that they are present only when that particular size class situation is the case.
In other words, if you want your layout to apply in the general case, you want to start by creating and editing it under Any size classes. Only then do you switch to a particular size class and modify the layout for that particular size class.
when i run my app all ui element visible in my device
Yes, because on your device the particular size class situation matches the size class you were editing when you added those views. So there they are. That seems to me to prove my guess is right.
I have the same issue while copy a ViewController to another storyboard.
Fixed by following steps:
1: Select the viewController
2: Click on 5th Tab
3: Set the simulated size to Fixed.
Select install:
Since all components [like label,textfield,buttons] are in disable mode, one select Installed check mark its will be enable again adjust constrain accordingly.
The size must be the same, in all xcode storyboard
In my case, it was due to me setting alpha to 0.0 and forgetting it.

Resources