Hoping someone can help me with this… The error is… Generic parameter ‘/‘ cannot be inferred.
.multilineTextAlignment(.center)
.onAppear(perform: {
var checkFirstCardLatitude = cards.firstCardLatitude
let charArray = Array(checkFirstCardLatitude)
let allowed: [Character] = ["-", ".", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
for char in charArray {
if char != allowed {
cards.firstCardLatitude = "000.000000" // Reset Text Field
}
}
})
There is a slight issue with the regex, in that it seems to be allowing you to enter something like -12..sssds. It seems that as soon as you enter the second full-stop you can enter anything, so you may want to either check the regex, or work around it with some more code in the Coordinate.validate() function.