Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
divadretlaw committed Jun 14, 2024
1 parent 76ec3ed commit 03585a0
Showing 9 changed files with 22 additions and 10 deletions.
6 changes: 6 additions & 0 deletions Sources/CustomAlert/API+Bool.swift
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ import SwiftUI
import Combine
import WindowKit

// MARK: - Default API

public extension View {
/// Presents an alert when a given condition is true, using an optional text view for
/// the title.
@@ -115,6 +117,8 @@ public extension View {
}
}

// MARK: - WindowScene API

public extension View {
/// Presents an alert when a given condition is true, using an optional text view for
/// the title.
@@ -221,6 +225,8 @@ public extension View {
}
}

// MARK: - Convenience API

public extension View {
/// Presents an alert when a given condition is true, using an optional text view for
/// the title.
7 changes: 6 additions & 1 deletion Sources/CustomAlert/API+Identifiable.swift
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ import SwiftUI
import Combine
import WindowKit

// MARK: - Default API

public extension View {
/// Presents an alert when a given condition is true, using an optional text view for
/// the title.
@@ -33,7 +35,6 @@ public extension View {
@ViewBuilder actions: @escaping (Item) -> Actions
) -> some View where Item: Identifiable, Content: View, Actions: View {
modifier(

CustomAlertItemHandler(
item: item,
windowScene: nil,
@@ -120,6 +121,8 @@ public extension View {
}
}

// MARK: - WindowScene API

public extension View {
/// Presents an alert when a given condition is true, using an optional text view for
/// the title.
@@ -238,6 +241,8 @@ public extension View {
}
}

// MARK: - Convenience API

public extension View {
/// Presents an alert when a given condition is true, using an optional text view for
/// the title.
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ extension CustomAlertConfiguration {
public var alignment: CustomAlertAlignment = .center

/// Create a custom configuration
///
///
/// - Parameter configure: Callback to change the default configuration
///
/// - Returns: The customized ``CustomAlertConfiguration/Alert`` configuration
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ import Foundation
import SwiftUI

extension CustomAlertConfiguration {
/// Configuration values of a custom alert button
public struct Button {
/// Configuration values of a custom alert button
/// The tint color of the alert button
public var tintColor: Color?
/// The pressed tint color of the alert button
@@ -41,7 +41,7 @@ extension CustomAlertConfiguration {
}

/// Create a custom configuration
///
///
/// - Parameter configure: Callback to change the default configuration
///
/// - Returns: The customized ``CustomAlertConfiguration/Button`` configuration
Original file line number Diff line number Diff line change
@@ -28,9 +28,9 @@ public struct CustomAlertConfiguration {
public var dismissOnBackgroundTap: Bool = false

/// Create a custom configuration
///
///
/// - Parameter configure: Callback to change the default configuration
///
///
/// - Returns: The customized ``CustomAlertConfiguration`` configuration
public static func create(configure: (inout Self) -> Void) -> Self {
var configuration = Self()
2 changes: 1 addition & 1 deletion Sources/CustomAlert/CustomAlertHandler+Item.swift
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ struct CustomAlertItemHandler<AlertItem, AlertContent, AlertActions>: ViewModifi
}

/// The view identity of the alert
///
///
/// The `alertIdentity` represents the individual parts of the alert but combined into a single view.
///
/// When attached to the content of the represeting view, any changes here will propagate to the content of the window which hosts the alert.
2 changes: 1 addition & 1 deletion Sources/CustomAlert/Extensions/EdgeInsetsExtensions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// EdgeInsets.swift
// EdgeInsetsExtensions.swift
// CustomAlert
//
// Created by David Walter on 31.03.24.
1 change: 1 addition & 0 deletions Sources/CustomAlert/Helper/ApplyTint.swift
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ extension View {
func applyTint(_ uiColor: UIColor?) -> some View {
modifier(TintApplier(uiColor: uiColor))
}

func applyTint(_ color: Color?) -> some View {
modifier(TintApplier(color: color))
}
4 changes: 2 additions & 2 deletions Sources/CustomAlert/Helper/OnSimultaneousTapGesture.swift
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ extension View {
private struct SimultaneousTapGestureViewModifier: ViewModifier {
let count: Int
let action: () -> Void

init(
count: Int,
perform action: @escaping () -> Void
@@ -100,7 +100,7 @@ private struct SimultaneousTapGesture: UIViewRepresentable {
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return false
}

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return false
}

0 comments on commit 03585a0

Please sign in to comment.