diff --git a/TISwiftUICore/README.md b/TISwiftUICore/README.md index 75092272..c06adcf8 100644 --- a/TISwiftUICore/README.md +++ b/TISwiftUICore/README.md @@ -1,3 +1,21 @@ # TISwiftUICore -Core UI elements: protocols, views and helpers. \ No newline at end of file +Core UI elements: protocols, views and helpers. + +## SwiftUI alerts +> SwiftUI views should conform to protocol `SwiftUIAlertContext` to present alert + +```swift +var body: some View { + Button("Show custom alert with binding property") { + alertDescription = factory.okAlert(title: "Title", message: "Message") + isPresentedCustomAlert = true + } + } + .alert(isPresented: $isPresentedAlert, on: self, alert: alertDescription) +} +``` + +# Installation via SPM + +You can install this framework as a target of LeadKit. \ No newline at end of file diff --git a/TIUIElements/README.md b/TIUIElements/README.md index 9eea58ad..923d26f4 100644 --- a/TIUIElements/README.md +++ b/TIUIElements/README.md @@ -132,7 +132,7 @@ Use to present alerts in a few lines of code. Can be used for UIKit and SwiftUI > You can initialize `AlertsFactory` with your own *LocalizationProvider* or use `DefaultAlertLocalizationProvider` ## Your view or view controller must implement PresentationContext protocol -There are `UIKitAlertContext` and `SwiftUIAlertContext` protocols that are designed to make it easier to work with `AlertPresentationContext` protocol. By default, no changes need to be made for UIKit view controllers to make them conform to `UIKitAlertContext`. +There are `UIKitAlertContext` protocol that are designed to make it easier to work with `AlertPresentationContext` protocol. By default, no changes need to be made for UIKit view controllers to make them conform to `UIKitAlertContext`. ## Custom alerts ```swift @@ -189,18 +189,6 @@ func presentDialogueAlert() { } ``` -## SwiftUI alerts -```swift -var body: some View { - Button("Show custom alert with binding property") { - alertDescription = factory.okAlert(title: "Title", message: "Message") - isPresentedCustomAlert = true - } - } - .alert(isPresented: $isPresentedAlert, on: self, alert: alertDescription) -} -``` - # Installation via SPM You can install this framework as a target of LeadKit.