Unable to find UIView in UIStoryboard - xamarin

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.

Related

Search Bar doesn't register input

I created a MapView and a SearchBar in a .xib file. I loaded the xib file into a ViewController was testing it in the simulator. The MapView works as it should, but the SearchBar doesn't register any input. Whatever key I press on my keyboard, the SearchBar just shows my cursor and the placeholder text. I used the SearchBar in another project to see if it works there and it does. I can type whatever I want to in there.
I don't know why it doesn't work in my loaded .xib file. Doesn't it work in .xib? I also cleaned and rebuild everything and made sure that user interaction is enabled. I enabled it in code and Xcode.
Here are my attributes for the SearchBar from Xcode. I think everything is right but maybe it helps.
Any ideas?? Thanks in advance!
Edit:
I found out that I'm not only unable to make an input, but also can't add (or see) a scope bar to the SearchBar. Again, I could add it in another project but not in this current one. No matter if the scope bar is enabled or disabled, I can't see it when I click on the SearchBar.
It turns out that I had a problem in my SceneDelegate. I still don't understand why and how this error occurred but I somehow missed this in my SceneDelegate:
this.Window = new UIWindow(scene as UIWindowScene);
If you are experiencing the same issue or want to know why, here's another question I've found with the working solution

How to find the editor for multi view controllers

I am very new to xcode, got stuck in finding the editor to modify the code when created multiple view controllers. Whenever I click on any of the view controllers, I only see same editor contents and cant move to the others for coding.
I searched the web and stackoverflow but could not find a clear guideline on how to manage the editors for multiple view contollers. I have attached a snapshot.
You don’t “find” code. You create it.
When you drag a view controller into the storyboard, it has the default class of UIViewController. It is up to you to make a new code file where you subclass UIViewController, and then to go back to your storyboard and change the view controller to that subclass in the Identity inspector.

Having Trouble Making a Button in Xamarin.Mac/XCode-Storyboard

Let me start off by saying I am new to XCode, but already very experienced in C#. I am having trouble getting the outlet for this button, and every time I try to Control drag it under ViewControl it only lets me do action! I have been googling for about 3 hours and trying to find tutorials, but everyone else's code looks different by default :(
You are trying to drag into the ViewController.m file, you need to be in the header file (ViewController.h) to create an Outlet.
Change the file being edited:
Now Ctrl-Drag into the .h file:

Connecting code to UI in storyboard with multiple ViewControllers, Xcode

I have a storyboard project in Xcode. I have added an additional ViewController and dropped in a button, text box, etc. I can get from the initial to the secondary View Controller, but I cannot seem to be able to connect the button to the code. I've tried adding additional classes with XIBs and even from a blank adding in the XIBs. How do I connect the code I have written for a button to do work on the second View Controller?
If you have the button created on the storyboard. You have to make an
-(IBAction)clickButton...
in the .h and .m code files. You can easily connect the code to the button by dragging the line from the dot (in front of the code name) to the button.
If you have created the Button fully in code. You have to specify which code to be executed on click.
[self.buttonName addTarget:self action:#selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
Here's the answer. You add new files to your project, and just for giggles, we'll call them NewViewController of the UIViewController class. Then, highlight the second view controller in the storyboard, choose identity inspector, and under Custom Class (at the top) you change the class to the name of the recently added NewViewController class. Now, all your code will connect to objects and so on. Thanks again for the help all and now I can rest in peace lol.

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)?

Resources