浏览代码

clear code

marinofaggiana 4 年之前
父节点
当前提交
71b56f44f4
共有 2 个文件被更改,包括 5 次插入12 次删除
  1. 0 7
      iOSClient/CCGlobal.h
  2. 5 5
      iOSClient/Main/NCMainTabBar.swift

+ 0 - 7
iOSClient/CCGlobal.h

@@ -167,13 +167,6 @@
 #define k_metadataTypeFile_video                        @"video"
 #define k_metadataTypeFile_imagemeter                   @"imagemeter"
 
-// TabBar button
-#define k_tabBarApplicationIndexFile                    0
-#define k_tabBarApplicationIndexFavorite                1
-#define k_tabBarApplicationIndexPlusHide                2
-#define k_tabBarApplicationIndexMedia                   3
-#define k_tabBarApplicationIndexMore                    4
-
 // Filename Mask and Type
 #define k_keyFileNameMask                               @"fileNameMask"
 #define k_keyFileNameType                               @"fileNameType"

+ 5 - 5
iOSClient/Main/NCMainTabBar.swift

@@ -137,35 +137,35 @@ class NCMainTabBar: UITabBar {
     private func createButtons() {
        
         // File
-        if let item = items?[Int(k_tabBarApplicationIndexFile)] {
+        if let item = items?[0] {
             item.title = NSLocalizedString("_home_", comment: "")
             item.image = CCGraphics.changeThemingColorImage(UIImage(named: "tabBarFiles"), width: 50, height: 50, color: NCBrandColor.shared.brandElement)
             item.selectedImage = item.image
         }
         
         // Favorite
-        if let item = items?[Int(k_tabBarApplicationIndexFavorite)] {
+        if let item = items?[1] {
             item.title = NSLocalizedString("_favorites_", comment: "")
             item.image = CCGraphics.changeThemingColorImage(UIImage(named: "favorite"), width: 50, height: 50, color: NCBrandColor.shared.brandElement)
             item.selectedImage = item.image
         }
         
         // +
-        if let item = items?[Int(k_tabBarApplicationIndexPlusHide)] {
+        if let item = items?[2] {
             item.title = ""
             item.image = nil
             item.isEnabled = false
         }
         
         // Media
-        if let item = items?[Int(k_tabBarApplicationIndexMedia)] {
+        if let item = items?[3] {
             item.title = NSLocalizedString("_media_", comment: "")
             item.image = CCGraphics.changeThemingColorImage(UIImage(named: "media"), width: 50, height: 50, color: NCBrandColor.shared.brandElement)
             item.selectedImage = item.image
         }
         
         // More
-        if let item = items?[Int(k_tabBarApplicationIndexMore)] {
+        if let item = items?[4] {
             item.title = NSLocalizedString("_more_", comment: "")
             item.image = CCGraphics.changeThemingColorImage(UIImage(named: "tabBarMore"), width: 50, height: 50, color: NCBrandColor.shared.brandElement)
             item.selectedImage = item.image