Skip to content

Instantly share code, notes, and snippets.

View Michelasso's full-sized avatar

Michele Dall'Agata Michelasso

  • Freelance
  • Treviso, Italy
View GitHub Profile
@pixeldock
pixeldock / ViewControllerWithVerticalScrollView.swift
Last active August 14, 2018 00:47
A ViewController with a vertical ScrollView using AutoLayout to position the scrolled subviews
//
// ViewControllerWithVerticalScrollView.swift
// VerticalScrollViewAL
//
// Created by Jörn Schoppe on 12.08.18.
// Copyright © 2018 Jörn Schoppe. All rights reserved.
//
import UIKit
@gonzalezreal
gonzalezreal / ios-cell-registration-swift.md
Last active March 13, 2024 15:18
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)