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
// MARK: - Modifier | |
/// Choosable Sheet for FullScreen or Sheet Modal | |
struct ChooseableSheet<Destination>: ViewModifier where Destination: View { | |
// Select it's fullscreen sheet or modal sheet | |
@Binding var isFullScreen: Bool | |
@Binding var isPresented: Bool | |
private let fullScreenContent: () -> Destination? |
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 PhotosUI | |
struct ImagePickerView: UIViewControllerRepresentable { | |
@Binding var image: UIImage | |
init(image: Binding<UIImage>) { | |
self._image = image | |
} |
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 PhotosUI | |
struct ImagePickerView: UIViewControllerRepresentable { | |
let numOfSelectedPictures: Int // This is the number of selected photos | |
@Binding var images: [UIImage] | |
init(numOfSelectedPictures: Int, images: Binding<[UIImage]>) { | |
self.numOfSelectedPictures = numOfSelectedPictures |
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 ContentView: View { | |
@State var text = "Placeholder" | |
var body: some View { | |
TextEditor(text: self.$text) | |
.foregroundColor(self.text == "Placeholder" ? .gray : .primary) | |
.onAppear { | |
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: .main) { (noti) in |
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 TextEditorPlaceHolder: View { | |
@State private var text: String = "" | |
private let screenWidth = UIScreen.main.bounds.width | |
var body: some View { | |
VStack { | |
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 MyTextView: UIViewRepresentable { | |
@Binding var text: String | |
init(text: Binding<String>) { | |
self._text = text | |
} | |
func makeUIView(context: UIViewRepresentableContext<MyTextView>) -> UITextView { | |
let textView = UITextView(frame: .zero) |
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 { | |
var body: some View { | |
NavigationView { | |
VStack { | |
NavigationLink(destination: ChildView()) { Text("Child View") } | |
.isDetailLink(false) | |
/* |
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 var selectedIndex: Int? = nil | |
let options: [String] = ["Option1", "Option2"] | |
var body: some View { | |
PickerField("Select an option", data: self.options, selectionIndex: self.$selectedIndex) | |
} | |
} |
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
π Morning 93 commits βββββββββββββββββββββ 4.8% | |
π Daytime 845 commits βββββββββββββββββββββ 43.8% | |
π Evening 781 commits βββββββββββββββββββββ 40.5% | |
π Night 210 commits βββββββββββββββββββββ 10.9% |
NewerOlder