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 | |
@main | |
struct ios14_demoApp: App { | |
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate | |
var body: some Scene { | |
WindowGroup { | |
ContentView() |
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
// | |
// ios14_demoApp.swift | |
// ios14-demo | |
// | |
// Created by Prafulla Singh on 23/6/20. | |
// | |
import SwiftUI | |
@main | |
struct ios14_demoApp: App { |
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 | |
public struct CirclerPercentageProgressViewStyle : ProgressViewStyle { | |
public func makeBody(configuration: LinearProgressViewStyle.Configuration) -> some View { | |
VStack(spacing: 10) { | |
configuration.label | |
.foregroundColor(Color.secondary) | |
ZStack { | |
Circle() | |
.stroke(lineWidth: 15.0) | |
.opacity(0.3) |
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
public struct CirclerPercentageProgressViewStyle : ProgressViewStyle { | |
public func makeBody(configuration: LinearProgressViewStyle.Configuration) -> some View { | |
VStack(spacing: 10) { | |
configuration.label | |
.foregroundColor(Color.secondary) | |
ZStack { | |
Circle() | |
.stroke(lineWidth: 15.0) | |
.opacity(0.3) | |
.foregroundColor(Color.accentColor.opacity(0.5)) |
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
// | |
// keyboardToolBar.swift | |
// ios14-demo | |
// | |
// Created by Prafulla Singh on 4/10/20. | |
// | |
import SwiftUI | |
final class KeyboardResponder: ObservableObject { |
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 KeyboardView<Content, ToolBar> : View where Content : View, ToolBar: View { | |
@StateObject private var keyboard: KeyboardResponder = KeyboardResponder() | |
let toolbarFrame: CGSize = CGSize(width: UIScreen.main.bounds.width, height: 40.0) | |
var content: () -> Content | |
var toolBar: () -> ToolBar | |
var body: some View { | |
ZStack { | |
content() | |
.padding(.bottom, (keyboard.currentHeight == 0) ? 0 : toolbarFrame.height) |
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 KeyboardResponder: ObservableObject { | |
private var notificationCenter: NotificationCenter | |
@Published private(set) var currentHeight: CGFloat = 0 | |
init(center: NotificationCenter = .default) { | |
notificationCenter = center | |
notificationCenter.addObserver(self, selector: #selector(keyBoardWillShow(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil) | |
notificationCenter.addObserver(self, selector: #selector(keyBoardWillHide(notification:)), name: UIResponder.keyboardWillHideNotification, object: nil) | |
} |
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 PreviewsDemo: View { | |
var body: some View { | |
ZStack { | |
Color(UIColor.systemBackground) | |
Text("Hello, World!") | |
}.ignoresSafeArea() | |
} | |
} |
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 FloatingTextField: View { | |
let textFieldHeight: CGFloat = 50 | |
private let placeHolderText: String | |
@Binding var text: String | |
@State private var isEditing = false | |
public init(placeHolder: String, | |
text: Binding<String>) { | |
self._text = text | |
self.placeHolderText = placeHolder |
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
// | |
// Marque.swift | |
// ios14-demo | |
// | |
// Created by Prafulla Singh on 23/9/20. | |
// | |
import SwiftUI | |
struct Marque: View { |