Files
GitHawk/Classes/Utility/RepositoryAttributedString.swift
2018-02-04 19:09:42 -05:00

26 lines
789 B
Swift

//
// RepositoryAttributedString.swift
// Freetime
//
// Created by Hesham Salman on 10/24/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import Foundation
func RepositoryAttributedString(owner: String, name: String) -> NSAttributedString {
let ownerAttributes: [NSAttributedStringKey: Any] = [
.font: Styles.Text.body.preferredFont,
.foregroundColor: Styles.Colors.Gray.dark.color
]
let nameAttributes: [NSAttributedStringKey: Any] = [
.font: Styles.Text.bodyBold.preferredFont,
.foregroundColor: Styles.Colors.Gray.dark.color
]
let text = NSMutableAttributedString(string: owner + "/", attributes: ownerAttributes)
text.append(NSAttributedString(string: name, attributes: nameAttributes))
return text
}