Skip to content

Commit

Permalink
Make code lint approved
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Sep 5, 2020
1 parent 6f036f7 commit 4551359
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
disabled_rules:
- identifier_name
- trailing_whitespace
- type_name
- vertical_whitespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public protocol ImagePickerCompletionHandler: AnyObject {

var requiresAuthorization: Bool { get }

func tryGetImage(from info: ImagePickerInfo, completion: @escaping (UIImage?) -> ())
func tryGetImage(from info: ImagePickerInfo, completion: @escaping (UIImage?) -> Void)
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ImagePickerPhotosCompletionHandler: ImagePickerCompletionHandler {

public var requiresAuthorization: Bool { true }

public func tryGetImage(from info: ImagePickerInfo, completion: @escaping (UIImage?) -> ()) {
public func tryGetImage(from info: ImagePickerInfo, completion: @escaping (UIImage?) -> Void) {
guard let asset = info[.phAsset] as? PHAsset else { return completion(nil) }
let manager = PHImageManager.default()
let options = PHImageRequestOptions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ImagePickerStandardCompletionHandler: ImagePickerCompletionHandler

public var requiresAuthorization: Bool { false }

public func tryGetImage(from info: ImagePickerInfo, completion: @escaping (UIImage?) -> ()) {
public func tryGetImage(from info: ImagePickerInfo, completion: @escaping (UIImage?) -> Void) {
let image = info[.originalImage] as? UIImage
completion(image)
}
Expand Down
4 changes: 3 additions & 1 deletion Sources/SwiftUIKit/Pickers/ImagePicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public extension ImagePicker {

let parent: ImagePicker

public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
public func imagePickerController(
_ picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
defer { parent.dismiss() }
let handler = self.parent.completionHandler
handler.tryGetImage(from: info) { image in
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Views/UIViewWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct UIViewWrapper: UIViewRepresentable {

private let view: UIView

public func makeUIView(context: Context) -> UIView { view }
public func makeUIView(context: Context) -> UIView { view }

public func updateUIView(_ uiView: UIView, context: Context) {}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftUIKitTests/SwiftUIKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ final class SwiftUIKitTests: XCTestCase {
}

static var allTests = [
("testExample", testExample),
("testExample", testExample)
]
}
2 changes: 1 addition & 1 deletion Tests/SwiftUIKitTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(SwiftUIKitTests.allTests),
testCase(SwiftUIKitTests.allTests)
]
}
#endif

0 comments on commit 4551359

Please sign in to comment.