How to add referencing outlet in xcode when only editing storyboard

Phunction 301 Reputation points
2022-06-02T00:09:23.603+00:00

Hi, I am using VS Xamarin on a PC with a Macbook for compiling. I used to use the built-in editor to edit storyboards but that was removed a while back.
The question I have, when I edit the storyboard file on the mac and add a button, how do I give my button and ID? There used to be a field for this before but I can't find it in XCode.
It looks like I would use a Referencing Outlet, as I can see my control IDs/Names from previously added controls (old way), but it will not let me do anything with it.

Is it possible to do so when editing just the storyboard, I can add it to the xml file manually but that is a pain.

I don't really want to use visual studio on the mac as it is not my main development machine, don't really want to go from a 24" screen to a 13" screen for developing.

Thanks for any help.

Developer technologies .NET Xamarin
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2022-06-02T09:50:27.3+00:00

    Hello,

    It looks like I would use a Referencing Outlet, as I can see my control IDs/Names from previously added controls (old way), but it will not let me do anything with it.

    There are no control IDs/Names now, you could refer to this doc to create a new control, open both the storyboard and the corresponding view controller header file. Holding the Control key (^), drag the control from the storyboard to the view controller file(.h file). This control will be a property of your controller, and you can get the name.

    In addition, starting in Visual Studio 2019 version 16.9, there will be no supported way to edit iOS storyboards on Windows. Use Visual Studio for Mac and the Xcode Interface Builder to continue building your Xamarin.iOS user interfaces. You have to use VS for Mac.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.