SHORT QUESTIONS
How i will Read & Write Data in path Swift?
//directory let path = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent(“fileSave”) let data: Data! //for Read Data do{ data = try Data(contentsOf: path)
Read moreCustom viewDidLoad() Modifier in SwiftUI
// // ViewDidLoadView.swift // BeginerLabelAllDemo // // Created by JOYNAL ABEDIN on 22/10/22. // import SwiftUI struct ViewDidLoadView: View {
Read moreHow i will change color & text in keyboard return button swiftui?
Using .submitLabel() modifier we can change it. .submitLabel(.route) .submitLabel(.next) .submitLabel(.search) also we can fetch the action of return button .onSubmit
Read moreHow i will swipe list item in swiftUI?
// // ListSwipeView.swift // BeginerLabelAllDemo // // Created by JOYNAL ABEDIN on 22/10/22. // import SwiftUI struct ListSwipeView: View {
Read moreHow i will select text in swiftUI?
Using .textSelection() modifier we can select text .textSelection(.enabled)
Read moreWhere we should use @StateObject @ObservedObjec in SwiftUI?
@StateObject -> Use this on creation/init() in parent view @ObservedObject -> Use this for subViews() in parent view
Read moreHow i will check is it dark mode or light mode in swiftUI?
@Environment(\.colorScheme) var colorScheme colorScheme == .light or colorScheme == .dark
Read moreHow i will back previous view without using .navigationBar() in swiftUI?
Declare in properties field top in the View: @Environment(\.presentationMode) var presentationMode finally write the action code: presentationMode.wrappedValue.dismiss()
Read moreHow i will show new screen using .sheet(), Transition & AnimationOffset in SwiftUI?
import SwiftUI struct PopOverUsingTransitionOffsets: View { @State private var showSheet = false @State private var showNewScreen = false var body:
Read more