Skip to content

Instantly share code, notes, and snippets.

@johndelong
johndelong / ViewController.swift
Last active Oct 19, 2016
Infinite Scrolling Setup
View ViewController.swift
//
// ViewController.swift
// Example
//
// Created by John DeLong on 5/11/16.
// Copyright © 2016 delong. All rights reserved.
//
import UIKit
@johndelong
johndelong / snippets.swift
Created Apr 5, 2017
Fitting Views to Their Content (edges cases)
View snippets.swift
/**
Calculates and adjusts the frame of a web view to fit its content
http://stackoverflow.com/a/3937599/7066201
*/
func calculateWebViewSize() {
self.view.layoutIfNeeded()
var frame = self.webview.frame
frame.size.height = 1
self.webview.frame = frame
@johndelong
johndelong / ViewController.swift
Last active Mar 28, 2021
Infinite Scrolling Final
View ViewController.swift
//
// ViewController.swift
// Example
//
// Created by John DeLong on 5/11/16.
// Copyright © 2016 delong. All rights reserved.
//
import UIKit