Browse Source

improvements

Marino Faggiana 7 năm trước cách đây
mục cha
commit
5f41363168
1 tập tin đã thay đổi với 3 bổ sung10 xóa
  1. 3 10
      iOSClient/Main/CCMore.swift

+ 3 - 10
iOSClient/Main/CCMore.swift

@@ -175,14 +175,12 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
     
     func changeTheming() {
         
-        // Theming Background
-        let theminBackgroundFile = UIImage.init(contentsOfFile: "\(appDelegate.directoryUser!)/themingBackground.png")
-        if (theminBackgroundFile != nil) {
+        if let theminBackgroundFile = UIImage.init(contentsOfFile: "\(appDelegate.directoryUser!)/themingBackground.png") {
             themingBackground.image = theminBackgroundFile
         } else {
             themingBackground.image = UIImage.init(named: "themingBackground")
         }
-
+        
         if (self.isViewLoaded && (self.view.window != nil)) {
             appDelegate.changeTheming(self)
         }
@@ -190,14 +188,9 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
     
     func changeUserProfile() {
      
-        let themingAvatarFile : UIImage? = UIImage.init(contentsOfFile: "\(appDelegate.directoryUser!)/avatar.png")
-        
-        if (themingAvatarFile != nil) {
-            
+        if let themingAvatarFile = UIImage.init(contentsOfFile: "\(appDelegate.directoryUser!)/avatar.png") {
             themingAvatar.image = themingAvatarFile
-            
         } else {
-            
             themingAvatar.image = UIImage.init(named: "moreAvatar")
         }