- Auto resize circle to fit at inner text.
- Border line can be set.
- Background color can be set.
Font size can be set.Not yet.- Font color can be set.
Usage example
var body: some View {
CircularTextButton("This is Button") {
// Do something here -> button tap action
}
.tintColor(.black) // font color
.setBackgroundColor(.gray) // background color
.stroke(.black, lineWidth: 2) // stroke
.textPadding(10) // padding between text, circle inner line
}
Usage example
@State var introSliderPresent = false
var body: some View {
VStack {
// your view
}
.onAppear {
introSliderPresent = true
}
.fullScreenCover(isPresented: $introSliderPresent) {
IntroSlider(items: [
IntroSliderItem(backgroundColor: .yellow, title: "Hello World!", content: "This is Hello Yellow Page!"),
IntroSliderItem(backgroundColor: .red, title: "Hello World!", content: "This is Hello Red Page!"),
IntroSliderItem(backgroundColor: .green, title: "Hello World!", content: "This is Hello Green Page!")
])
}
}
- For developers whose project's target iOS version < 17.0 Usage example
ZStack {
Color.blue.ignoresSafeArea()
VStack {
Text("Hello World")
Spacer()
}
.safeAreaPadding()
}
- text: String main text string
- caption: String caption text string
- action: () -> Void button tap action
- alignment: HorizontalAlignment -> default: .center text alignment in button
- backgroundColor: Color -> default: .blue background color
- fontColor: Color -> default: .white main text color
- captionColor: Color -> default: .gray caption text color
- scale: RoundedTextButtonScale -> default: .fit .fit, .fill(Bool) whether you want to fill button width to parent view or not
- font: Font -> default: .headline main text font
- captionFont: Font -> default: .caption caption text font
- cornerRadius: CGFloat -> default: 10 button corner radius value
Usage example
RoundedTextButton("Test Text", caption: "Hello world") { // caption removable
print("Button Tapped")
}
.scaleMode(.fit) // default: .fit