Marino Faggiana 6 лет назад
Родитель
Сommit
2983558b98

+ 0 - 52
Libraries external/SwiftyAvatar/SwiftyAvatar.swift

@@ -1,52 +0,0 @@
-//
-//  SwiftyAvatar.swift
-//  SwiftyAvatar
-//
-//  Created by Dimitrios Kalaitzidis on 04/08/16.
-//  Copyright © 2016 Dimitrios Kalaitzidis. All rights reserved.
-//
-
-import UIKit
-
-@IBDesignable class SwiftyAvatar: UIImageView {
-    
-    @IBInspectable var roundness: CGFloat = 2 {
-        didSet{
-            layoutSubviews()
-        }
-    }
-    
-    @IBInspectable var borderWidth: CGFloat = 5 {
-        didSet{
-            layoutSubviews()
-        }
-    }
-    
-    @IBInspectable var borderColor: UIColor = UIColor.blue {
-        didSet{
-            layoutSubviews()
-        }
-    }
-    
-    @IBInspectable var background: UIColor = UIColor.clear {
-        didSet{
-            layoutSubviews()
-        }
-    }
-    
-    override func layoutSubviews() {
-        super.layoutSubviews()
-        
-        layer.cornerRadius = bounds.width / roundness
-        layer.borderWidth = borderWidth
-        layer.borderColor = borderColor.cgColor
-        layer.backgroundColor = background.cgColor
-        clipsToBounds = true
-        
-        let path = UIBezierPath(roundedRect: bounds.insetBy(dx: 0.5, dy: 0.5), cornerRadius: bounds.width / roundness)
-        let mask = CAShapeLayer()
-        
-        mask.path = path.cgPath
-        layer.mask = mask
-    }
-}

+ 0 - 12
Nextcloud.xcodeproj/project.pbxproj

@@ -270,7 +270,6 @@
 		F758B460212C56A400515F55 /* ScanCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F758B45F212C56A400515F55 /* ScanCollectionView.swift */; };
 		F75AC2431F1F62450073EC19 /* NCManageAutoUploadFileName.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75AC2421F1F62450073EC19 /* NCManageAutoUploadFileName.swift */; };
 		F75ADF451DC75FFE008A7347 /* CCLogin.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F75ADF441DC75FFE008A7347 /* CCLogin.storyboard */; };
-		F75AE3C71E9D12900088BB09 /* SwiftyAvatar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75AE3C61E9D12900088BB09 /* SwiftyAvatar.swift */; };
 		F75EDFBD1E8C112F00E6F369 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F75EDFBC1E8C112F00E6F369 /* libsqlite3.0.tbd */; };
 		F75EDFBF1E8C116D00E6F369 /* libstdc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F75EDFBE1E8C116D00E6F369 /* libstdc++.tbd */; };
 		F761855A2198A2B500A65DC4 /* NCPhotosPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76185592198A2B500A65DC4 /* NCPhotosPickerViewController.swift */; };
@@ -965,7 +964,6 @@
 		F758B45F212C56A400515F55 /* ScanCollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScanCollectionView.swift; sourceTree = "<group>"; };
 		F75AC2421F1F62450073EC19 /* NCManageAutoUploadFileName.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCManageAutoUploadFileName.swift; sourceTree = "<group>"; };
 		F75ADF441DC75FFE008A7347 /* CCLogin.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = CCLogin.storyboard; sourceTree = "<group>"; };
-		F75AE3C61E9D12900088BB09 /* SwiftyAvatar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftyAvatar.swift; sourceTree = "<group>"; };
 		F75B91E21ECAE17800199C96 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F75B91F71ECAE26300199C96 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		F75B923D1ECAE55E00199C96 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -1638,7 +1636,6 @@
 				F75037421DBFA91A008FB480 /* PureLayout */,
 				F70F05241C889184008DAB36 /* Reachability */,
 				F7A55417204EF8AF008468EC /* TOScrollBar */,
-				F75AE3C51E9D12900088BB09 /* SwiftyAvatar */,
 				F70F05561C889184008DAB36 /* UIImage+animatedGIF */,
 			);
 			path = "Libraries external";
@@ -2099,14 +2096,6 @@
 			path = Protocols;
 			sourceTree = "<group>";
 		};
-		F75AE3C51E9D12900088BB09 /* SwiftyAvatar */ = {
-			isa = PBXGroup;
-			children = (
-				F75AE3C61E9D12900088BB09 /* SwiftyAvatar.swift */,
-			);
-			path = SwiftyAvatar;
-			sourceTree = "<group>";
-		};
 		F76185582198A28E00A65DC4 /* NCPhotosPickerViewController */ = {
 			isa = PBXGroup;
 			children = (
@@ -3697,7 +3686,6 @@
 				F77B0E231D118A16002130FE /* CCSharePermissionOC.m in Sources */,
 				F762CAF81EACB66200B38484 /* XLFormButtonCell.m in Sources */,
 				F7CA1ED120E7E3FE002CC65E /* PKCircleProgressView.m in Sources */,
-				F75AE3C71E9D12900088BB09 /* SwiftyAvatar.swift in Sources */,
 				F762CAFC1EACB66200B38484 /* XLFormImageCell.m in Sources */,
 				F72D1007210B6882009C96B7 /* NCPushNotificationEncryption.m in Sources */,
 				F70022D11EC4C9100080073F /* OCUserProfile.m in Sources */,

+ 3 - 3
iOSClient/Main/Main.storyboard

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="4IE-mo-rkp">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="4IE-mo-rkp">
     <device id="retina5_9" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -117,7 +117,7 @@
                                     <outlet property="delegate" destination="9DM-ts-oJu" id="ePC-4O-7ui"/>
                                 </connections>
                             </tableView>
-                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar" translatesAutoresizingMaskIntoConstraints="NO" id="DWx-1W-vs0" customClass="SwiftyAvatar" customModule="Nextcloud" customModuleProvider="target">
+                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar" translatesAutoresizingMaskIntoConstraints="NO" id="DWx-1W-vs0" customClass="NCAvatar" customModule="Nextcloud" customModuleProvider="target">
                                 <rect key="frame" x="15" y="103" width="50" height="50"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="50" id="QAM-AU-L76"/>

+ 45 - 0
iOSClient/Utility/NCUtility.swift

@@ -165,3 +165,48 @@ class NCUtility: NSObject {
         return (k_layout_list, "fileName", true, "none", true)
     }
 }
+
+//MARK: -
+
+@IBDesignable class NCAvatar: UIImageView {
+    
+    @IBInspectable var roundness: CGFloat = 2 {
+        didSet{
+            layoutSubviews()
+        }
+    }
+    
+    @IBInspectable var borderWidth: CGFloat = 5 {
+        didSet{
+            layoutSubviews()
+        }
+    }
+    
+    @IBInspectable var borderColor: UIColor = UIColor.blue {
+        didSet{
+            layoutSubviews()
+        }
+    }
+    
+    @IBInspectable var background: UIColor = UIColor.clear {
+        didSet{
+            layoutSubviews()
+        }
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        
+        layer.cornerRadius = bounds.width / roundness
+        layer.borderWidth = borderWidth
+        layer.borderColor = borderColor.cgColor
+        layer.backgroundColor = background.cgColor
+        clipsToBounds = true
+        
+        let path = UIBezierPath(roundedRect: bounds.insetBy(dx: 0.5, dy: 0.5), cornerRadius: bounds.width / roundness)
+        let mask = CAShapeLayer()
+        
+        mask.path = path.cgPath
+        layer.mask = mask
+    }
+}