Post

Replies

Boosts

Views

Activity

Reply to How can I use multiple `.alert` dialog in SwiftUI?
here some example but I do not know how I will add two delete method to one .alert dialog struct AlertInfo: Identifiable { enum AlertType { case one case two } let id: AlertType let title: String let message: String } struct ContentView6: View { // 2 @State private var info: AlertInfo? var body: some View { VStack { Button("Alert 1") { // 3 info = AlertInfo( id: .one, title: "Title 1", message: "Message 1") } Button("Alert 2") { // 4 info = AlertInfo( id: .two, title: "Title 2", message: "Message 2") } } .alert(item: $info, content: { info in // 5 Alert(title: Text(info.title), message: Text(info.message)) }) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’22
Reply to How can I use the searchable feature for my row data in SwiftUI?
HStack{                           Text(data.user)                   .searchable(text: $searchText, placement: .navigationBarDrawer)                   .font(.caption)                   .foregroundColor(.black)               } model: struct Recent: Identifiable {   var id = UUID().uuidString   var user: String    } let data= [   Recent(user: "skysoft1"),   Recent(user: "skysoft2"),   Recent(user: "skysoft3"), ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to Trailing closure passed to parameter of type 'Int' that does not accept a closure
on line 2 I get error, in TabView , and  how onboardingData and OnboardingCard are defined it is defined as OnboardingCard: fileprivate struct OnboardingCard: View {   let onboardingItem: OnboardingItem     var body: some View {       VStack {         Image(onboardingItem.imageName)          .resizable()         .frame(width:340, height:340)                 Text(onboardingItem.title)         .font(.title)           .foregroundColor(.black)         .bold()         .padding()         Text(onboardingItem.description)         .multilineTextAlignment(.center)         .font(.body)         .foregroundColor(.gray)         .padding (.horizontal, 15)         }        }        } onboardingData:   var onboardingData: [OnboardingItem] = [   OnboardingItem(imageName: "image1", title: "Welcome1", description: "description1"),   OnboardingItem(imageName: "image2", title: "Welcome2", description: "description2"),     OnboardingItem(imageName: "image3", title: "Welcome3", description: "description3"),   OnboardingItem(imageName: "image4", title: "Welcome4", description: "description4")   ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Why I get notification always in macbook in top right corner?
I cannot load image here, take error, when I update my macbook to macos venture, it is give alots notification on top right corner like "background items added", why I don't know what is the problem
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Xcode 13.3 - can't update
it is download, u can follow it in launchpad menu
Replies
Boosts
Views
Activity
Mar ’22
Reply to What is the difference between Data and [UInt8]?
UInt8 is an unsigned integer which can store only positive values.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Why it is throw an error as "Return from initializer without initializing all stored properties" in SwiftUI?
when I use    @State var show = false in RegisterFirstScreen, it fix error.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Why it says "Function is unused" in SwiftUI?
I forget put the () end of the signUp    self.viewModel.signUp()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to How can I use multiple `.alert` dialog in SwiftUI?
here some example but I do not know how I will add two delete method to one .alert dialog struct AlertInfo: Identifiable { enum AlertType { case one case two } let id: AlertType let title: String let message: String } struct ContentView6: View { // 2 @State private var info: AlertInfo? var body: some View { VStack { Button("Alert 1") { // 3 info = AlertInfo( id: .one, title: "Title 1", message: "Message 1") } Button("Alert 2") { // 4 info = AlertInfo( id: .two, title: "Title 2", message: "Message 2") } } .alert(item: $info, content: { info in // 5 Alert(title: Text(info.title), message: Text(info.message)) }) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to why it throw an error as "'animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead"in SwiftUI 3.0?
I forget to add value after .spring(), it is work for me now.  @Binding var display: Bool   private var background: some View {   Color.black    .fillParent()    .opacity(0.6)    .animation(.spring(), value: display)      }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to Xcode 13 not loading
delete xcode completely and download again
Replies
Boosts
Views
Activity
Sep ’21
Reply to How can I use the searchable feature for my row data in SwiftUI?
@OOP, I show below
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to How can I use the searchable feature for my row data in SwiftUI?
HStack{                           Text(data.user)                   .searchable(text: $searchText, placement: .navigationBarDrawer)                   .font(.caption)                   .foregroundColor(.black)               } model: struct Recent: Identifiable {   var id = UUID().uuidString   var user: String    } let data= [   Recent(user: "skysoft1"),   Recent(user: "skysoft2"),   Recent(user: "skysoft3"), ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Trailing closure passed to parameter of type 'Int' that does not accept a closure
As OOPers and Claude mentions in comment, when we called the TabView as MyTabView problem solved
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Trailing closure passed to parameter of type 'Int' that does not accept a closure
on line 2 I get error, in TabView , and  how onboardingData and OnboardingCard are defined it is defined as OnboardingCard: fileprivate struct OnboardingCard: View {   let onboardingItem: OnboardingItem     var body: some View {       VStack {         Image(onboardingItem.imageName)          .resizable()         .frame(width:340, height:340)                 Text(onboardingItem.title)         .font(.title)           .foregroundColor(.black)         .bold()         .padding()         Text(onboardingItem.description)         .multilineTextAlignment(.center)         .font(.body)         .foregroundColor(.gray)         .padding (.horizontal, 15)         }        }        } onboardingData:   var onboardingData: [OnboardingItem] = [   OnboardingItem(imageName: "image1", title: "Welcome1", description: "description1"),   OnboardingItem(imageName: "image2", title: "Welcome2", description: "description2"),     OnboardingItem(imageName: "image3", title: "Welcome3", description: "description3"),   OnboardingItem(imageName: "image4", title: "Welcome4", description: "description4")   ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Value of type 'Text' has no member 'searchable'
no last version Version 12.5.1
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Cannot convert value of type 'EventsTrigger' to expected argument type 'String?
I find second parameter, it fix error, tnx :)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Cannot convert value of type 'EventsTrigger' to expected argument type 'String?
actually, I just put code to fix that problem. I don't know what will be need to solve?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21