OOTabBarHelper.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // OOTabBarHelper.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2018/4/12.
  6. // Copyright © 2018年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. import CYLTabBarController
  10. class OOTabBarHelper: NSObject {
  11. static func getVC(storyboardName:String,vcName:String?) -> UIViewController {
  12. let storyBoard:UIStoryboard = UIStoryboard.init(name: storyboardName, bundle: nil)
  13. var destVC:UIViewController!
  14. if vcName != nil {
  15. destVC = storyBoard.instantiateViewController(withIdentifier: vcName!)
  16. }else{
  17. destVC = storyBoard.instantiateInitialViewController()
  18. }
  19. return destVC
  20. }
  21. static func initTabBarStyle() {
  22. UITabBarItem.appearance().setTitleTextAttributes([
  23. NSAttributedString.Key.font: UIFont.init(name: "PingFangSC-Regular", size: 12) ?? UIFont.systemFont(ofSize: 12),
  24. NSAttributedString.Key.foregroundColor: UIColor(hex: "#666666")], for: .normal)
  25. UITabBarItem.appearance().setTitleTextAttributes([
  26. NSAttributedString.Key.font: UIFont.init(name: "PingFangSC-Regular", size: 12) ?? UIFont.systemFont(ofSize: 12),
  27. NSAttributedString.Key.foregroundColor: O2ThemeManager.color(for: "Base.base_color")!], for: .selected)
  28. UITabBar.appearance().backgroundColor = UIColor(hex: "#F7F7F7")
  29. }
  30. }