1

How can I put in a string variable the name of the current storyboard Ive got this for objective-c

UIStoryboard * storyboard = self.storyboard;
NSString * storyboardName = [storyboard valueForKey:@"name"];

but I have to pass it to Xamarin iOS

SushiHangover
  • 73,120
  • 10
  • 106
  • 165

2 Answers2

2

Xamarin.iOS:

var storyBoard = this.Storyboard;
var storyBoardName = storyBoard.ValueForKey(new NSString ("name"));
SushiHangover
  • 73,120
  • 10
  • 106
  • 165
0

You can also try this in the storyboard's custom ViewController:

NSString storyboardId = (NSString) ValueForKey(new NSString("storyboardIdentifier"));

To get just the string, you can simply use storyboardId.ToString() (NSString function), though NSString mostly behaves the same way as string, e.g. in Dictionaries.

converted to C# from Swift from this answer: Programmatically get a Storyboard ID?

sschmidTU
  • 132
  • 5