iOS: Determine if device language is Right to Left (RTL)

前端 未结 11 1857
后悔当初
后悔当初 2020-12-04 23:20

Is there a way to easily determine if the language the device is set to is right to left (RTL)?

11条回答
  •  悲&欢浪女
    2020-12-05 00:16

    if you want to check if the device is running in RTL or LTR in swift 3

    if(UIApplication.shared.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirection.rightToLeft) {
        //RTL
    } else {
       //LTR
    }
    

提交回复
热议问题