diff --git a/Rye/Rye/RyeType+Configuration.swift b/Rye/Rye/RyeType+Configuration.swift index c68b343..234b517 100644 --- a/Rye/Rye/RyeType+Configuration.swift +++ b/Rye/Rye/RyeType+Configuration.swift @@ -25,7 +25,7 @@ public struct Rye { public enum ViewType { case standard(configuration: RyeConfiguration?) - case custom(UIView) + case custom(UIView, animationType: AnimationType = .slideInOut) } public enum Configuration { diff --git a/Rye/Rye/RyeViewController.swift b/Rye/Rye/RyeViewController.swift index 78c0c5a..3f61586 100644 --- a/Rye/Rye/RyeViewController.swift +++ b/Rye/Rye/RyeViewController.swift @@ -85,9 +85,9 @@ public class RyeViewController: UIViewController { case .standard(let configuration): animationDuration = configuration?[Rye.Configuration.Key.animationDuration] as? TimeInterval ?? 0.3 animationType = configuration?[Rye.Configuration.Key.animationType] as? Rye.AnimationType ?? .slideInOut - default: + case .custom(_, let animationType): animationDuration = 0.3 - animationType = .slideInOut + self.animationType = animationType } super.init(nibName: nil, bundle: nil) @@ -161,8 +161,7 @@ public class RyeViewController: UIViewController { addRyeView(ryeView) - case .custom(let ryeView): - + case .custom(let ryeView, _): addRyeView(ryeView) }