Skip to content

Commit 0bf904b

Browse files
committed
Change preset name to Feedback.done from Native.done
1 parent 6de413c commit 0bf904b

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

Example/ViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ViewController: UIViewController {
5151
initialEffectType: .fadeIn)
5252
}
5353
@IBAction func doneAnimatinDidTap(_ sender: UIButton) {
54-
NativePopup.show(image: Preset.Native.done,
54+
NativePopup.show(image: Preset.Feedback.done,
5555
title: "Added to Library",
5656
message: nil,
5757
initialEffectType: .fadeIn)

NativePopup/Preset.swift

+15-11
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,26 @@ public struct Preset {
1313
public enum Feedback: String, ImageConvertible {
1414
case
1515
good,
16-
bad
17-
18-
public var image: Image {
19-
return .image(UIImage(nativePopupNamed: "feedback_\(rawValue)"))
20-
}
21-
}
22-
23-
public enum Native: ImageConvertible {
24-
case
16+
bad,
2517
done
2618

27-
public var additionalMarginTop: CGFloat { return 31 }
28-
public var additionalMarginBottom: CGFloat { return 18 }
19+
public var additionalMarginTop: CGFloat {
20+
switch self {
21+
case .good, .bad: return 0
22+
case .done: return 31
23+
}
24+
}
25+
public var additionalMarginBottom: CGFloat {
26+
switch self {
27+
case .good, .bad: return 0
28+
case .done: return 18
29+
}
30+
}
2931

3032
public var image: Image {
3133
switch self {
34+
case .good, .bad:
35+
return .image(UIImage(nativePopupNamed: "feedback_\(rawValue)"))
3236
case .done:
3337
return .view(AnimatableDoneView())
3438
}

0 commit comments

Comments
 (0)