📜  rtl ios swift 代码示例

📅  最后修改于: 2022-03-11 15:00:58.404000             🧑  作者: Mango

代码示例1
func switchViewControllers(isArabic arabic : Bool){

        if arabic {
            UIView.appearance().semanticContentAttribute = arabic ? .forceRightToLeft : .forceLeftToRight
            let appDelegate = UIApplication.shared.delegate as? AppDelegate
            let homeViewController = HomeViewController()
            appDelegate?.window?.rootViewController = homeViewController
         }
}