This file contains hidden or 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 StackGeometryReader: View { | |
@Binding var takePic: Bool | |
@State private var contentHeight: CGFloat = 0 | |
var body: some View { | |
VStack { | |
PrintableCells(color: Color.pink) | |
PrintableCells(color: Color.red) |
This file contains hidden or 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 Demo: View { | |
@State private var text = "" | |
var body: some View { | |
NavigationView { | |
VStack(alignment: .leading){ | |
Text("How are you feeing today?") | |
.font(.title) | |
CustomTextEditor.init(placeholder: "Start typing..", text: $text) | |
.font(.body) |
This file contains hidden or 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 RefreshControl: View { | |
var coordinateSpace: CoordinateSpace | |
var onRefresh: ()->Void | |
@State var refresh: Bool = false | |
var body: some View { | |
GeometryReader { geo in | |
if (geo.frame(in: coordinateSpace).midY > 50) { | |
Spacer() |
This file contains hidden or 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 RefreshControl: View { | |
var coordinateSpace: CoordinateSpace | |
var onRefresh: ()->Void | |
@State var refresh: Bool = false | |
var body: some View { | |
GeometryReader { geo in | |
if (geo.frame(in: coordinateSpace).midY > 50) { | |
Spacer() |
This file contains hidden or 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 SearchBarDemo: View { | |
@State private var searchText = "" | |
@State private var isEditing = false | |
let countryList = Locale.isoRegionCodes.compactMap { Locale.current.localizedString(forRegionCode: $0) } | |
var body: some View { | |
NavigationView { | |
List { |
This file contains hidden or 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 SearchBarDemo: View { | |
@State private var searchText = "" | |
@State private var isEditing = false | |
let countryList = Locale.isoRegionCodes.compactMap { Locale.current.localizedString(forRegionCode: $0) } | |
var body: some View { | |
NavigationView { | |
List { | |
Section.init(header: | |
SearchBar(text: $searchText, isEditing: $isEditing), |
This file contains hidden or 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 text: String | |
@Binding var isEditing: Bool | |
init(text: Binding<String>, isEditing: Binding<Bool>) { | |
self._text = text | |
self._isEditing = isEditing | |
} | |
var body: some View { |
This file contains hidden or 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 | |
import VisionKit | |
final class ContentViewModel: NSObject, ObservableObject { | |
@Published var errorMessage: String? | |
@Published var imageArray: [UIImage] = [] | |
func getDocumentCameraViewController() -> VNDocumentCameraViewController { | |
let vc = VNDocumentCameraViewController() | |
vc.delegate = self |
This file contains hidden or 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
final class ContentViewModel: NSObject, ObservableObject { | |
@Published var errorMessage: String? | |
@Published var imageArray: [UIImage] = [] | |
} | |
struct ContentView: View { | |
@ObservedObject var viewModel: ContentViewModel | |
var body: some View { | |
NavigationView { |
This file contains hidden or 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 ExpandableText: View { | |
@State private var expanded: Bool = false | |
@State private var truncated: Bool = false | |
@State private var shrinkText: String | |
private var text: String | |
let font: UIFont | |
let lineLimit: Int | |
private var moreLessText: String { |