Skip to content

Commit aaf0358

Browse files
authored
Merge pull request #1 from iBluemind/master
Fix the issue that can't use PastelView
2 parents 1fcd59d + 1dba19c commit aaf0358

File tree

6 files changed

+14
-122
lines changed

6 files changed

+14
-122
lines changed

Example/Pastel.xcodeproj/project.pbxproj

-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
4CE239CC1EBC411100E3E667 /* PastelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE239CB1EBC411100E3E667 /* PastelView.swift */; };
1110
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
1211
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
1312
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
@@ -30,7 +29,6 @@
3029

3130
/* Begin PBXFileReference section */
3231
02084496218A3F315699AE29 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
33-
4CE239CB1EBC411100E3E667 /* PastelView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PastelView.swift; sourceTree = "<group>"; };
3432
5332691F504AAFEDF6EE106C /* Pods_Pastel_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Pastel_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3533
5E01E37F1C25FDCAFB746FF8 /* Pods-Pastel_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Pastel_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Pastel_Example/Pods-Pastel_Example.release.xcconfig"; sourceTree = "<group>"; };
3634
607FACD01AFB9204008FA782 /* Pastel_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Pastel_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -106,7 +104,6 @@
106104
children = (
107105
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
108106
607FACD71AFB9204008FA782 /* ViewController.swift */,
109-
4CE239CB1EBC411100E3E667 /* PastelView.swift */,
110107
607FACD91AFB9204008FA782 /* Main.storyboard */,
111108
607FACDC1AFB9204008FA782 /* Images.xcassets */,
112109
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */,
@@ -368,7 +365,6 @@
368365
files = (
369366
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
370367
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
371-
4CE239CC1EBC411100E3E667 /* PastelView.swift in Sources */,
372368
);
373369
runOnlyForDeploymentPostprocessing = 0;
374370
};

Example/Pastel/PastelView.swift

-105
This file was deleted.

Example/Pastel/ViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import UIKit
10+
import Pastel
1011

1112
class ViewController: UIViewController {
1213
@IBOutlet weak var loginButton: UIButton! {

Example/Podfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PODS:
1111
- FBSnapshotTestCase (~> 2.0)
1212
- Nimble
1313
- Quick
14-
- Pastel (0.1.0)
14+
- Pastel (0.1.1)
1515
- Quick (1.0.0)
1616

1717
DEPENDENCIES:
@@ -26,10 +26,10 @@ EXTERNAL SOURCES:
2626
:path: "../"
2727

2828
SPEC CHECKSUMS:
29-
FBSnapshotTestCase: '094f9f314decbabe373b87cc339bea235a63e07a'
29+
FBSnapshotTestCase: 094f9f314decbabe373b87cc339bea235a63e07a
3030
Nimble: 415e3aa3267e7bc2c96b05fa814ddea7bb686a29
3131
Nimble-Snapshots: e743439f26c2fa99d8f7e0d7c01c99bcb40aa6f2
32-
Pastel: 2ed588cb2c5280a6127b615d259d70945610d258
32+
Pastel: 06c43ba58f11d0ced363a310f70f4f254d70abee
3333
Quick: 8024e4a47e6cc03a9d5245ef0948264fc6d27cff
3434

3535
PODFILE CHECKSUM: 4b3b84bc6975347b7d6bb632580cfb849aeec4fc

Pastel.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'Pastel'
11-
s.version = '0.1.0'
11+
s.version = '0.1.1'
1212
s.summary = 'Instagram like gradient background animation'
1313

1414
# This description is used to generate tags and improve search results.

Pastel/Classes/PastelView.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import UIKit
1010

11-
class PastelView: UIView {
11+
public class PastelView: UIView {
1212

1313
struct Animation {
1414
static let keyPath = "colors"
@@ -34,19 +34,19 @@ class PastelView: UIView {
3434
}
3535
*/
3636

37-
override init(frame: CGRect) {
37+
public override init(frame: CGRect) {
3838
super.init(frame: frame)
3939
}
4040

41-
required init?(coder aDecoder: NSCoder) {
41+
public required init?(coder aDecoder: NSCoder) {
4242
super.init(coder: aDecoder)
4343
}
4444

45-
override func awakeFromNib() {
45+
public override func awakeFromNib() {
4646
super.awakeFromNib()
4747
}
4848

49-
func startAnimation() {
49+
public func startAnimation() {
5050
gradient.removeAllAnimations()
5151
setup()
5252
animateGradient()
@@ -68,12 +68,12 @@ class PastelView: UIView {
6868
colors[(currentGradient + 1) % colors.count].cgColor]
6969
}
7070

71-
func setColors(colors: [UIColor]) {
71+
public func setColors(colors: [UIColor]) {
7272
guard colors.count > 0 else { return }
7373
self.colors = colors
7474
}
7575

76-
func addColor(color: UIColor) {
76+
public func addColor(color: UIColor) {
7777
self.colors.append(color)
7878
}
7979

@@ -88,15 +88,15 @@ class PastelView: UIView {
8888
gradient.add(animation, forKey: Animation.key)
8989
}
9090

91-
override func removeFromSuperview() {
91+
public override func removeFromSuperview() {
9292
super.removeFromSuperview()
9393
gradient.removeAllAnimations()
9494
gradient.removeFromSuperlayer()
9595
}
9696
}
9797

9898
extension PastelView: CAAnimationDelegate {
99-
func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
99+
public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
100100
if flag {
101101
gradient.colors = currentGradientSet()
102102
animateGradient()

0 commit comments

Comments
 (0)