Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

mkoorn
Copy link

@mkoorn mkoorn commented Apr 5, 2019

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.

- returns: Instance of NVActivityIndicatorAnimationBlank.
*/
case custom(NVActivityIndicatorAnimationDelegate?)

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
}

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 }

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)"
}
}

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
}

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]

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 {

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 {

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)

@domdop
Copy link

domdop commented Mar 4, 2021

that would be great. could you please merge this pr?

@ninjaprox
Copy link
Owner

Thanks for your PR. I'll close this, for now, and my opinion regarding customization is at #267 (comment).

@ninjaprox ninjaprox closed this Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants