Skip to content

Commit

Permalink
Add transition feature in reset function (#32)
Browse files Browse the repository at this point in the history
* Add transition feature in reset function
  • Loading branch information
deya-eldeen authored and MoathOthman committed Oct 11, 2018
1 parent 0936394 commit d55a29f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ViewController: UIViewController {

@IBAction func switchTheLanguage(_ sender: UIButton) {
MOLH.setLanguageTo(MOLHLanguage.currentAppleLanguage() == "en" ? "ar" : "en")
MOLH.reset()
MOLH.reset(transition: .transitionCrossDissolve)
}

@IBAction func didEnd(_ sender: UITextField) {
Expand Down
4 changes: 4 additions & 0 deletions MOLH/MOLH.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ open class MOLH {
if !MOLHLanguage.isRTLLanguage() {
transition = .transitionFlipFromLeft
}
reset(transition: transition)
}

open class func reset(transition: UIViewAnimationOptions) {
if let delegate = UIApplication.shared.delegate {
if delegate is MOLHResetable {
(delegate as!MOLHResetable).reset()
Expand Down

0 comments on commit d55a29f

Please sign in to comment.