mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-10 07:13:28 +01:00
Reorganize AltStore project into UIKit and SwiftUI folders
This commit is contained in:
35
AltStore/SwiftUI/View Extensions/Modifiers.swift
Normal file
35
AltStore/SwiftUI/View Extensions/Modifiers.swift
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Modifiers.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by Fabian Thies on 01.12.22.
|
||||
// Copyright © 2022 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
extension View {
|
||||
|
||||
@ViewBuilder func `if`<Content: View>(_ condition: Bool, @ViewBuilder transform: (Self) -> Content) -> some View {
|
||||
if condition {
|
||||
transform(self)
|
||||
} else {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ViewBuilder func searchable(text: Binding<String>, placeholder: String) -> some View {
|
||||
if #available(iOS 15.0, *) {
|
||||
self.searchable(text: text, prompt: Text(placeholder))
|
||||
} else {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder func tintedBackground(_ color: Color) -> some View {
|
||||
self
|
||||
.blurBackground(.systemUltraThinMaterial)
|
||||
.background(color.opacity(0.4))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user