SwiftUI Tricks: Part 2

Photo by Amza Andrei on Unsplash
Button {
// do some logic
} label: {
// some fancy UI
}
.buttonStyle(PlainButtonStyle())
/// A button style that doesn't style or decorate its content while idle, but
/// may apply a visual effect to indicate the pressed, focused, or enabled state
/// of the button.
struct NoneButtonStyle: ButtonStyle {
func makeBody(configuration: Self.Configuration) -> some View {
configuration.label
}
}
Button {
// do some logic
} label: {
// some fancy UI
}
.buttonStyle(NoneButtonStyle())

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Connet 4 Game on iOS (四子棋 )

Implementation of graphql in iOS

Expandable Button in SwiftUI

Bereev 2.0 is live! 🎉

How I Got 1.3k 5 Stars with a Simple iOS App

Xcode build error when upgrade swift package dependency version

Building blocks of Core Data

Type-safe assets in Swift

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dmitrijs Beloborodovs

Dmitrijs Beloborodovs

iOS Architect

More from Medium

Flavors of SwiftUI Picker on macOS

SwiftUI — Make Content Scrollable when DynamicFont scales up

Stacks in SwiftUI

Detecting Screen Size/Resolution Changes in macOS with SwiftUI