Swift playground – How to convert a string with comma to a string with decimal

update: Xcode 8.2.1 • Swift 3.0.2 You can use NumberFormatter() to convert your string to number. You just need to specify the decimalSeparator as follow: extension String { static let numberFormatter = NumberFormatter() var doubleValue: Double { String.numberFormatter.decimalSeparator = “.” if let result = String.numberFormatter.number(from: self) { return result.doubleValue } else { String.numberFormatter.decimalSeparator = “,” … Read more

My Swift 4 UIScrollView with autolayout constraints is not scrolling

You can do this with Auto Layout. The secret is to constrain the edges of the containerView to the edges of the scrollView. It’s not intuitive, but constraining the edges of the containerView doesn’t set the size, it just makes sure that the content size of the scrollView grows as the containerView grows. By setting … Read more