<commit_before>//
//  TKStyleManager+TripKitUI.swift
//  TripKitUI-iOS
//
//  Created by <NAME> on 16/1/19.
//  Copyright © 2019 SkedGo Pty Ltd. All rights reserved.
//

import Foundation

// MARK: - Default Styles

extension TKStyleManager {

  @objc(styleSearchBar:includingBackground:)
  public static func style(_ searchBar: UISearchBar, includingBackground: Bool = false) {
    style(searchBar, includingBackground: includingBackground, styler: { _ in })
  }

  @objc(styleSearchBar:includingBackground:styler:)
  public static func style(_ searchBar: UISearchBar, includingBackground: Bool, styler: (UITextField) -> Void) {
    searchBar.backgroundImage = includingBackground
      ? UIImage.backgroundNavSecondary
      : UIImage() // blank
    
    searchBar.tintColor = globalAccentColor()
    
    style(searchBar) { textField in
      textField.clearButtonMode = .whileEditing
      textField.font = customFont(forTextStyle: .subheadline)
      textField.textColor = .tkLabelPrimary
      textField.backgroundColor = .clear
      
      styler(textField)
    }<commit_msg>consistent search bar background color<commit_after>//
//  TKStyleManager+TripKitUI.swift
//  TripKitUI-iOS
//
//  Created by <NAME> on 16/1/19.
//  Copyright © 2019 SkedGo Pty Ltd. All rights reserved.
//

import Foundation

// MARK: - Default Styles

extension TKStyleManager {

  @objc(styleSearchBar:includingBackground:)
  public static func style(_ searchBar: UISearchBar, includingBackground: Bool = false) {
    style(searchBar, includingBackground: includingBackground, styler: { _ in })
  }

  @objc(styleSearchBar:includingBackground:styler:)
  public static func style(_ searchBar: UISearchBar, includingBackground: Bool, styler: (UITextField) -> Void) {
    searchBar.backgroundImage = includingBackground
      ? UIImage.backgroundNavSecondary
      : UIImage() // blank
    
    style(searchBar) { textField in
      textField.clearButtonMode = .whileEditing
      textField.font = customFont(forTextStyle: .subheadline)
      textField.textColor = .tkLabelPrimary
      textField.backgroundColor = .tkBackground
      
      styler(textField)
    }
{'fraction_non_alphanumeric': 0.09687936655798789, 'fraction_numerical': 0.008383791336748951, 'mean_word_length': 3.6695652173913045, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5560706', 'n_tokens_mistral': 667, 'n_tokens_neox': 622, 'n_words': 144}