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 Thread 1: Fatal error: No ObservableObject of type msgDatas found. A View.environmentObject(_:) for msgDatas may be missing as an ancestor of this view.
I solve problem, when I calling @State struct Home: View {   @EnvironmentObject var data : msgDatas   @State var show: Bool = false         var body : some View{           ZStack{               Color("bg").edgesIgnoringSafeArea(.top)               NavigationLink(destination: Chat(), isActive: self.$show) {                 Text("")       }       VStack{                   topView()       }     }   } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’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 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 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 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 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 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 Why list menu items not shown in SwiftUI project?
tnx, I try but nothing change
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’21
Reply to Why list menu items not shown in SwiftUI project?
I put VStack to where, if u show , I will be appreciated.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’21
Reply to Why list menu items not shown in SwiftUI project?
yes ,I put in xcassets icons, even ı was chabge with different icons. I guess it is commulated in list view with text. I do not know how solve it
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’21
Reply to when click list item, open new SwiftUI for every list items in SwiftUI
Tnx so much , I have intent to use it for settings menu in medicine app, for example in settings list menu I have items like that, Account, Appearance, Notifications, Contact us.. that is why I need new view for every items. If you consider for contact apps, yes I agree it is not good idea. I do not know can I use ur solution for my medicine app?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’21
Reply to when click list item, open new SwiftUI for every list items in SwiftUI
tnx so much for ur answer, I mean for example u have four list items, like NumberOne, NumberTwo, NumberThree, NumberFour, when You click any items, it can route new view like NumberOneView, NumberTwoView, NumberThreeView, NumberFourView. Hope it is clear :)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’21
Reply to when click list item, open new SwiftUI for every list items in SwiftUI
yes definitely, for every items, new view :)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’21
Reply to Thread 1: Fatal error: No ObservableObject of type msgDatas found. A View.environmentObject(_:) for msgDatas may be missing as an ancestor of this view.
@OOPer I am not insult u, I am just fed up question question...I need solution, I respect u whole my hearth.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’21
Reply to Thread 1: Fatal error: No ObservableObject of type msgDatas found. A View.environmentObject(_:) for msgDatas may be missing as an ancestor of this view.
Brother as I said u, u are not here for solution, u just ask question
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’21
Reply to Thread 1: Fatal error: No ObservableObject of type msgDatas found. A View.environmentObject(_:) for msgDatas may be missing as an ancestor of this view.
I solve problem, when I calling @State struct Home: View {   @EnvironmentObject var data : msgDatas   @State var show: Bool = false         var body : some View{           ZStack{               Color("bg").edgesIgnoringSafeArea(.top)               NavigationLink(destination: Chat(), isActive: self.$show) {                 Text("")       }       VStack{                   topView()       }     }   } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’21