ios - Swift : How to change language inside app? -


i using localize-swift library (link) localize application , works fine .strings files. problem have localize language right left , have localize via interface builder storyboard can make view controllers right in rtl format. question how set storyboard user selected language in real time ?

for example have 2 storyboard files :

1- ... /projectname/base.lproj/main.storyboard

2- ... /projectname/fa-ir.lproj/main.storyboard

how switch between them in real time ?

i know can change in schemes , device language want real time , dont want users restart device.

thanks

found answer :

nsuserdefaults.standarduserdefaults().setobject(["language identifier"], forkey: "applelanguages")  nsuserdefaults.standarduserdefaults().synchronize() 

unfortunately user must restart app! if find solution not restart application please inform me.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -