Skip to content

Commit

Permalink
Add .dislike and .privacy presets
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvorobei committed Dec 20, 2019
1 parent e8b3fe1 commit 5fa7cdf
Show file tree
Hide file tree
Showing 10 changed files with 320 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Assets/Readme/Miniature - Dislike.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions Assets/Readme/Miniature - Privacy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Assets/Sketch/Presets.sketch
Binary file not shown.
2 changes: 2 additions & 0 deletions Example/Controllers/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class ViewController: UITableViewController {
Alert(key: "Eject", preset: .eject, title: "Eject complete", subtitle: nil),
Alert(key: "Card", preset: .card, title: "Payment sent", subtitle: "Thanks for donate"),
Alert(key: "Like", preset: .like, title: "Thanks for feedback", subtitle: "It helped us"),
Alert(key: "Dislike", preset: .dislike, title: "Thanks for feedback", subtitle: "It helped us"),
Alert(key: "Privacy", preset: .privacy, title: "Privacy accepted", subtitle: "You privacy it important"),
Alert(key: "Rotate", preset: .rotate, title: "Portrait mode", subtitle: "You can change it in settings"),
Alert(key: "Magic", preset: .magic, title: "Magic here! You see", subtitle: "Strange text, true?"),
Alert(key: "Add", preset: .add, title: "Added to Folder", subtitle: nil),
Expand Down
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ And other
<img src="https://github.com/ivanvorobei/SPAlert/blob/master/Assets/Readme/Miniature%20-%20Eject.svg" width="55">
<img src="https://github.com/ivanvorobei/SPAlert/blob/master/Assets/Readme/Miniature%20-%20Card.svg" width="55">
<img src="https://github.com/ivanvorobei/SPAlert/blob/master/Assets/Readme/Miniature%20-%20Like.svg" width="55">
<img src="https://github.com/ivanvorobei/SPAlert/blob/master/Assets/Readme/Miniature%20-%20Dislike.svg" width="55">
<img src="https://github.com/ivanvorobei/SPAlert/blob/master/Assets/Readme/Miniature%20-%20Privacy.svg" width="55">
<img src="https://github.com/ivanvorobei/SPAlert/blob/master/Assets/Readme/Miniature%20-%20Rotate.svg" width="55">
<img src="https://github.com/ivanvorobei/SPAlert/blob/master/Assets/Readme/Miniature%20-%20Magic.svg" width="55">
<img src="https://github.com/ivanvorobei/SPAlert/blob/master/Assets/Readme/Miniature%20-%20Add.svg" width="55">
Expand Down
2 changes: 1 addition & 1 deletion SPAlert.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "SPAlert"
s.version = "2.0.24"
s.version = "2.0.25"
s.summary = "Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets."
s.homepage = "https://github.com/IvanVorobei/SPAlert"
s.source = { :git => "https://github.com/IvanVorobei/SPAlert.git", :tag => s.version }
Expand Down
8 changes: 8 additions & 0 deletions SPAlert.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
F412052B2382AF64009C2AC7 /* SPAlertLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41205222382AEFA009C2AC7 /* SPAlertLayout.swift */; };
F4146EB223AAA18100AE7658 /* SPAlertIconLikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4146EB123AAA18100AE7658 /* SPAlertIconLikeView.swift */; };
F421EFF12398684E000A566D /* SPAlertIconFlagView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F421EFF02398684E000A566D /* SPAlertIconFlagView.swift */; };
F42DE05423AD7D8A007CCE29 /* SPAlertIconDislikeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F42DE05323AD7D8A007CCE29 /* SPAlertIconDislikeView.swift */; };
F42DE05623AD7D94007CCE29 /* SPAlertIconPrivacyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F42DE05523AD7D94007CCE29 /* SPAlertIconPrivacyView.swift */; };
F45970B423A578A50092CE7C /* SPAlertIconCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45970B323A578A50092CE7C /* SPAlertIconCardView.swift */; };
F459720223A841C00092CE7C /* SPAlertIconRotateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459720123A841C00092CE7C /* SPAlertIconRotateView.swift */; };
F46AAEFE2392E97200BE9131 /* SPAlertIconMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46AAEFD2392E97200BE9131 /* SPAlertIconMessageView.swift */; };
Expand Down Expand Up @@ -94,6 +96,8 @@
F41205262382AF29009C2AC7 /* SPAlertIconAnimatable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPAlertIconAnimatable.swift; sourceTree = "<group>"; };
F4146EB123AAA18100AE7658 /* SPAlertIconLikeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPAlertIconLikeView.swift; sourceTree = "<group>"; };
F421EFF02398684E000A566D /* SPAlertIconFlagView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPAlertIconFlagView.swift; sourceTree = "<group>"; };
F42DE05323AD7D8A007CCE29 /* SPAlertIconDislikeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPAlertIconDislikeView.swift; sourceTree = "<group>"; };
F42DE05523AD7D94007CCE29 /* SPAlertIconPrivacyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPAlertIconPrivacyView.swift; sourceTree = "<group>"; };
F45970B323A578A50092CE7C /* SPAlertIconCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPAlertIconCardView.swift; sourceTree = "<group>"; };
F459720123A841C00092CE7C /* SPAlertIconRotateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPAlertIconRotateView.swift; sourceTree = "<group>"; };
F46AAEFD2392E97200BE9131 /* SPAlertIconMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPAlertIconMessageView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -205,6 +209,8 @@
F45970B323A578A50092CE7C /* SPAlertIconCardView.swift */,
F459720123A841C00092CE7C /* SPAlertIconRotateView.swift */,
F4146EB123AAA18100AE7658 /* SPAlertIconLikeView.swift */,
F42DE05323AD7D8A007CCE29 /* SPAlertIconDislikeView.swift */,
F42DE05523AD7D94007CCE29 /* SPAlertIconPrivacyView.swift */,
);
path = Icons;
sourceTree = "<group>";
Expand Down Expand Up @@ -408,6 +414,7 @@
F41204EA2382AC9B009C2AC7 /* SPAlertPreset.swift in Sources */,
F4A5A92C2388792F00B0DFE0 /* SPAlertIconBookmarkView.swift in Sources */,
F47D2FA6239D718400A346A5 /* SPAlertIconBoltView.swift in Sources */,
F42DE05423AD7D8A007CCE29 /* SPAlertIconDislikeView.swift in Sources */,
F41204EC2382AC9B009C2AC7 /* SPAlertIconDoneView.swift in Sources */,
F41204E92382AC9B009C2AC7 /* SPAlertView.swift in Sources */,
F421EFF12398684E000A566D /* SPAlertIconFlagView.swift in Sources */,
Expand All @@ -419,6 +426,7 @@
F41205292382AF5C009C2AC7 /* SPAlertIconAnimatable.swift in Sources */,
F4D1623423A2E47200B5E3E9 /* SPAlertIconEjectView.swift in Sources */,
F46AAEFE2392E97200BE9131 /* SPAlertIconMessageView.swift in Sources */,
F42DE05623AD7D94007CCE29 /* SPAlertIconPrivacyView.swift in Sources */,
F4CA67B5238ABD0100E72F79 /* SPAlertIconAddView.swift in Sources */,
F41204EB2382AC9B009C2AC7 /* SPAlertIconHeartView.swift in Sources */,
F4A8361A2385588300EB32E0 /* SPAlertIconDocView.swift in Sources */,
Expand Down
26 changes: 26 additions & 0 deletions Source/SPAlert/Models/SPAlertPreset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public enum SPAlertPreset {
case card
case rotate
case like
case dislike
case privacy

/**
View for preset. Wrap to `UIView`.
Expand Down Expand Up @@ -92,6 +94,10 @@ public enum SPAlertPreset {
return SPAlertIconRotateView()
case .like:
return SPAlertIconLikeView()
case .dislike:
return SPAlertIconDislikeView()
case .privacy:
return SPAlertIconPrivacyView()
}
}

Expand Down Expand Up @@ -189,6 +195,22 @@ public enum SPAlertPreset {
layout.iconHeight = 88
layout.bottomIconSpace = 35
return layout
case .dislike:
var layout = SPAlertLayout()
layout.topSpace = 49
layout.bottomSpace = 31
layout.iconWidth = 112
layout.iconHeight = 88
layout.bottomIconSpace = 35
return layout
case .privacy:
var layout = SPAlertLayout()
layout.topSpace = 47
layout.bottomSpace = 31
layout.iconWidth = 106
layout.iconHeight = 106
layout.bottomIconSpace = 32
return layout
case .bookmark:
var layout = SPAlertLayout()
layout.topSpace = 57
Expand Down Expand Up @@ -309,6 +331,10 @@ public enum SPAlertPreset {
return .success
case .like:
return .success
case .dislike:
return .error
case .privacy:
return .success
}
}
}
Loading

0 comments on commit 5fa7cdf

Please sign in to comment.