Skip to content

Instantly share code, notes, and snippets.

View jurgenizer's full-sized avatar
🏄
Surfing

Jurgen Geitner jurgenizer

🏄
Surfing
View GitHub Profile
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
        
// 1
let foodItem = foodItems[indexPath.row]
        
// 2
let foodType = foodItem.type
cell.textLabel?.text = foodType
        
@jurgenizer
jurgenizer / UIDevice+Username.swift
Last active June 12, 2017 20:50 — forked from iGranDav/UIDevice+Username.swift
Updated for Swift 3
import Foundation
import UIKit
extension UIDevice {
/**
Try to get the username from the device name using common knows
default device names format.
- copyright: Owen Godfrey on [StackOverflow](http://stackoverflow.com/questions/8261961/better-way-to-get-the-users-name-from-device)