Skip to content

Commit 8c9c19c

Browse files
committed
Omit scan code generator of parameter name
1 parent 92f3cd0 commit 8c9c19c

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Release Notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* `FormText` has a new `trailingView` property.
1111
* There is a new `UIImage+Rotated` extension.
1212

13+
### 💥 Breaking Changes
14+
15+
* `ScanCodeGenerator` functions `of` parameter name is not omitted.
16+
1317

1418

1519
## 1.7.1

Sources/SwiftUIKit/Data/ScanCodeGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ import SwiftUI
1414
*/
1515
public protocol ScanCodeGenerator {
1616

17-
func generateCode(of type: ScanCodeType, from string: String) -> ImageResource?
18-
func generateCodeView(of type: ScanCodeType, from string: String) -> Image?
17+
func generateCode(_ type: ScanCodeType, from string: String) -> ImageResource?
18+
func generateCodeView(_ type: ScanCodeType, from string: String) -> Image?
1919
}

Sources/SwiftUIKit/Data/StandardQrCodeGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import SwiftUI
1313
public class StandardQrCodeGenerator: StandardScanCodeGenerator, QrCodeGenerator {
1414

1515
public func generateQRCode(from string: String) -> Image? {
16-
generateCodeView(of: .qr, from: string)
16+
generateCodeView(.qr, from: string)
1717
}
1818
}
1919
#endif

Sources/SwiftUIKit/Data/StandardScanCodeGenerator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public class StandardScanCodeGenerator: ScanCodeGenerator {
2121

2222
public let transform: CGAffineTransform
2323

24-
public func generateCode(of type: ScanCodeType, from string: String) -> ImageResource? {
24+
public func generateCode(_ type: ScanCodeType, from string: String) -> ImageResource? {
2525
guard let image = generateCoreImage(of: type, from: string) else { return nil }
2626
return ImageResource(cgImage: image)
2727
}
2828

29-
public func generateCodeView(of type: ScanCodeType, from string: String) -> Image? {
30-
guard let image = generateCode(of: type, from: string) else { return nil }
29+
public func generateCodeView(_ type: ScanCodeType, from string: String) -> Image? {
30+
guard let image = generateCode(type, from: string) else { return nil }
3131
return Image(imageResource: image)
3232
}
3333
}

0 commit comments

Comments
 (0)