Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

UIlable #399

mennyaL started this conversation in Ideas
Feb 19, 2024 · 0 comments
Discussion options

import SwiftUI
import SwiftUIIntrospect
@_spi(Advanced) import SwiftUIIntrospect
public struct MyUILabelType: IntrospectableViewType {}
extension IntrospectableViewType where Self == MyUILabelType {
 public static var uiLabel: Self { .init() }
}
#if canImport(UIKit)
extension iOSViewVersion<MyUILabelType, UILabel> {
 public static let v13 = Self(for: .v13)
 public static let v14 = Self(for: .v14)
 public static let v15 = Self(for: .v15)
 public static let v16 = Self(for: .v16)
 public static let v17 = Self(for: .v17)
}
#endif

can we make this work
if i want some thing like this :

 Text("")
 .introspect(.uiLabel, on: .iOS(.v13, .v14, .v15, .v16, .v17)) { label in
 label.attributedText = NSAttributedString(string: "THis is Attributed String", attributes: [
 .font:UIFont.boldSystemFont(ofSize: 16),
 .foregroundColor: UIColor.green
 ])
 }

i try and it not work

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /