SWrevealviewcontroller: the direction of the remote menu menu from left to right is pragmatic

I am working on an application that has two languages ​​(English and Arabic), I have a slide menu using the "SWrevealviewcontroller" lib for the left side, I want to switch the slide menu to the right side of the left side to change the language (Arabic) and switch back to right left for english. How can we archive it? Thanks

-1
source share
1 answer

In fact, you should get the application language, let's say you have the Helper class and the static method to get the application language.

Helper.m

+(void)getApplicationLanguage{
//return application language
}

ViewController.m

-(IBAction)menuButtonClicked:(id)sender{
    if ([[Helper getApplicationLanguage] isEqualToString:@"Arabic"]){
       //slide from right
    }else{
     //slide from left
    }
}

, , .

UPDATE:

1. segue "sw_right". 2. SWRevealViewController loadStoryboard mehtod

-//        @try
-//        {
-//            [self performSegueWithIdentifier:SWSegueRightIdentifier sender:nil];
-//        }
-//        @catch(NSException *exception) {}
  1. NSString * identifier = self.identifier;

    if (![identifier isEqualToString:SWSegueFrontIdentifier]) {
        if ([[H getApplicationLanguage]isEqualToString:ARABIC_LANGUAGE]) {
            identifier = @"sw_right";
        }else{
            identifier = @"sw_rear";
        }
    

    }

+1

Source: https://habr.com/ru/post/1677849/


All Articles