Problems with Custom UIViewController

Good time, I have a problem with creating Custom UIViewController. Some info:
1) This Custom Controller created in Library, not in MainProject
2) Custom UIViewController code:

[DesignTimeVisible(true), System.ComponentModel.Category("Test VC")]
[Register("TestVC")]
public class TestVC : UIViewController
{
    public TestVC(IntPtr a) : base(a) { }

public override void DidReceiveMemoryWarning()
    {
        base.DidReceiveMemoryWarning();
    }
public override void ViewDidLoad()
    {
        this.View = new UIView();
        base.ViewDidLoad();
    }
public override void ViewWillAppear(bool animated)
    {
        base.ViewWillAppear(animated);
        this.TabBarController.TabBar.Hidden = true;
    }

    public override void ViewDidUnload()
    {
        base.ViewDidUnload();
    }
}

3) I use VisualStudio 2017 version 15.5.3 (also i had this problem on 15.5.2, 15.6 Preview 2.0) on Windows 10 1709 + MacOS X 10.13.2, XCode version 9.2
Problem:
I see this element in Elements ToolBar, but when I try Drag&Drop them to storyboard it not attaching. If I try to create UIViewController and in Identity->Class Set my class I had error.
"System.InvalidCastException. Specified cast is not valid. at as offset 2 in file:line:column :0:0 at UIKit.UIWindow/set_RootViewController (UIKit.UIViewController value) in ... at MonoTouch.Design.Server.Renderer.EmbedViewController ...

Sign In or Register to comment.