Hi,
Just following up to see if anyone has any idea how to resolve this. Thank you.
Post
Replies
Boosts
Views
Activity
Thanks for your response. Below is what comes up both from cd ./git both the in the project folder.
I don't even see a .git folder in the root directory. I had at least 20-30 files. I don't quite remember all of the steps I took. What I remember is I added a file to one of the branches, and went to switch to see if it only added the file in one of the branches. After that, both ended up empty. I have a revision on my phone and simulator. Is there any way to recover the files with that?
The only files displayed with both branches are below:
Regardless of whether I'm in main or the new branch, the only files are the template files that are generated when creating a new project.
There are two files under "Changes": (Project Name)-Info and build.
Thank you for your response. Both branches are completely empty aside from the auto-generated code that new projects have.
Hi,
Thanks for your response, however I'm not sure where that file would be located. I don't see a database file in my file directory. All I have is the file with the model class.
Hi,
Thank you for your response. Using Xcode 15.4, how can I create a git repository for an already existing project? The Source Control tab is blank and I don't see a button to create a repository.
Hi,
Just bumping this to see if anyone knows why I'm getting these errors. Please let me know if anymore information is needed.
With this code I get the error:
.onChange(of: buttonState) { oldState, newState in
}
But not with this:
.onChange(of: buttonState) { state in
}
Would it be recommended to use a slightly older target so that more users would be able to access the app?
Hi,
I have a follow up question. In an older project, using that code, I get an error: 'onChange(of:initial:_:)' is only available in iOS 17.0 or newer
The solution provided is to wrap the code in if #available(iOS 17.0, *) { }, but I'm only able to wrap the whole view inside of it, like so:
if #available(iOS 17.0, *) {
VStack () {
// view with .onChange
}
} else {
VStack () {
// view with older solution
}
}
The view is quite lengthy so it would be very redundant to have the same view twice, (the same view for each component of the if/else statement). Is there a way to implement an if statement so that I would only need the code for the view once (something like the code below)?
VStack {
}
if #available(iOS 17.0, *) {
.onChange() {
}
} else {
// older solution
}
Hi,
Thank you for all the help. There was a discrepancy in the bytes because I removed a field from the data set. I was missing the Content-Type: application/json header which caused the issue.
Hi,
Thank you for your response. Here is the whole function:
func createAccount(account: AccountCreationData, completion: @escaping (Response) -> Void) {
guard let url = URL(string: "http://localhost:4300/account/create-account") else { return }
var request = URLRequest(url: url)
request.httpMethod = "POST"
print(account)
guard let encoded = try? JSONEncoder().encode(account) else {
print("Failed to encode request")
return
}
print(encoded)
request.httpBody = encoded
URLSession.shared.dataTask(with: request) { (data, response, error) in
guard let data = data else { return }
do {
let resData = try JSONDecoder().decode(Response.self, from: data)
DispatchQueue.main.async {
completion(resData)
}
} catch let jsonError as NSError {
print("JSON decode failed: \(jsonError)")
}
}.resume()
}
Below are print statements of account and encoded:
AccountCreationData(name: "name", email: "email", phone: "phone", password: "password")
110 bytes
One thing I now realize is that it's not practical to have a Canvas inside a ScrollView because it interferes with the drawing gesture. However, I'm still unsure of how to draw on a Canvas upon loading.