Post

Replies

Boosts

Views

Activity

Reply to [NSJSONSerialization dataWithJSONObject:options:error:]: Invalid top-level type in JSON write
By response, I mean, for example, for if I request a user's info, then the server should give me a response of the user's info or a response of why the server refuses/fail to get the user's info. So you need to know what response the server gives when the registry is complete. And then you can parse it into an object that we can use in the app using JSONDecoder. (e.g. parse from data to a user's info. Data -> UserInfo)
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’22
Reply to Data transfer with API
I fixed it struct PatientDetail: View { private let patient: HastaViewModel var body: some View {  VStack {       Form {         Section(header: Text("Kişisel Bilgiler")) {           Text("\(patient.ad)")           Text("\(patient.soyad)")           Text("\(patient.phone)")           Text("\(patient.email)")           Text("\(patient.dogumyili)")           Text("\(patient.ulke)")           Text("\(patient.sehir)")           Text("\(patient.ilce)")           Text("\(patient.adres)")           Text("\(patient.tcno)")         }       } } } So that you only show one user/patient instead of a list of users. And then call it from the main view like List { ForEach(patientVM.hastalar, id: \.id){ patient in NavigationLink { PatientDetail(patient: patient) } label: { VStack(alignment: .leading) { Text(patient.ad) Text(patient.email).font(.caption).foregroundColor(.gray) } }
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’22
Reply to [NSJSONSerialization dataWithJSONObject:options:error:]: Invalid top-level type in JSON write
By response, I mean, for example, for if I request a user's info, then the server should give me a response of the user's info or a response of why the server refuses/fail to get the user's info. So you need to know what response the server gives when the registry is complete. And then you can parse it into an object that we can use in the app using JSONDecoder. (e.g. parse from data to a user's info. Data -> UserInfo)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Error registering user with Rest API
I addedrequest.httpBody = try! JSONSerialization.data(withJSONObject: parametrs) instead of request.httpBody = parameters.percent Encoded()
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Data transfer with API
I fixed it struct PatientDetail: View { private let patient: HastaViewModel var body: some View {  VStack {       Form {         Section(header: Text("Kişisel Bilgiler")) {           Text("\(patient.ad)")           Text("\(patient.soyad)")           Text("\(patient.phone)")           Text("\(patient.email)")           Text("\(patient.dogumyili)")           Text("\(patient.ulke)")           Text("\(patient.sehir)")           Text("\(patient.ilce)")           Text("\(patient.adres)")           Text("\(patient.tcno)")         }       } } } So that you only show one user/patient instead of a list of users. And then call it from the main view like List { ForEach(patientVM.hastalar, id: \.id){ patient in NavigationLink { PatientDetail(patient: patient) } label: { VStack(alignment: .leading) { Text(patient.ad) Text(patient.email).font(.caption).foregroundColor(.gray) } }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Adding User
Please select another role(developer,app marketing)
Replies
Boosts
Views
Activity
Jun ’22
Reply to Adding User
If you can show screenshots I can try to help. Did the email address you are trying to add create an account on app store connect before?
Replies
Boosts
Views
Activity
Jun ’22
Reply to Expected to decode Array<Any> but found a dictionary instead
Thank you
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22