Opening links in Safari / Embedded Safari – iOS

In iOS you can either do it with a push: let safariVC = SFSafariViewController(url: URL(string: “www.google.com”)!, configuration: .init())   present(safariVC, animated: true, completion: nil)   or directly in the Safari app: UIApplication.shared.open(URL(string:“www.google.com”)!, options: [:]) { (_) in }   Very practical,    Marc

Reloading/inserting Dynamic Height cells and keeping Scroll position

For an upcoming app I had to insert Dynamic Height cells while keeping the tableView offset -scrolling position- constant. This would typically be a trivial issue, but given that when using Dynamic Height cells nor the contentSize nor the offset can be trusted it’s a bit more tricky than it seems… What I was trying …

Dealing with UIGraphics ImageContext ‘Memory Leaks’

Here’s the code to change the image size of an image in iOS so that then it can be saved with smaller footprint: let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height)          // Actually do the resizing to the rect using the ImageContext stuff UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0) image.draw(in: rect) …