marinofaggiana 4 년 전
부모
커밋
e26b9b8022
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

+ 9 - 3
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -251,14 +251,20 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 if serverUrl == NCUtilityFileSystem.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account) {
                  
                     let account = NCManageDatabase.shared.getAccountActive()
-                    if account?.alias != "" {
-                        button.setTitle("  " + (account?.alias ?? ""), for: .normal)
-                        button.setTitleColor(NCBrandColor.shared.textView, for: .normal)
+                    var title = "  "
+                    if account?.alias == "" {
+                        title = title + (account?.user ?? "")
+                    } else {
+                        title = title + (account?.alias ?? "")
                     }
+                    
+                    button.setTitle(title, for: .normal)
+                    button.setTitleColor(NCBrandColor.shared.textView, for: .normal)
                 }
                 
                 button.semanticContentAttribute = .forceLeftToRight
                 button.sizeToFit()
+                button.addTarget(self, action: #selector(profileButtonTapped(sender:)), for: .touchUpInside)
                        
                 navigationItem.setLeftBarButton(UIBarButtonItem(customView: button), animated: true)
                 navigationItem.leftItemsSupplementBackButton = true