Skip to content

Commit

Permalink
Merge pull request #25 from plaidev/android-1
Browse files Browse the repository at this point in the history
[ios] Update label's number of lines based on maxLines property
  • Loading branch information
RyosukeCla committed Mar 25, 2024
2 parents 85c2ac0 + 74c1082 commit afe6935
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Nativebrik.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Nativebrik'
s.version = '0.5.2'
s.version = '0.5.3'
s.summary = 'Nativebrik SDK'
s.description = <<-DESC
Nativebrik SDK for iOS.
Expand Down
6 changes: 5 additions & 1 deletion ios/Nativebrik/Nativebrik/component/renderer/text.swift
Expand Up @@ -31,7 +31,11 @@ class TextView: AnimatedUIControl {
label.font = parseTextBlockDataToUIFont(block.data?.size, block.data?.weight, block.data?.design)
let text = compile(block.data?.value ?? "", context.getVariable())
label.text = text
label.numberOfLines = 0
if let maxLines = block.data?.maxLines {
label.numberOfLines = maxLines
} else {
label.numberOfLines = 0
}
configureSkeltonText(view: label, showSkelton: showSkelton)

self.label = label
Expand Down
1 change: 1 addition & 0 deletions ios/Nativebrik/Nativebrik/generated.swift
Expand Up @@ -514,6 +514,7 @@ struct UITextBlockData: Decodable {
var color: Color?
var design: FontDesign?
var weight: FontWeight?
var maxLines: Int?
var frame: FrameData?
var onClick: UIBlockEventDispatcher?
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Nativebrik/Nativebrik/sdk.swift
Expand Up @@ -9,7 +9,7 @@ import Foundation
import SwiftUI
import Combine

public let nativebrikSdkVersion = "0.5.2"
public let nativebrikSdkVersion = "0.5.3"
public let isNativebrikAvailable: Bool = {
if #available(iOS 15.0, *) {
return true
Expand Down

0 comments on commit afe6935

Please sign in to comment.