Giter Site home page Giter Site logo

Comments (10)

supergenedy avatar supergenedy commented on September 24, 2024 14

@Emy87aa
I made a solution for this issue till MoathOthman updates the lib
you can add this func in your AppDelegate it gets the window from SceneDelegate

 @available(iOS 13.0, *)
    func swichRoot(){
        //Flip Animation before changing rootView
        animateView()

        // switch root view controllers
        let storyboard = UIStoryboard.init(name: "Main", bundle: nil)
        let nav = storyboard.instantiateViewController(withIdentifier: "HomeView")
        
        let scene = UIApplication.shared.connectedScenes.first
        if let sd : SceneDelegate = (scene?.delegate as? SceneDelegate) {
            sd.window!.rootViewController = nav
        }
        
    }
   @available(iOS 13.0, *)
    func animateView() {
        var transition = UIView.AnimationOptions.transitionFlipFromRight
        if !MOLHLanguage.isRTLLanguage() {
            transition = .transitionFlipFromLeft
        }
       animateView(transition: transition)
    }
    
    @available(iOS 13.0, *)
    func animateView(transition: UIView.AnimationOptions) {
        if let delegate = UIApplication.shared.connectedScenes.first?.delegate {
            UIView.transition(with: (((delegate as? SceneDelegate)!.window)!), duration: 0.5, options: transition, animations: {}) { (f) in
            }
        }
    }

You can check if ios > 13 then call this func from the AppDelegate

        if #available(iOS 13.0, *) {
                let delegate = UIApplication.shared.delegate as? AppDelegate
                delegate!.swichRoot()
        } else {
               // Fallback on earlier versions
               MOLH.reset()
        }

And also check if ios > 13 in the reset func in the AppDelegate to call swichRoot func

from molh.

abdallahnh avatar abdallahnh commented on September 24, 2024 1

The crash is happening because we are forced unwrapping the window

from molh.

MoathOthman avatar MoathOthman commented on September 24, 2024

from molh.

Emy87aa avatar Emy87aa commented on September 24, 2024

I edited the issue and added screen Shot

from molh.

MoathOthman avatar MoathOthman commented on September 24, 2024

@supergenedy thanx for the solution .

from molh.

imuhammadjabbar avatar imuhammadjabbar commented on September 24, 2024

@supergenedy thanx for the solution .

@MoathOthman it does solve the animation crash issue but the language is not getting translated.

from molh.

supergenedy avatar supergenedy commented on September 24, 2024

@imuhammadjabbar did you call MOLH.setLanguageTo("YOUR_LANGUAGE") ?

from molh.

imuhammadjabbar avatar imuhammadjabbar commented on September 24, 2024

@imuhammadjabbar did you call MOLH.setLanguageTo("YOUR_LANGUAGE") ?

Yes, I did. ( MOLH.setLanguageTo(currentLanguage == "en" ? "ar" : "en") )
I set my default Language to Ar.

Seems like it is changing now. But My Side Menu is not working. or some images.
How can I change images manually(There were changing automatically with Changing System LAnguage)

And the side menu is not working as well.

Any help would be much appreciated. Thanks

from molh.

MoathOthman avatar MoathOthman commented on September 24, 2024

@imuhammadjabbar there is a function for images image.flipIfNeeded()

from molh.

MoathOthman avatar MoathOthman commented on September 24, 2024

fixed in 1.3

from molh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.