mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[ADD] Search bar for BrowseView on iOS 15
This commit is contained in:
29
AltStore/View Extensions/Modifiers.swift
Normal file
29
AltStore/View Extensions/Modifiers.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// 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, 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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user