<commit_before>/*
 Copyright 2018-present the Material Components for iOS authors. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

import UIKit

import MaterialComponents

class ApplicationScheme: NSObject, MDCColorScheming, MDCTypographyScheming, MDCButtonScheming {

  static let staticColorScheme: MDCSemanticColorScheme = {
    let scheme = MDCSemanticColorScheme(defaults: .material201804)
    //TODO: Customize our app Colors after this line

    return scheme
  }()

  static let staticTypographyScheme: MDCTypographyScheme = {
    let scheme = MDCTypographyScheme()
    //TODO: Add our custom fonts after this line

    return scheme
  }()

  public private(set) var cornerRadius: CGFloat = {
    return CGFloat(4.0)
  }()

  public private(set) var minimumHeight: CGFloat = {
    return CGFloat(36.0)
  }()

  private static var singleton = ApplicationScheme()

  static var scheme: ApplicationScheme {
    return singleton
  }

  public private(set) var colorScheme: MDCColorScheming = {
    return ApplicationScheme.staticColorScheme
  }()

  public private(set) var typographyScheme: MDCTypographyScheming = {
    return ApplicationScheme.staticTypographyScheme
  }()

  public private(set) var primaryColor: UIColor = {
    return staticColorScheme.primaryColor
  }()
  public private(set) var primaryColorVariant: UIColor = {
    return staticColorScheme.primaryColorVariant
  }()
  public private(set) var secondaryColor: UIColor = {
    return staticColorScheme.secondaryColor
  }()
  public private(set) var errorColor: UIColor = {
    return staticColorScheme.errorColor
  }()
  public private(set) var surfaceColor: UIColor = {
    return staticColorScheme.surfaceColor
  }()
  public private(set) var backgroundColor: UIColor = {
    return staticColorScheme.backgroundColor
  }()
  public private(set) var onPrimaryColor: UIColor = {
    return staticColorScheme.onPrimaryColor
  }()
  public private(set) var onSecondaryColor: UIColor = {
    return staticColorScheme.onSecondaryColor
  }()
  public private(set) var onSurfaceColor: UIColor = {
    return staticColorScheme.onSurfaceColor
  }()
  public private(set) var onBackgroundColor: UIColor = {
    return staticColorScheme.onBackgroundColor
  }()

  public private(set) var headline1: UIFont = {
    return staticTypographyScheme.headline1
  }()
  public private(set) var headline2: UIFont = {
    return staticTypographyScheme.headline2
  }()
  public private(set) var headline3: UIFont = {
    return staticTypographyScheme.headline3
  }()
  public private(set) var headline4: UIFont = {
    return staticTypographyScheme.headline4
  }()
  public private(set) var headline5: UIFont = {
    return staticTypographyScheme.headline5
  }()
  public private(set) var headline6: UIFont = {
    return staticTypographyScheme.headline6
  }()
  public private(set) var subtitle1: UIFont = {
    return staticTypographyScheme.subtitle1
  }()
  public private(set) var subtitle2: UIFont = {
    return staticTypographyScheme.subtitle2
  }()
  public private(set) var body1: UIFont = {
    return staticTypographyScheme.body1
  }()
  public private(set) var body2: UIFont = {
    return staticTypographyScheme.body2
  }()
  public private(set) var caption: UIFont = {
    return staticTypographyScheme.caption
  }()
  public private(set) var button: UIFont = {
    return staticTypographyScheme.button
  }()
  public private(set) var overline: UIFont = {
    return staticTypographyScheme.overline
  }()
}<commit_msg>[codelab 103 Start] Swift: Switch to instances of scheme objects rather than conforming to protocols<commit_after>/*
 Copyright 2018-present the Material Components for iOS authors. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

import UIKit

import MaterialComponents

class ApplicationScheme: NSObject {

  private static var singleton = ApplicationScheme()

  static var shared: ApplicationScheme {
    return singleton
  }

  override init() {
    self.buttonScheme.colorScheme = self.colorScheme
    self.buttonScheme.typographyScheme = self.typographyScheme
    super.init()
  }

  public let buttonScheme = MDCButtonScheme()

  public let colorScheme: MDCColorScheming = {
    let scheme = MDCSemanticColorScheme(defaults: .material201804)
    //TODO: Customize our app Colors after this line

    return scheme
  }()

  public let typographyScheme: MDCTypographyScheming = {
    let scheme = MDCTypographyScheme()
    //TODO: Add our custom fonts after this line

    return scheme
  }()
}
{'fraction_non_alphanumeric': 0.07435011816033449, 'fraction_numerical': 0.010179967278676604, 'mean_word_length': 4.161350844277673, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6437665', 'n_tokens_mistral': 1564, 'n_tokens_neox': 1506, 'n_words': 503}