Post

Replies

Boosts

Views

Activity

Reply to why HStack items not alignnment in SwiftUI?
İtems inside of the Hstack, not align.  HStack {                     Text(i.name)             .frame(width:100)             .padding()                      GeometryReader { g in             HStack{               Spacer(minLength: 0)               Rectangle()                 .fill(i.color)                 .frame(width: self.getWidth(width: g.frame(in: .global).width, value: i.percent) ,height: 10)                                              Text(String(format: "\(i.percent)", "%.0f"))                 .fontWeight(.bold)                 .padding(.leading,10)                 .frame(width:80)                Spacer()                                            }.frame(width: 240, height: 30)                                      }                     } Here, rest of the code struct Pie: Identifiable {   var id : Int   var percent : CGFloat   var name : String   var color : Color } struct DrawShape: View {   var center: CGPoint   var index: Int       var body: some View {     Path {path in       path.move(to: self.center)       path.addArc(center: self.center, radius: 180, startAngle: .init(degrees: self.from()), endAngle: .init(degrees: self.to()), clockwise: false)     }     .fill(data[index].color)   }       func from () - Double {     if index == 0 {       return 0     }     else {       var temp: Double = 0               for i in 0...index-1 {         temp += Double(data[i].percent/100)*360       }       return temp     }        }           func to() - Double {     var temp: Double = 0     for i in 0...index {       temp += Double(data[i].percent / 100) * 360     }     return temp      } } var data = [   Pie(id:0, percent: 10, name: "news", color: Color("Black")),   Pie(id:1, percent: 90, name: "sport", color: Color("Blue")) ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’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 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 why HStack items not alignnment in SwiftUI?
İtems inside of the Hstack, not align.  HStack {                     Text(i.name)             .frame(width:100)             .padding()                      GeometryReader { g in             HStack{               Spacer(minLength: 0)               Rectangle()                 .fill(i.color)                 .frame(width: self.getWidth(width: g.frame(in: .global).width, value: i.percent) ,height: 10)                                              Text(String(format: "\(i.percent)", "%.0f"))                 .fontWeight(.bold)                 .padding(.leading,10)                 .frame(width:80)                Spacer()                                            }.frame(width: 240, height: 30)                                      }                     } Here, rest of the code struct Pie: Identifiable {   var id : Int   var percent : CGFloat   var name : String   var color : Color } struct DrawShape: View {   var center: CGPoint   var index: Int       var body: some View {     Path {path in       path.move(to: self.center)       path.addArc(center: self.center, radius: 180, startAngle: .init(degrees: self.from()), endAngle: .init(degrees: self.to()), clockwise: false)     }     .fill(data[index].color)   }       func from () - Double {     if index == 0 {       return 0     }     else {       var temp: Double = 0               for i in 0...index-1 {         temp += Double(data[i].percent/100)*360       }       return temp     }        }           func to() - Double {     var temp: Double = 0     for i in 0...index {       temp += Double(data[i].percent / 100) * 360     }     return temp      } } var data = [   Pie(id:0, percent: 10, name: "news", color: Color("Black")),   Pie(id:1, percent: 90, name: "sport", color: Color("Blue")) ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to How can I handle NavigationLink for HStack row
`struct ContentView_Previews: PreviewProvider { static var previews: some View {     NavigationView{ ContentView() } } here I mentioned if you look at carefully
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to How can I handle NavigationLink for HStack row
in question, I put the same except 'ContentView_Previews' , but even still I did not get the answer for question. I guess still my question not understood.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Why after pod install throw that error?
I had a $(inherited) but recursive, just change it to non-recursive project target -> build settings -> framework_search_path
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Value of type 'UISearchBar' has no member 'showLoading'
Yes you are right, get it now, let me check again
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?
like that NewService(NSString* _Nullable Address, NSString* _Nullable rAddress, id<ServiceCallback> _Nullable serviceCallback, NSError* _Nullable* _Nullable error);
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
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 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 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 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 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 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 Xcode 13 not loading
delete xcode completely and download again
Replies
Boosts
Views
Activity
Sep ’21
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