Abs can be used to get the absolute value of a calculation that may have a positive or negative value. As an example without Abs we could go for… var difference: Int if currentValue > targetValue { difference = currentValue - targetValue } else if targetValue > currentValue { difference = targetValue - currentValue }… Continue reading Swift abs function to get an absolute value
Tag: xCode
Loading http websites in Swift iOS
An unexpected quirk when developing my first web browser in Swift iOS was that http addresses do not load by default. This is due to the default setting being to only load https to encourage better security. However, I would still like to be able to browse http only websites. So here's what to do.… Continue reading Loading http websites in Swift iOS