skip to Main Content

Ios swift – How to do programmatic navigation in swiftui using navigationstack once state changes?

struct LoginView: View { @State var isUserLoggedIn = false NavigationStack{ //..... Button { Task{ await viewModel.doLogin(email: email, password: password) } } label: { Text(Constants.LOGIN) .foregroundColor(Constants.BACKGROUND_COLOR) .font(Font.custom(Constants.FREDOKA_MEDIUM, size: 25)) .frame(maxWidth: .infinity) } }.onChange(of: isUserLoggedIn) { isUserLoggedIn in debugPrint(newPasswordValue) } } I…

VIEW QUESTION

Ios swift – Collectionview Card Layout

Here is a screenshot of what I want to achieve: I need this type of collection view layout for card cells (with leading and trailing edging displays). import UIKit class ViewController: UIViewController { @IBOutlet weak var colList : UICollectionView! var…

VIEW QUESTION

Ios swift – How can I remove Escaped string from Json?

I am trying to send request to server. unable get correct format JSON . please help to resolve this error. [ "{"ProductGroupId":"994475","ProductId":"994408"}", "{"ProductGroupId":"994475","ProductId":"999737"}", "{"ProductGroupId":"994475","ProductId":"999915"}", "{"ProductGroupId":"994475","ProductId":"1194875"}" ] self.productGroupList = json.response.result.packages[0].productGroups for index in 1..<self.productGroupList[3].products.count{ self.productGroupIdList.append(self.productGroupList[3].products[index].productGroupID) self.productGroupIdList.append(self.productGroupList[3].products[index].id) let dictionary = ["ProductGroupId": self.productGroupList[3].products[index].productGroupID,…

VIEW QUESTION
Back To Top
Search