Skip to content

Commit

Permalink
Merge pull request #284 from tangem/release/3.7.0
Browse files Browse the repository at this point in the history
Release version 3.7.0
  • Loading branch information
tureck1y authored May 12, 2023
2 parents 2ecdf90 + 35ff887 commit 06e1372
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 18 deletions.
22 changes: 9 additions & 13 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
* 7c0c3ef - (HEAD -> release/3.6.0, tag: develop-228, origin/develop, develop) Merge pull request #279 from tangem/IOS-3574_derivedkeys_serialization
|\
| * 2a2d69d - IOS-3574 Serialize derivedKeys as object
|/
* c2b460c - (tag: develop-227) Merge pull request #277 from tangem/IOS-3533-sdk-chaining-example-command-does-not-execute
|\
| * b632a9d - Merge branch 'develop' into IOS-3533-sdk-chaining-example-command-does-not-execute
| |\
| |/
|/|
* | 0f6b2c4 - (tag: develop-226) Merge pull request #278 from tangem/master
/
* f22dcfd - IOS-3533 Added a hack to delay the execution of the second command in chaining example
* 36a3eb9 - (HEAD -> release/3.7.0, tag: develop-230, origin/develop, develop) Merge pull request #283 from tangem/master
* 134866c - (tag: develop-229, tag: 29) Merge pull request #280 from tangem/IOS-3575-sdk-research-implement-custom-card-image
* 4751c9c - Merge branch 'develop' into IOS-3575-sdk-research-implement-custom-card-image
* b6fabd2 - IOS-3575 Displaying UIImage as an NFC tag for more flexibility
* 15cfa9a - IOS-3575 Renamed the type
* e3d7b78 - IOS-3575 Changed the code order
* 69bf337 - IOS-3575 Added some docs
* 83fe4f6 - IOS-3575 Whitespace
* 3f9e59c - IOS-3575 Added a way to show an image in the ReadView
2 changes: 1 addition & 1 deletion TangemSdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TangemSdk'
s.version = '3.6.0'
s.version = '3.7.0'
s.summary = 'Use TangemSdk for Tangem cards integration'

# This description is used to generate tags and improve search results.
Expand Down
16 changes: 16 additions & 0 deletions TangemSdk/TangemSdk/UI/TangemSdkStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class TangemSdkStyle: ObservableObject {
public var colors: Colors = .default
public var textSizes: TextSizes = .default
public var indicatorWidth: Float = 12
public var nfcTag: NFCTag = .genericCard

public static var `default`: TangemSdkStyle = .init()
}
Expand Down Expand Up @@ -66,3 +67,18 @@ public extension TangemSdkStyle {
public static var `default`: TextSizes = .init()
}
}

@available(iOS 13.0, *)
public extension TangemSdkStyle {
/// Options for displaying different tags on the scanning screen
enum NFCTag {
/// Generic card provided by the SDK
case genericCard

/// 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(uiImage: UIImage, verticalOffset: Double)
}
}
1 change: 1 addition & 0 deletions TangemSdk/TangemSdk/UI/Views/Scan/CardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct CardView: View {
RoundedRectangle(cornerRadius: 10)
.fill(cardColor)
.overlay(overlay)
.aspectRatio(CGSize(width: 210, height: 130), contentMode: .fit)
}

@ViewBuilder
Expand Down
18 changes: 15 additions & 3 deletions TangemSdk/TangemSdk/UI/Views/Scan/ReadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ struct ReadView: View {
.frame(width: 240, height: 240)
.offset(y: -160)

CardView(cardColor: style.colors.cardColor,
starsColor: style.colors.starsColor)
.frame(width: 210, height: 130)
tagView
.frame(minWidth: 210, maxWidth: 210)
.offset(cardOffset)
.animation(Animation
.easeInOut(duration: 1)
Expand All @@ -40,6 +39,19 @@ struct ReadView: View {
cardOffset.width = 0
}
}

@ViewBuilder
private var tagView: some View {
switch style.nfcTag {
case .genericCard:
CardView(cardColor: style.colors.cardColor, starsColor: style.colors.starsColor)
case .image(let uiImage, let verticalOffset):
Image(uiImage: uiImage)
.resizable()
.aspectRatio(contentMode: .fit)
.offset(y: verticalOffset)
}
}
}

@available(iOS 13.0, *)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.0
3.7.0

0 comments on commit 06e1372

Please sign in to comment.