ios storyboard 獲取storyboard中的viewController

星星月亮0 發表於 2020-12-04
iOS
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
    }
}