Closed Oschly closed 4 years ago
Function Parameter Naming convention
Example of correct naming: https://github.com/0xLeif/SwiftUIKit/blob/56da193939cf6a75eddd1c6a78cf5a7f03d34a19/Sources/SwiftUIKit/Views/WebView.swift#L76-L81
My preference for the first parameter name is to be required unless it is a closure.
Expected:
@available(iOS 11.0, *)
extension Map {
@discardableResult
public func register(classes: [String: AnyClass?]) -> Self {
for (identifier, annotationClass) in classes {
register(annotationClass, forAnnotationViewWithReuseIdentifier: identifier)
}
return self
}
}
// MARK: - Adjusting Map Regions and Rectangles
extension Map {
@discardableResult
public func fit(region: MKCoordinateRegion) -> Self {
self.region = regionThatFits(region)
return self
}
Actual:
@available(iOS 11.0, *)
extension Map {
@discardableResult
public func register(_ classes: [String: AnyClass?]) -> Self {
for (identifier, annotationClass) in classes {
register(annotationClass, forAnnotationViewWithReuseIdentifier: identifier)
}
return self
}
}
// MARK: - Adjusting Map Regions and Rectangles
extension Map {
@discardableResult
public func fitTo(_ region: MKCoordinateRegion) -> Self {
self.region = regionThatFits(region)
return self
}
P.S.
Mainly why I am against not requiring the first parameter name....
Thanks for feedback! All of the suggestions are really good ideas. I will apply them to the branch tomorrow.
Looks good! I'm going to merge into feature/Map
so the CI will actually run.
Closes #132