This file contains hidden or 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
+ (CGFloat)getSpacing:(ASPSpacingSize)size traitCollection:(UITraitCollection *)contextTraitCollection { | |
bool isCompact = !(contextTraitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular); | |
switch (size) { | |
case ASPSpacingSizeTiny : | |
return (isCompact) ? 8.0f : 16.0f; | |
case ASPSpacingSizeSmall : | |
return (isCompact) ? 16.0f : 24.0f; | |
case ASPSpacingSizeLarge : | |
return (isCompact) ? 24.0f : 48.0f; | |
} |
This file contains hidden or 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
+ (CGFloat)getUIFontSize:(ASPUITextStyle)style traitCollection:(UITraitCollection *)contextTraitCollection { | |
bool isCompact = !(contextTraitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular); | |
CGFloat pointSize = (isCompact) ? 14.0f : 18.0f; | |
switch (style) { | |
case ASPUIElementStyleTitle1 : | |
pointSize = (isCompact) ? 36.0f : 36.0f; | |
break; |
This file contains hidden or 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
+ (CGFloat)topUIBaselineAdjustment:(ASPUITextElement)element traitCollection:(UITraitCollection *)contextTraitCollection { | |
ASPUITextStyle elementTextStyle = [self mapUIElementToStyle:element]; | |
UIFont *font = [ASPFontUtil getUIFont:elementTextStyle traitCollection:contextTraitCollection]; | |
return floor(font.ascender - font.capHeight); | |
} | |
+ (CGFloat)bottomUIBaselineAdjustment:(ASPUITextElement)element traitCollection:(UITraitCollection *)contextTraitCollection { | |
ASPUITextStyle elementTextStyle = [self mapUIElementToStyle:element]; | |
UIFont *font = [ASPFontUtil getUIFont:elementTextStyle traitCollection:contextTraitCollection]; | |
return -(floor(font.lineHeight - font.ascender)); |
This file contains hidden or 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
// | |
// FontUtil.swift | |
// FantasyMovieLeague | |
// | |
// Created by Ben Dalziel on 2/17/16. | |
// Copyright © 2016 Kinetoplay. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or 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
// | |
// ColorUtil.swift | |
// FantasyMovieLeague | |
// | |
// Created by Ben Dalziel on 2/17/16. | |
// Copyright © 2016 Kinetoplay. All rights reserved. | |
// | |
import SwiftHEXColors |
This file contains hidden or 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 func uiColor(appUIColor: AppUIColors) -> UIColor { | |
switch appUIColor { | |
case .NavBarBackground, | |
.ViewControllerBackground: // References to color abbreviated | |
return color(AppColors.Beige) | |
case .ButtonTitleSelected, | |
.ButtonTitleHighlighted: // References to color abbreviated | |
return colorWithAlpha(AppColors.Beige, alpha: 0.7) | |
case .NavBarShadow, | |
.TableSeparator: // References to color abbreviated |
This file contains hidden or 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
public indirect enum AppUIColors: Int { | |
case NavBarBackground, | |
NavBarTint, | |
NavBarShadow, | |
NavBarTitle, | |
PickerNavBarBackground, | |
PickerNavBarTint, | |
PickerNavBarTitle, | |
PickerNavBarTitleAlt, |
This file contains hidden or 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
enum AppColors: String { | |
case Beige = "#f5efe0", | |
Gold = "#cda582", | |
FMLRed = "#fa463c", | |
BlackVelvet = "#1e0a14", | |
DarkVelvet = "#321e28", | |
Velvet = "#4a283e", //503146", | |
// Alternate colors - use sparingly | |
FMLRedAlt = "#e14137", |
This file contains hidden or 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
// | |
// AppearanceManager.swift | |
// | |
// Created by Ben Dalziel on 2/17/16. | |
// | |
import UIKit | |
class AppearanceManager { |
This file contains hidden or 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
http://www.neglectedpotential.com/2015/06/working-with-apples-application-transport-security/ | |
http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ | |
http://stackoverflow.com/questions/30739473/nsurlsession-nsurlconnection-http-load-failed-on-ios-9 | |
https://github.com/AFNetworking/AFNetworking/issues/2779 |