The ++ and -- operator removal is about as childish of a choice as one might find in language design. There are countless examples of how these operators are priceless.
let elems = pkt.split(separator: ",");
//$GPRMC,024613,V,3609.9338,N,09556.3937,W,000.0,000.0,160204,004.6,E*7E
if( gpsDataType == "GPRMC," ) {
let time = elems[0]
let warn_V_A = elems[1]
let lat = elems[2]
let latdir = elems[3]
let lon = elems[4]
let londir = elems[5]
let speed = elems[6]
let course = elems[7]
let date = elems[8]
let magvar = elems[9]
let dirs = elems[10].split(separator: "*")
let vardir = dirs[0]
let check = dirs[1]
let latitude = parseLat( String(lat), dir: String(latdir) )
let longitude = parseLon( String(lon), dir: String(londir))
self.latitude = latitude
self.longitude = longitude
self.heading = Int(Double(course)!)
self.speed = Int(Double(speed)!)
}
Why do I have code all these stupid indexes with constants? Why can I not use [idx++] on every index so that I don't have to worry about what line it is, and then for other GPS data, like $GPGGA, I can just copy the lines above that I need to use for that statement and not care at all what the indexes are.