Closed Emy87aa closed 4 years ago
Hey eman , can you provide more details about the environment . What did you do ?
Sent from my iPhone
On Dec 4, 2019, at 3:06 PM, Eman Alsabbagh notifications@github.com wrote:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I edited the issue and added screen Shot
@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
@supergenedy thanx for the solution .
@supergenedy thanx for the solution .
@MoathOthman it does solve the animation crash issue but the language is not getting translated.
@imuhammadjabbar did you call MOLH.setLanguageTo("YOUR_LANGUAGE")
?
@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
@imuhammadjabbar there is a function for images image.flipIfNeeded()
The crash is happening because we are forced unwrapping the window
fixed in 1.3
When restarting the app this happens, nil in rootViewController