Remoting from pc to mac + Sharing storyboard between two iOS projects -- How?

SteveShaw.5557SteveShaw.5557 USMember ✭✭✭
edited December 2017 in Xamarin.iOS

VS 15.5.2 (on WIndows), which incl. Xamarin and Xamarin.iOS
Community License

What works, both directly on Mac, and when remoting from PC:

Adding a storyboard to an iOS project, and setting its Build Action to "InterfaceDefinition".
1. rt-click on project, Add New Item, C# / iOS / Empty Storyboard.
or 2. rt-click on project, Add Existing Item, select a .storyboard file; then change its Build Action to "InterfaceDefinition".

--- Now try to do 1 and/or 2 in a shared code project (not a PCL), included in two iOS projects. ---

What doesn't work, working directly on Mac:

For 1. There is no "iOS" sub-menu.

What doesn't work, when remoting from PC:

For 1. There is no "iOS" sub-menu.
For 2. There is no "InterfaceDefinition" choice in Build Action menu.

Presumably problems happen because this shared code project is not an iOS project; it is just code to be included in other projects.

Attempts to work-around:

On Mac:

A. Create the storyboard in the iOS project, remove it, add existing file (that you just created) to the shared project, set Build Action to InterfaceDefinition.

The result looks fine on the Mac; but the storyboard file is NOT SHOWN in PC's Solution Explorer.
CAUSE: "InterfaceDefinition" line in ".projitems" is IGNORED on the PC in a shared code project.

(Interestingly, PC can still Build and Run the iOS project that includes that storyboard, and navigate to the storyboard in the remote simulator.
I think this works because of the "InterfaceDefinition" line in ".csproj")

Remote from PC:

A. -- Can't do, see "2." above.

B. Create the storyboard in the iOS project, close the solution, manually cut/paste the corresponding "InterfaceDefinition" line from the iOS project to the shared code project. This line must be added to both ".csproj" and ".projitems".
(That is, MANUALLY do the equivalent of "A" on the Mac.)
RESULT: Can build and run the app fine, but the ".storyboard" is not listed in the shared project, so can't edit it on the PC.

C. Like B, but change the line in ".projitems" to have "None" for the Build Action.
RESULT: Visible in Solution Explorer, can double-click to edit it (storyboard editor opens it),
BUT it is omitted from the build, so can't navigate to it in the app.
(I was hoping that having "InterfaceDefinition in the .csproj would make it work, even though is "None" in .projitems.)

The combination of behaviors in "B" and "C" tell me that VS on PC is perfectly capable of editing shared storyboards - IF it realized that "iOS" items are valid in a shared project.

For now, my work-around (to edit storyboards on PC) is to include them directly in an iOS project (not a shared project).
I haven't yet tried to have a project be BOTH an iOS project AND use it as a shared project.
Is that possible? Maybe by manually editing .csprojs?

Better suggestions?

Should I file this as a bug or feature request?

Sign In or Register to comment.