This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BottomAnchoredModalTransitioner.swift | |
// BB Links | |
// | |
// Created by Justin Stanley on 2017-09-07. | |
// Copyright © 2017 Justin Stanley. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |