天天看點

SWIFT中切換UIContainerView內的Controller

如下,一個UIContainerView内切換兩個Controller,當點選登入的時候UIContainerView的視圖為LoginController,當點選登記的時候UIContainerView中的視圖為RegisterController

SWIFT中切換UIContainerView內的Controller
SWIFT中切換UIContainerView內的Controller

在主視圖内先做兩個按鈕的事件。這個不用說啦。當觸發按鈕事件的時候調用以下代碼就可以。