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. class OOTabBarHelper: NSObject {
  10. static func getVC(storyboardName:String,vcName:String?) -> UIViewController {
  11. let storyBoard:UIStoryboard = UIStoryboard.init(name: storyboardName, bundle: nil)
  12. var destVC:UIViewController!
  13. if vcName != nil {
  14. destVC = storyBoard.instantiateViewController(withIdentifier: vcName!)
  15. }else{
  16. destVC = storyBoard.instantiateInitialViewController()
  17. }
  18. return destVC
  19. }
  20. static func initTabBarStyle() {
  21. UITabBarItem.appearance().setTitleTextAttributes([
  22. NSAttributedString.Key.font: UIFont.init(name: "PingFangSC-Regular", size: 12) ?? UIFont.systemFont(ofSize: 12),
  23. NSAttributedString.Key.foregroundColor: UIColor(hex: "#666666")], for: .normal)
  24. UITabBarItem.appearance().setTitleTextAttributes([
  25. NSAttributedString.Key.font: UIFont.init(name: "PingFangSC-Regular", size: 12) ?? UIFont.systemFont(ofSize: 12),
  26. NSAttributedString.Key.foregroundColor: O2ThemeManager.color(for: "Base.base_color")!], for: .selected)
  27. UITabBar.appearance().backgroundColor = UIColor(hex: "#F7F7F7")
  28. }
  29. }