Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let yttriumDebug = false
// Define dependencies array
var dependencies: [Package.Dependency] = [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"),
.package(url: "https://github.com/WalletConnect/QRCode", from: "14.3.1"),
.package(url: "https://github.com/dagronf/QRCode.git", from: "27.11.0"),
.package(name: "CoinbaseWalletSDK", url: "https://github.com/MobileWalletProtocol/wallet-mobile-sdk", .upToNextMinor(from: "1.1.0")),
// .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", .upToNextMinor(from: "1.10.0")),
]
Expand Down
17 changes: 13 additions & 4 deletions Sources/ReownAppKit/Screens/ConnectWallet/QRCodeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ struct QRCodeView: View {
}

@MainActor private func render(content: String, size: CGSize) -> Image {
let doc = QRCode.Document(
guard let doc = try? QRCode.Document(
utf8String: content,
errorCorrection: .quantize
)
) else {return Image(systemName: "x.mark")}
doc.design.shape.eye = QRCode.EyeShape.Squircle2()
doc.design.shape.onPixels = QRCode.PixelShape.Vertical(
insetFraction: 0.15,
Expand Down Expand Up @@ -62,11 +62,11 @@ struct QRCodeView: View {
inset: 20
)
}
return doc.imageUI(
return (try? doc.imageUI(
size.applying(.init(scaleX: 3, y: 3)),
dpi: 72 * 3,
label: Text("QR code with URI")
)!
)) ?? Image(systemName: "x.mark")
}
}

Expand Down Expand Up @@ -115,6 +115,7 @@ struct QRCodeView_Previews: PreviewProvider {
extension QRCode.EyeShape {
/// A 'squircle' eye style
@objc(QRCodeEyeShapeSquircle2) class Squircle2: NSObject, QRCodeEyeShapeGenerator {

@objc public static let Name = "squircle"
@objc public static var Title: String { "Squircle2" }
@objc public static func Create(_ settings: [String: Any]?) -> QRCodeEyeShapeGenerator {
Expand Down Expand Up @@ -149,6 +150,10 @@ extension QRCode.EyeShape {

private static let _defaultPupil = QRCode.PupilShape.Squircle2()
public func defaultPupil() -> QRCodePupilShapeGenerator { Self._defaultPupil }

func reset() {

}
}
}

Expand Down Expand Up @@ -183,5 +188,9 @@ extension QRCode.PupilShape {

return path
}

func reset() {

}
}
}