我正在尝试将swift应用程序从mvc转换为mvvm。我已经把大部分逻辑放在视图控制器后面的视图模型层中,但很难清楚地调用segue的alertcontrollers。
这些显然需要从视图控制器调用,但调用它们的逻辑是在ViewModel中制定的。我想不出一个优雅的解决方案来解决这个问题。
感谢
您可以使用这些函数创建一个协议,以便能够在视图模型中调用其函数
我正在尝试将swift应用程序从mvc转换为mvvm。我已经把大部分逻辑放在视图控制器后面的视图模型层中,但很难清楚地调用segue的alertcontrollers。
这些显然需要从视图控制器调用,但调用它们的逻辑是在ViewModel中制定的。我想不出一个优雅的解决方案来解决这个问题。
感谢
您可以使用这些函数创建一个协议,以便能够在视图模型中调用其函数
javascript python java c# php android html jquery c++ css ios sql mysql arrays asp.net json python-3.x ruby-on-rails .net sql-server django objective-c excel regex ruby linux ajax iphone xml vba spring asp.net-mvc database wordpress string postgresql wpf windows xcode bash git oracle list vb.net multithreading eclipse algorithm macos powershell visual-studio image forms numpy scala function api selenium