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 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 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 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
// | |
// ChatBubble.swift | |
// ios14-demo | |
// | |
// Created by Prafulla Singh on 25/7/20. | |
// | |
import SwiftUI | |
struct ChatBubble<Content>: View where Content: View { | |
let direction: ChatBubbleShape.Direction |
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 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 { |
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 | |
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 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 WebKit | |
struct ContentView: View { | |
@ObservedObject var webViewStateModel: WebViewStateModel = WebViewStateModel() | |
var body: some View { | |
NavigationView { | |
LoadingView(isShowing: .constant(webViewStateModel.loading)) { //loading logic taken from https://stackoverflow.com/a/56496896/9838937 | |
//Add onNavigationAction if callback needed |
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 | |
import os | |
@main | |
struct ios14DemoApp: App { | |
@StateObject var notificationCenter = NotificationCenter() | |
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate | |
var body: some Scene { | |
WindowGroup { |
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 Banner: View { | |
struct BannerDataModel { | |
var title:String | |
var detail:String | |
var type: BannerType | |
} | |
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 { | |
static var test:String = "" | |
static var testBinding = Binding<String>(get: { test }, set: { test = $0 } ) | |
var body: some View { | |
NavigationView { | |
VStack(alignment: .leading) { | |
Text("Enter Review Comments:") | |
MultilineTextField("Type here", text: ContentView.testBinding, onCommit: { |
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 CardContent: View { | |
public var body: some View { | |
ZStack { | |
Color.gray | |
Text("Main View") | |
SlideOverView { | |
VStack { |
NewerOlder