How to Add Custom Swift View Control in Xcode - xcode

I looked for a custom label with marquee feature. So i decided to implement this from git: https://github.com/cbpowell/MarqueeLabel-Swift
I downloaded it as a zip file and copied the .swift file to my project. But when I open Main.storyboard, I could not find the MarqueeLabel in the list of views.
How should I properly add this custom label?

I would try to add QuartzCore.framework as it stated in the documents. Then try to add the MarqueeLabel through code instead of using storyboard to see if it would work that way.

It won't be in the list of views. Create a UILabel as normal, then select it in the identity inspector and change its type to MarqueeLabel.

Related

NSPredicateEditor row templates not configurable in interface builder

I'm creating an assistant sheet in my storyboard in interface builder. The viewController contains an NSPredicateEditor and is connected to a property of the viewController using cocoa bindings.
However, I'm not able to properly configure the row templates. When I uncheck one of the predicate operators, I'm not able to re-enable them, nor I'm able to use any of the other provided operators.
Doesn't Xcode support NSPredicateEditor anymore, or am I doing anything wrong here? Just to be clear, I'm not having any code jet.
This is a bug in Xcode. I tried this with and without storyboards and had to force quit Xcode in both cases while configuring the binding. Close and open the project and try to modify the row template before doing anything else.

Unable to find UIView in UIStoryboard

I'm using Xamarin.iOS in Windows. Everything is working fine except:
Sometime ago, I'd create a UIScrollView named MyScrollView inside an UIView at MyViewController.
Right now, I can use it normally programatically like:
MyScrollView.AddSubview(myButton);
The problem is:
I can't find the MyScrollView at the Storyboard Designer. I want to change some properties at the designer.
Question 1:
Is there a way to delete it and recreate since I can't find it at designer?
Question 2:
Is there a way to use a search at the .storyboard file?
EDIT:
Even if i right click over my UIView at the UIViewController, the Context menu doesn't shows the UIScrollView.
For some reason, It was created at the storyboard back-end, however it was just not showing at the Designer.
By adding the same component with the same name: MyControllerView it didn't duplicate, and assumed the original position.
Note: Special thanks to #Yuri S. It didn't solved by this answer, but i didn't know that i'm able to edit the storyboard via XML. So lesson learnt.

Xcode 4.3: how to create a nib linked to a view controller

Sorry, I'm quite new with xcode with a quite big project.
I upgrade xcode to 4.3.
I have a project (that doesn't use storyboard) and I need to add a view controller with a nib file.
Before upgrading I did File --> Ne File --> Cocoa Objective-C subclass and xcode created for me the m/h and their nib file.
Now that that option is disappear, how can I add a view controller?
I created the Objective-C class and, separately, a nib file, but how can I link the H/m files to the nib??
How can the m file call is nib??
Please can you help me? The project is real big and I can rewrite the code with the storyboard option!
Thanks
When editing your XIB, go to the Identity Inspector (it's the third button show in the following image). Then where it says Class, choose the controller you want to associate with the XIB.

How can i make a .XIB from .h and .m files?

I'm working on an existing project which I basically need to create a .XIB
so I can then put in UIToolbar and UIButtons ect.
On the App already it has a Tab bar but has been inputted through code and not the Interface Builder.
I would appreciate any guidance on my problem.
Kind Regards.
There is no automatic code that does this for you. You'll need to look in the code, find all UIView instances that need to go into the nib and manually create it. Then you'll have to be sure to set the frame of each of them to the same positioning as what is defined in the code. Finally, you'll have to be sure to remove all of that from the code (once it is fully migrated to the nib). Finally, you'll have to be sure that the components are referenced only after the nib has fully loaded (which might not have been the case in the current code).
Why not keep the components in the code (and just use nibs for new views)?

Xcode 3.1 localization: If I change the interface, do I need to change this for each localization?

I've just made an application in Xcode, and I'm trying to localize it. I right-clicked (Ctrl-clicked) my .xib and clicked 'Get info'. I added Dutch to the list of localizations and Xcode made copied my .xib file. Do I need to change the .xib file for every single localization when I make an adjustment? Or is there another way to do it?
Thanks in advance.
You can use ibtool to apply incremental changes to the localised XIBs without messing up any of the translation, or existing layout changes you've made to accommodate the different text lengths. Look particularly for the --localize-incremental option.

Resources