Created
August 10, 2014 16:44
-
-
Save jkhowland/e8cdbdeaee322080ea6d to your computer and use it in GitHub Desktop.
GitReference - Data Methods - Swift
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 gitCommands() -> Array<[String: String]> { | |
var commands = [[String: String]]() | |
commands.append([Command: "git status", Reference: ": shows changed files"]) | |
commands.append([Command: "git diff", Reference: ": shows actual changes"]) | |
commands.append([Command: "git add .", Reference: ": adds changed files to the commit"]) | |
commands.append([Command: "git commit -m \"notes\"", Reference: ": commits the changes"]) | |
commands.append([Command: "git push origin _branch_", Reference: ": pushes commits to branch named _branch_"]) | |
commands.append([Command: "git log", Reference: ": displays progress log"]) | |
commands.append([Command: "git comment --amend", Reference: ": re-enter last commit message"]) | |
return commands | |
} | |
func heightOfReferenceString(string: String, constrainedToWidth width: CGFloat) -> CGFloat { | |
return (string as NSString).boundingRectWithSize(CGSize(width: width, height: 100.0), | |
options: NSStringDrawingOptions.UsesLineFragmentOrigin, | |
attributes: [NSFontAttributeName: self.referenceFont()], | |
context: nil).size.height | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment