Skip to content

Commit

Permalink
IOS-3575 Displaying UIImage as an NFC tag for more flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
megakoko committed May 10, 2023
1 parent 15cfa9a commit b6fabd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions TangemSdk/TangemSdk/UI/TangemSdkStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ public extension TangemSdkStyle {
/// Generic card provided by the SDK
case genericCard

/// A custom image with a name `name` that resides in an Asset Catalog in a `bundle` bundle.
/// A custom tag made out of an UIImage instance.
/// The image can be shifted vertically from the standard position by specifying `verticalOffset`.
/// Note that the width of the image will be limited to a certain size, while the height will be determined by the aspect ratio of the image.
/// The value of the width can be found in ReadView.swift and is 210 points at the time of the writing.
case image(name: String, verticalOffset: Double, bundle: Bundle)
case image(uiImage: UIImage, verticalOffset: Double)
}
}
4 changes: 2 additions & 2 deletions TangemSdk/TangemSdk/UI/Views/Scan/ReadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ struct ReadView: View {
switch style.nfcTag {
case .genericCard:
CardView(cardColor: style.colors.cardColor, starsColor: style.colors.starsColor)
case .image(let name, let verticalOffset, let bundle):
Image(name, bundle: bundle)
case .image(let uiImage, let verticalOffset):
Image(uiImage: uiImage)
.resizable()
.aspectRatio(contentMode: .fit)
.offset(y: verticalOffset)
Expand Down

0 comments on commit b6fabd2

Please sign in to comment.