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
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 |
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
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: |
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
// | |
// ViewController.swift | |
// multiplicationTable | |
// | |
// Created by Sasha Akhavan-Zanjani on 06/05/2015. | |
// Copyright (c) 2015 Sasha Akhavan-Zanjani. All rights reserved. | |
// | |
import UIKit |
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
// | |
// 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 |
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
// | |
// 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 |