diff --git a/Example/ViewController.swift b/Example/ViewController.swift index 7a6f108..9e3b1af 100644 --- a/Example/ViewController.swift +++ b/Example/ViewController.swift @@ -51,7 +51,7 @@ class ViewController: UIViewController { initialEffectType: .fadeIn) } @IBAction func doneAnimatinDidTap(_ sender: UIButton) { - NativePopup.show(image: Preset.Native.done, + NativePopup.show(image: Preset.Feedback.done, title: "Added to Library", message: nil, initialEffectType: .fadeIn) diff --git a/NativePopup/Preset.swift b/NativePopup/Preset.swift index 74d6fdf..9dd035c 100644 --- a/NativePopup/Preset.swift +++ b/NativePopup/Preset.swift @@ -13,22 +13,26 @@ public struct Preset { public enum Feedback: String, ImageConvertible { case good, - bad - - public var image: Image { - return .image(UIImage(nativePopupNamed: "feedback_\(rawValue)")) - } - } - - public enum Native: ImageConvertible { - case + bad, done - public var additionalMarginTop: CGFloat { return 31 } - public var additionalMarginBottom: CGFloat { return 18 } + public var additionalMarginTop: CGFloat { + switch self { + case .good, .bad: return 0 + case .done: return 31 + } + } + public var additionalMarginBottom: CGFloat { + switch self { + case .good, .bad: return 0 + case .done: return 18 + } + } public var image: Image { switch self { + case .good, .bad: + return .image(UIImage(nativePopupNamed: "feedback_\(rawValue)")) case .done: return .view(AnimatableDoneView()) }