Skip to content

Instantly share code, notes, and snippets.

View richardpiazza's full-sized avatar

Richard Piazza richardpiazza

View GitHub Profile
@richardpiazza
richardpiazza / PagedIndexPath.swift
Created December 5, 2019 16:44
PagedIndexPath (Adding a 'page' delineation to the standard 'IndexPath')
import UIKit
typealias PagedIndexPath = (page: Int, row: Int, column: Int)
extension IndexPath {
func pagedIndexPath(rowsPerPage rows: Int, columnsPerPage columns: Int) -> PagedIndexPath {
let col: Int = item % columns
var row: Int = item / columns
let page: Int = row / rows

LocalizedStringExpressable

Localization is one of the key differentiators between good apps and great apps. Tools do exist to help in this process, but all to common they are only used at the end of a project, or never at all.

The aim of this protocol is to aid in quickly adding localization resources to an Apple platform project.

So why not use the provided tools?

  • The 'genstrings' tool has been know to have issues with swift files. Third-parties have created tools to fill this need, but that would require relying on third-parties.