-
Notifications
You must be signed in to change notification settings - Fork 331
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
project: use swiftlint and fix triggered warnings #129
Conversation
@@ -26,7 +26,7 @@ open class LightboxImage { | |||
imageView.image = image | |||
completion?(image) | |||
} else if let imageURL = imageURL { | |||
LightboxConfig.loadImage(imageView, imageURL) { [weak self] error, image in | |||
LightboxConfig.loadImage(imageView, imageURL) { [weak self] _, image in |
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.
I'd like to draw your attention to the error
variable here.
I wanted to do something with it, such as printing it or processing it, but I lack of any relevant ideas. Can we do something about it or is it okay to ignore it in this scope?
Thanks!
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.
The error should probably be passed to the completion so that the user has the chance of knowing what went wrong with loading the remote image.
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.
I think you can open an issue to improve the completion of addImageTo
completion. It feels beyond scope for this PR.
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.
I feel the same about the outOfScope exception.
I'll open this issue for enhancement soon.
Thanks for your feedback.
Source/LightboxController.swift
Outdated
@@ -212,9 +212,9 @@ open class LightboxController: UIViewController { | |||
override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { | |||
super.viewWillTransition(to: size, with: coordinator) | |||
|
|||
coordinator.animate(alongsideTransition: { (UIViewControllerTransitionCoordinatorContext) -> Void in | |||
coordinator.animate(alongsideTransition: { (_) -> Void in |
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.
I think you can replace (_) -> Void in
with _ in
.
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.
Done!
@r-mckay nice maintenance PR!, could you have a look at the comment that I made in |
This commit adds a build phase to the project to run SwiftLint. This new phase follows the implementation made in the ImagePicker project [1]. This commit does not try to handle the eventual warning that could be raised by the static code analysis. [1] https://github.com/hyperoslo/ImagePicker
This commit solves the SwiftLint warning concerning the trailing spaces.
This commit aligns parameters in a call to fix a SwiftLint warning.
This commit takes care of fixing a SwiftLint Colon Violation in a file.
This commit fixes a SwiftLint Option Redondant Initialization warning in a file.
This commit fixes several warnings concerning unused closure parameters.
c40a216
to
f0825e0
Compare
@zenangst Thank you for your review, the PR is now updated. |
@r-mckay awesome, thank you so much for the PR. Keep rockin! |
Hello!
This commit uses SwiftLint and fixes the warnings that were risen by the analysis. It uses the
.swiftlint.yml
file that was already available in the project.Thank you!