so I have made a comments option on my app which lets the users comment something on posts. It is directly referenced and sends info from the string to the api endpoint. That works, now I was wondering if there was a way to limit the number of essentially requests to the API so users can send comments once every minute per say
TextField("Comment...", text: $comment) { editingChanged in
} onCommit: {
validate()
showsAlert = !isValid
if isValid{
viewModel.sendComment(nickname: nickname, body: comment) {
self.comment = ""
}
}
}
}
.padding()
.frame(width: UIScreen.main.bounds.width, height: 80)
.ignoresSafeArea(.keyboard, edges: .bottom)
It would help me reduce spam on the comments and would be a life saver