This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func formatRevenue(_ revenue: Double) -> String | |
{ | |
let currencyFormatter = NumberFormatter() | |
currencyFormatter.numberStyle = .currency | |
currencyFormatter.minimumFractionDigits = 0 | |
currencyFormatter.maximumFractionDigits = 1 | |
var number: NSNumber | |
switch revenue { | |
case 1_000_000_000_000..<1_000_000_000_000_000: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GistAPI.swift | |
// Gists | |
// | |
// Created by Raymond Law on 2/5/16. | |
// Copyright © 2016 Clean Swift. All rights reserved. | |
// | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// MARK: - User | |
class User: Equatable, Hashable | |
{ | |
var id: String | |
var email: String | |
var hashValue: Int { | |
return id.hashValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UITableViewController | |
{ | |
override func viewDidLoad() | |
{ | |
super.viewDidLoad() | |
let currentUser = userManager.loggedInUser() | |
if let currentUser = currentUser { | |
var followerPosts = [Post]() | |
let followers = userManager.followersForUser(currentUser) | |
for follower in followers { |