Xcode Interface Builder loading XIB file show view with transparency - xcode6

Something weird is happening with some of my xib files of my project.
I have one xib file where my view hierarchy not appear on live preview frame and those views appears with transparency.
See the screenshot below:
Now the most weirdest think, I can't restore other states of this same file in my source history, but Xcode loads this same file, from different history states exactly same like the screen shot above.
Maybe because I have two versions of this same xib, both is for different languages, anyway, the file is not same, each localised file are stored in different directories.
I'm just curious to know if someone got this problem before and if have some solution for this.
Thanks.

Ok I found the problem.
This behaviour is default in Xcode, this means the views aren't installed for the current size classes on canvas.
I just changed to the size classes I defined before and looks fine now.

Related

iOS Swift - Dynamic Storyboard

I am currently developing a new iOS app which is basically a decision tree app. All the data comes from an XML file (list of questions and logic path depending on answers). The XML reading is not a problem.
I know I could develop this by hardcoding everything in the storyboard, but I don't find this efficient. Design-wise, I don't know where to start to sort of build the storyboard dynamically. What stops me is that, based on what the user answers, some paths have different number of levels (or questions); so different storyboard screens.
Any help would be much appreciated!
You may want to build your views "manually" from code.

Cocoa user can set screen size

I'm completely new to Cocoa and Xcode. I started using it a couple of days ago, because I have to build a little tool for macOS.
After hours of research I still can't find a solution for my problem.
What I need to do:
A window with a Quartz Composer Patch QCView (everything working) which resizes with the window the QCView is in
There should be a second window with two text fields (with Number Formatter and editable).
Those text fields should show the current resolution of the window with the QCView
The user should also be able to type numbers in the text fields to set the size of the QCView (x and y)
As I mentioned above, I'm not really experienced in Cocoa, Xcode, Objective-C or Swift.
If someone could give me some hints how to accomplish those tasks would be great (especially with which parts of the code have to be put in the .h and .m or .swift files).
Thanks for your help!

Create views for different versions of the iphone

I'm creating a project that will run on versions, since the iphone 4 until iPhone 6 We all know that the resolution of the screens are different for each device.
In my case, to get around this I created three files .xib type, and in each one I modified the size of the view in xcode inspector attributes tab to stick with the same size of the devices.
I wonder if this way I'm doing is correct, and if there is no other better?
Of course. You should use AutoLayout.
Check the manual.
How it works at a glance: you just setting different relations between views in Interface Builder. It looks like:

xcode view size smaller than iphone

That never happened before iOS 6.
Now, I create an "auto layout", and I realized that the size was different in xcode, because the image was large but was correct in photoshop. When creating the app in the simulator, I have this:
I kept finding weird. So checked the size of the iPhone 5 and moved, as I always did, then looked like this:
When creating the app in the simulator, looked like this:
I wonder what happened with Xcode? Someone went through this already?
Thank you
It looks like you are working with an XIB that was identified as for iPad. In the Attribute Inspector, what options are you given under size? An iPad XIB has these options in Attribute Inspector - Size:
If that is what you see, you may have to create a new XIB, and be sure to choose Device Family - iPhone.

mfmailcomposer cuts end of html email

I've created an in app email feature to ask a question that opens the mfmailcomposer and fills it with html content. Unfortunately it seems to cut off the final line of the email so it appears as the image below.
I have set the mfmailcomposer to self, followed every tutorial I can find, the only reference to fix it has said the following:
make sure your mfmailcomposer is set to self ie. [self presentModalViewController:email animated:YES];
make sure it's embedded within a navigation controller
Neither solution works.
I have found that if the email contents is short enough that the entire email fits on screen the problem doesn't appear but if you continue typing to push the contents off the edge it reappears.
Any ideas on a solution? Or is this an Apple xcode "design feature"?
I managed to resolve this issue, it seems to be a bug, that's the only explanation I can reach.
If the start of your content is a header (<h1>, <h2>, <h3>, etc) tag (even if it is within a HTML and BODY tag) it creates this issue.
If you want to start your email body with a header tag then the simplest way of fixing it is to add a non breaking spacer before the header tag, it seems to completely resolve the issue.
Possibly a framework bug. Does it occur on different versions of iOS? Try it with both older and newer versions of the operating system and on other devices.
Are you 100% certain that the view is not actually larger than its container view? Explore the view hierarchy. Perhaps in plaintext Apple adds some spacing, so it doesn't seem like the content is out of bounds of the parent view, although it is.
How do scroll indicators behave? Are they also clipped?
Are you presenting the message composer in a fullscreen view? If you're trying to present it in a view that is controlled by a sub-controller of the tab view controller, that might cause the composer view controller to be confused.
For what it's worth, I've just tested my code which generates HTML content, and there is no clipping. This is on iOS 4.2.1 on iPhone 3G, but I don't remember seeing the problem on iOS 5.1 either.
Some tips.
While debugging, don't forget: view controllers are actually just managing views that still have their own hierarchies. To clarify, view controllers may have a hierarchy, but their hierarchy does not necessarily correspond to view hierarchy. (Although it should in the near total majority of cases.) Same thing with views themselves: they have their hierarchy, but they still just control the underlying Core Animation layers, which have their own hierarchy.
You can always access view hierarchy itself and explore it in greater detail through debugging facilities you come up with yourself. What you shouldn't be doing is meddling too much in parts of the view hierarchy that's supposed to be managed by the view controllers, just like you shouldn't mess too much with the parts of the layer hierarchy that's supposed to be managed by the views.