MoathOthman / MOLH

Localization helper for iOS apps mainly focusing on the LTR/RTL issue
MIT License
117 stars 36 forks source link

reset func not work in version 1.3 #59

Closed mohamedawad2020 closed 4 years ago

abdallahnh commented 4 years ago

@MoathOthman this is happening with me as well, any quick fix for this?

MoathOthman commented 4 years ago

with using scenedelegate or not? I am on it currently.

abdallahnh commented 4 years ago

the issue is when y ou are on ios 13 and you are not using scene

abdallahnh commented 4 years ago

open class func reset(transition: UIView.AnimationOptions, duration: Float = 0.5) { if #available(iOS 13.0, *) { ----->>> for scene in UIApplication.shared.connectedScenes { (scene.delegate as? MOLHResetable)?.reset() } } else { if let delegate = UIApplication.shared.delegate { if delegate is MOLHResetable { (delegate as!MOLHResetable).reset() } UIView.transition(with: ((delegate.window)!)!, duration: TimeInterval(duration), options: transition, animations: {}) } } }

it will enter ---> this line and see no scene so will not call the reset delegate

MoathOthman commented 4 years ago

let me fix it.

MoathOthman commented 4 years ago

fixed in 1.4, please try that @Mohamedawad2020 @abdallahnh