Skip to content

Instantly share code, notes, and snippets.

@sashalondon
sashalondon / Swift Font List
Created July 6, 2016 20:20
Swift San Fransisco Fonts
let font = UIFont.systemFontOfSize(17)
let mediumFont = UIFont.systemFontOfSize(17, weight: UIFontWeightMedium)
let lightFont = UIFont.systemFontOfSize(17, weight: UIFontWeightLight)
let boldFont = UIFont.systemFontOfSize(17, weight: UIFontWeightBold)
There is a ton of font weights to choose from:
UIFontWeightUltraLight
UIFontWeightThin
global.swift:
class Main {
var name:String
init(name:String) {
self.name = name
}
}
var mainInstance = Main(name:"My Global Class")
You can now access this mainInstance from all your view controllers and the name will always be "My Global Class". Example from a viewController:
@sashalondon
sashalondon / Day 17 Homework
Created May 7, 2015 21:39
Day 17 Homework
//
// ViewController.swift
// multiplicationTable
//
// Created by Sasha Akhavan-Zanjani on 06/05/2015.
// Copyright (c) 2015 Sasha Akhavan-Zanjani. All rights reserved.
//
import UIKit
@sashalondon
sashalondon / My Stuff Inventory app
Created April 8, 2015 12:37
My Stuff Inventory app
//
// ViewController.swift
// My Stuff App
//
// Created by Sasha Zanjani on 31/03/2015.
// Copyright (c) 2015 Sasha Zanjani. All rights reserved.
//
import UIKit
import MobileCoreServices
@sashalondon
sashalondon / Ice Cream Words
Created March 4, 2015 23:48
[Swift 1] Day 6-7 - App Challenge - Word Magnets
//
// ViewController.swift
// Word Magnet game
//
// Created by Sasha Akhavan-Zanjani on 28/02/2015.
// Copyright (c) 2015 Sasha Akhavan-Zanjani. All rights reserved.
//
import UIKit