ios storyboard 獲取storyboard中的viewController

星星月亮0發表於2020-12-04
import UIKit

class CBhelpManager: NSObject {

    static let shared = CBhelpManager()
    
    func getViewController(storyboard: String, viewController: String) -> UIViewController {
        let storyboard =  UIStoryboard.init(name: storyboard, bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: viewController)
        return vc
    }
}

相關文章