Skip to content

Commit

Permalink
Change preset name to Feedback.done from Native.done
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0926 committed May 20, 2017
1 parent 6de413c commit 0bf904b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 15 additions & 11 deletions NativePopup/Preset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 0bf904b

Please sign in to comment.