Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[alert-helper] Add helper for showing alert based on optional #37

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

lailabecker
Copy link
Contributor

Mostly for displaying enums

public extension View {
func alert<T, Message, Actions>(presenting: Binding<T?>,
title: (T) -> LocalizedStringKey,
@ViewBuilder message: (T) -> Message,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.

func alert<T, Message, Actions>(presenting: Binding<T?>,
title: (T) -> LocalizedStringKey,
@ViewBuilder message: (T) -> Message,
@ViewBuilder actions: (T) -> Actions) -> some View where Actions: View, Message: View {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.


func alert<T, Message, Actions>(presenting: Binding<T?>,
title: (T) -> String,
@ViewBuilder message: (T) -> Message,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.

func alert<T, Message, Actions>(presenting: Binding<T?>,
title: (T) -> String,
@ViewBuilder message: (T) -> Message,
@ViewBuilder actions: (T) -> Actions) -> some View where Actions: View, Message: View {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.

func alert<T, Actions>(presenting: Binding<T?>,
title: (T) -> LocalizedStringKey,
message: (T) -> LocalizedStringKey,
@ViewBuilder actions: (T) -> Actions) -> some View where Actions: View {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.

func cancellableSheet<Content>(isPresented: Binding<Bool>,
cancelButtonLabel: LocalizedStringKey,
cancelPlacement: ToolbarItemPlacement = .topBarLeading,
@ViewBuilder content: @escaping () -> Content) -> some View where Content : View {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.

func alert<T, Actions>(presenting: Binding<T?>,
title: (T) -> LocalizedStringKey,
message: (T) -> String,
@ViewBuilder actions: (T) -> Actions) -> some View where Actions: View {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.

func alert<T, Actions>(presenting: Binding<T?>,
title: (T) -> String,
message: (T) -> LocalizedStringKey,
@ViewBuilder actions: (T) -> Actions) -> some View where Actions: View {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.

func alert<T, Actions>(presenting: Binding<T?>,
title: (T) -> String,
message: (T) -> String,
@ViewBuilder actions: (T) -> Actions) -> some View where Actions: View {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters should be aligned vertically if they're in multiple lines in a declaration.

var itemSpacing: CGFloat?
var items: [AnyView]

init(labelGenerator: @escaping (Int) -> Label, labelSpacing: CGFloat? = nil, itemSpacing: CGFloat? = nil, @OrderedListBuilder items: () -> [AnyView]) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should be 140 characters or less: currently 155 characters

Copy link

codeclimate bot commented Jan 23, 2025

Code Climate has analyzed commit c6197cc and detected 10 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 9
Complexity 1

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants