-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented custom animation #276
Conversation
- returns: Instance of NVActivityIndicatorAnimationBlank. | ||
*/ | ||
case custom(NVActivityIndicatorAnimationDelegate?) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
self = match | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
guard let match = NVActivityIndicatorType.allCases.first(where: { activityIndicatorType -> Bool in | ||
return "\(activityIndicatorType)" == rawValue | ||
}) else { return nil } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
return "\(self)" | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
public static func == (lhs: NVActivityIndicatorType, rhs: NVActivityIndicatorType) -> Bool { | ||
return lhs.rawValue == rhs.rawValue | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
public enum NVActivityIndicatorType: CaseIterable { | ||
public enum NVActivityIndicatorType: CaseIterable, Equatable, RawRepresentable { | ||
|
||
public static var allCases: [NVActivityIndicatorType] = [.blank, ballPulse, .ballGridPulse, .ballClipRotate, .squareSpin, .ballClipRotatePulse, .ballClipRotateMultiple, .ballPulseRise, .ballRotate, .cubeTransition, .ballZigZag, .ballZigZagDeflect, .ballTrianglePath, .ballScale, .lineScale, .lineScaleParty, .ballScaleMultiple, .ballPulseSync, .ballBeat, .ballDoubleBounce, .lineScalePulseOut, .lineScalePulseOutRapid, .ballScaleRipple, .ballScaleRippleMultiple, .ballSpinFadeLoader, .lineSpinFadeLoader, .triangleSkewSpin, .pacman, .ballGridBeat, .semiCircleSpin, .ballRotateChase, .orbit, .audioEqualizer, .circleStrokeSpin] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 630 characters (line_length)
@@ -65,7 +65,39 @@ import UIKit | |||
- AudioEqualizer: AudioEqualizer animation. | |||
- CircleStrokeSpin: CircleStrokeSpin animation. | |||
*/ | |||
public enum NVActivityIndicatorType: CaseIterable { | |||
public enum NVActivityIndicatorType: CaseIterable, Equatable, RawRepresentable { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
@@ -28,6 +28,6 @@ | |||
import UIKit | |||
|
|||
// swiftlint:disable:next class_delegate_protocol | |||
protocol NVActivityIndicatorAnimationDelegate { | |||
public protocol NVActivityIndicatorAnimationDelegate: class { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superfluous Disable Command Violation: SwiftLint rule 'class_delegate_protocol' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
that would be great. could you please merge this pr? |
Thanks for your PR. I'll close this, for now, and my opinion regarding customization is at #267 (comment). |
Hi,
I created an update to include the possibility for a custom animation.
this is based on the pullrequest by @nicoaldegheri.
please have a look and let me know what you think.