Browse Source

move UITableViewExtension and TypeAlias to DcCore

cyberta 4 years ago
parent
commit
1e7556d2fc

+ 8 - 0
DcCore/DcCore.xcodeproj/project.pbxproj

@@ -22,6 +22,8 @@
 		30421986243F209E00516852 /* events.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30421985243F209E00516852 /* events.swift */; };
 		30421988243F23E500516852 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30421987243F23E500516852 /* Constants.swift */; };
 		304F5E41244F2F3200462538 /* UIImage+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 304F5E40244F2F3200462538 /* UIImage+Extensions.swift */; };
+		3057028424C5B81900D84EFC /* TypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3057028324C5B81900D84EFC /* TypeAlias.swift */; };
+		3057028624C5C60000D84EFC /* UITableView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3057028524C5C60000D84EFC /* UITableView+Extensions.swift */; };
 		306C324824460CDE001D89F3 /* DateUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306C324724460CDE001D89F3 /* DateUtils.swift */; };
 		308198AB24866229003BE20D /* UserDefaults+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 308198AA24866229003BE20D /* UserDefaults+Extensions.swift */; };
 		30E8F2212447357500CE2C90 /* DatabaseHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30E8F2202447357500CE2C90 /* DatabaseHelper.swift */; };
@@ -61,6 +63,8 @@
 		30421985243F209E00516852 /* events.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = events.swift; path = ../../DcCore/DcCore/DC/events.swift; sourceTree = "<group>"; };
 		30421987243F23E500516852 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
 		304F5E40244F2F3200462538 /* UIImage+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extensions.swift"; sourceTree = "<group>"; };
+		3057028324C5B81900D84EFC /* TypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeAlias.swift; sourceTree = "<group>"; };
+		3057028524C5C60000D84EFC /* UITableView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableView+Extensions.swift"; sourceTree = "<group>"; };
 		306C324724460CDE001D89F3 /* DateUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateUtils.swift; sourceTree = "<group>"; };
 		308198AA24866229003BE20D /* UserDefaults+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+Extensions.swift"; sourceTree = "<group>"; };
 		30E8F2202447357500CE2C90 /* DatabaseHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabaseHelper.swift; sourceTree = "<group>"; };
@@ -162,6 +166,7 @@
 				30E8F2472449C98600CE2C90 /* UIView+Extensions.swift */,
 				304F5E40244F2F3200462538 /* UIImage+Extensions.swift */,
 				308198AA24866229003BE20D /* UserDefaults+Extensions.swift */,
+				3057028524C5C60000D84EFC /* UITableView+Extensions.swift */,
 			);
 			path = Extensions;
 			sourceTree = "<group>";
@@ -174,6 +179,7 @@
 				3042195C243E23F100516852 /* DcUtils.swift */,
 				306C324724460CDE001D89F3 /* DateUtils.swift */,
 				30E8F24C2449D30200CE2C90 /* DcColors.swift */,
+				3057028324C5B81900D84EFC /* TypeAlias.swift */,
 			);
 			path = Helper;
 			sourceTree = "<group>";
@@ -332,8 +338,10 @@
 				30E8F2212447357500CE2C90 /* DatabaseHelper.swift in Sources */,
 				3042195D243E23F100516852 /* DcUtils.swift in Sources */,
 				30421964243F0B8400516852 /* String+Extensions.swift in Sources */,
+				3057028424C5B81900D84EFC /* TypeAlias.swift in Sources */,
 				30421960243E257100516852 /* UIColor+Extensions.swift in Sources */,
 				30E8F2482449C98600CE2C90 /* UIView+Extensions.swift in Sources */,
+				3057028624C5C60000D84EFC /* UITableView+Extensions.swift in Sources */,
 				308198AB24866229003BE20D /* UserDefaults+Extensions.swift in Sources */,
 				30FE253424BF2688005AC669 /* FlexLabel.swift in Sources */,
 				304F5E41244F2F3200462538 /* UIImage+Extensions.swift in Sources */,

+ 14 - 0
DcCore/DcCore/Extensions/UITableView+Extensions.swift

@@ -0,0 +1,14 @@
+import UIKit
+
+extension UITableView {
+    public func scrollToTop() {
+        let numberOfSections = self.numberOfSections
+        if numberOfSections > 0 {
+            let numberOfRows = self.numberOfRows(inSection: 0)
+            if numberOfRows > 0 {
+                let indexPath = IndexPath(row: 0, section: 0)
+                self.scrollToRow(at: indexPath, at: UITableView.ScrollPosition.top, animated: false)
+            }
+        }
+    }
+}

+ 3 - 0
DcCore/DcCore/Helper/TypeAlias.swift

@@ -0,0 +1,3 @@
+import UIKit
+
+public typealias VoidFunction = () -> Void

+ 0 - 13
deltachat-ios/Extensions/Extensions.swift

@@ -72,19 +72,6 @@ extension UIAlertController.Style {
     }
 }
 
-extension UITableView {
-    func scrollToTop() {
-        let numberOfSections = self.numberOfSections
-        if numberOfSections > 0 {
-            let numberOfRows = self.numberOfRows(inSection: 0)
-            if numberOfRows > 0 {
-                let indexPath = IndexPath(row: 0, section: 0)
-                self.scrollToRow(at: indexPath, at: UITableView.ScrollPosition.top, animated: false)
-            }
-        }
-    }
-}
-
 extension UIFont {
     static func preferredFont(for style: TextStyle, weight: Weight) -> UIFont {
         let traits = UITraitCollection(preferredContentSizeCategory: .large)

+ 0 - 3
deltachat-ios/Helper/TypeAlias.swift

@@ -1,3 +0,0 @@
-import UIKit
-
-typealias VoidFunction = () -> Void