View BottomAnchoredModalTransitioner.swift
// | |
// BottomAnchoredModalTransitioner.swift | |
// BB Links | |
// | |
// Created by Justin Stanley on 2017-09-07. | |
// Copyright © 2017 Justin Stanley. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
View CustomTabView.swift
import SwiftUI | |
struct ContentView: View { | |
@State private var currentIndex = 0 | |
private let colors: [Color] = [.red, .white, .blue, .green, .yellow] | |
private var whiteIsSelected: Bool { | |
colors[currentIndex] == .white | |
} | |
var body: some View { |
View SearchBar.swift
struct SearchBar : View { | |
@Binding var searchText: String | |
var body: some View { | |
HStack { | |
Image(systemName: "magnifyingglass").foregroundColor(.secondary) | |
TextField( | |
$searchText, | |
placeholder: Text("Search")) { | |
UIApplication.shared.keyWindow?.endEditing(true) |