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
// ColorManager.swift created by Brady Murphy | |
import SwiftUI | |
struct ColorManager { | |
// create static variables for custom colors | |
static let spotifyGreen = Color("SpotifyGreen") | |
//... add the rest of your colors here | |
} |
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
// FontNameManager created by Brady Murphy | |
struct FontNameManager { | |
//MARK: name of font family | |
struct Montserrat { | |
static let light = "Montserrat-Light" | |
static let regular = "Montserrat-Regular" | |
// add rest of the font style names | |
} | |
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
// Created by Brady Murphy | |
import SwiftUI | |
// create the custom font | |
let headerFont = Font.custom(FontNameManager.Montserrat.semiBold, size: 28) | |
struct ExampleView: View { | |
var body: some View { | |
// using the custom font to modify the text view |
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
// place this function in a .onAppear() lifecycle call on your root view | |
// credit to apple https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app | |
// Created By: Brady Murphy | |
func getCustomFontNames() { | |
// get each of the font families | |
for family in UIFont.familyNames.sorted() { | |
let names = UIFont.fontNames(forFamilyName: family) | |
// print array of names | |
print("Family: \(family) Font names: \(names)") |
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
// | |
// ExampleCard.swift | |
// PopQuiz WatchKit Extension | |
// | |
// Created by brady murphy on 11/30/19. | |
// Copyright © 2019 Apple. All rights reserved. | |
// | |
import SwiftUI |
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
// | |
// Modal.swift | |
// TheRealYou | |
// | |
// Created by brady murphy on 11/28/19. | |
// Copyright © 2019 Brady Murphy. All rights reserved. | |
// | |
import SwiftUI |
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 used to load URL images asynchronously | |
*/ | |
final class ImageLoader: ObservableObject { | |
@Published public var imageData:Data // data that will get published when loaded | |
init(url imageUrl: String) { | |
self.imageData = Data() // assign the value | |
// call the API and try to get the data |
NewerOlder