From 687cb6749d23d2eaf40a7c243a90c3f7b31c2719 Mon Sep 17 00:00:00 2001 From: nikAshanin Date: Thu, 12 Jan 2017 17:15:09 +0300 Subject: [PATCH] remove tableview register nib. use tablekit instead --- LeadKit/LeadKit.xcodeproj/project.pbxproj | 12 ---- .../UITableView+CellRegistration.swift | 61 ------------------- 2 files changed, 73 deletions(-) delete mode 100644 LeadKit/LeadKit/Extensions/UITableView/UITableView+CellRegistration.swift diff --git a/LeadKit/LeadKit.xcodeproj/project.pbxproj b/LeadKit/LeadKit.xcodeproj/project.pbxproj index 0ab347e8..30474d50 100644 --- a/LeadKit/LeadKit.xcodeproj/project.pbxproj +++ b/LeadKit/LeadKit.xcodeproj/project.pbxproj @@ -56,7 +56,6 @@ 78CFEE2E1C5C456B00F50370 /* LeadKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 78CFEE2D1C5C456B00F50370 /* LeadKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 78CFEE351C5C456B00F50370 /* LeadKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 78CFEE2A1C5C456B00F50370 /* LeadKit.framework */; }; 78CFEE3A1C5C456B00F50370 /* LeadKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78CFEE391C5C456B00F50370 /* LeadKitTests.swift */; }; - 78CFEE521C5C45E500F50370 /* UITableView+CellRegistration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78CFEE461C5C45E500F50370 /* UITableView+CellRegistration.swift */; }; 78CFEE541C5C45E500F50370 /* UIView+LoadFromNib.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78CFEE481C5C45E500F50370 /* UIView+LoadFromNib.swift */; }; 78CFEE551C5C45E500F50370 /* NibNameProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78CFEE4A1C5C45E500F50370 /* NibNameProtocol.swift */; }; 78CFEE561C5C45E500F50370 /* ReuseIdentifierProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78CFEE4B1C5C45E500F50370 /* ReuseIdentifierProtocol.swift */; }; @@ -136,7 +135,6 @@ 78CFEE341C5C456B00F50370 /* LeadKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LeadKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 78CFEE391C5C456B00F50370 /* LeadKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeadKitTests.swift; sourceTree = ""; }; 78CFEE3B1C5C456B00F50370 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 78CFEE461C5C45E500F50370 /* UITableView+CellRegistration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UITableView+CellRegistration.swift"; path = "LeadKit/Extensions/UITableView/UITableView+CellRegistration.swift"; sourceTree = SOURCE_ROOT; }; 78CFEE481C5C45E500F50370 /* UIView+LoadFromNib.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIView+LoadFromNib.swift"; path = "LeadKit/Extensions/UIView/UIView+LoadFromNib.swift"; sourceTree = SOURCE_ROOT; }; 78CFEE4A1C5C45E500F50370 /* NibNameProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NibNameProtocol.swift; sourceTree = ""; }; 78CFEE4B1C5C45E500F50370 /* ReuseIdentifierProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReuseIdentifierProtocol.swift; sourceTree = ""; }; @@ -428,7 +426,6 @@ 78C36F7F1D8021D100E7EBEA /* UIColor */, C37210711ACDF1042F70C2EB /* UIImage */, C372153938A7B7D327F55124 /* UIStoryboard */, - 78E59B2B1C786CBF00C6BFE9 /* UITableView */, 78E59B2C1C786CD500C6BFE9 /* UIView */, 78D4B5441DA64D31005B0764 /* UIViewController */, 7884DB9A1DC1432B00E52A63 /* UserDefaults */, @@ -472,14 +469,6 @@ path = Functions; sourceTree = ""; }; - 78E59B2B1C786CBF00C6BFE9 /* UITableView */ = { - isa = PBXGroup; - children = ( - 78CFEE461C5C45E500F50370 /* UITableView+CellRegistration.swift */, - ); - path = UITableView; - sourceTree = ""; - }; 78E59B2C1C786CD500C6BFE9 /* UIView */ = { isa = PBXGroup; children = ( @@ -694,7 +683,6 @@ EF2921A61E165DF400E8F43B /* TimeInterval+DateComponents.swift in Sources */, 78D4B5461DA64D49005B0764 /* UIViewController+DefaultStoryboardIdentifier.swift in Sources */, 7834236A1DB8D0E100A79643 /* StoryboardProtocol.swift in Sources */, - 78CFEE521C5C45E500F50370 /* UITableView+CellRegistration.swift in Sources */, 78B0FC7F1C6B2C4D00358B64 /* Log.swift in Sources */, 78753E2E1DE58DBA006BC0FB /* FixedPageCursor.swift in Sources */, 789CC60B1DE584F800F789D3 /* CursorType+Slice.swift in Sources */, diff --git a/LeadKit/LeadKit/Extensions/UITableView/UITableView+CellRegistration.swift b/LeadKit/LeadKit/Extensions/UITableView/UITableView+CellRegistration.swift deleted file mode 100644 index d61dc43e..00000000 --- a/LeadKit/LeadKit/Extensions/UITableView/UITableView+CellRegistration.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) 2017 Touch Instinct -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -import UIKit - -public extension UITableView { - /** - method which register UITableViewCell subclass for reusing in UITableView with reuse identifier - provided by ReuseIdentifierProtocol protocol implementation and nib name - provided by StaticNibNameProtocol protocol implementation - - - parameter cellClass: UITableViewCell subclass which implements ReuseIdentifierProtocol and StaticNibNameProtocol - - - see: ReuseIdentifierProtocol, StaticNibNameProtocol - */ - - public func registerNib(forCellClass cellClass: T.Type) - where T: ReuseIdentifierProtocol, T: UITableViewCell, T: StaticNibNameProtocol { - - register(UINib(nibName: T.nibName), forCellReuseIdentifier: T.reuseIdentifier) - } - - /** - method which register UITableViewCell subclass for reusing in UITableView with reuse identifier - provided by ReuseIdentifierProtocol protocol implementation and nib name - provided by NibNameProtocol protocol implementation - - - parameter cellClass: UITableViewCell subclass which implements ReuseIdentifierProtocol and NibNameProtocol - - parameter interfaceIdiom: UIUserInterfaceIdiom value for NibNameProtocol - - - see: ReuseIdentifierProtocol, NibNameProtocol - */ - - public func registerNib(forCellClass cellClass: T.Type, - forUserInterfaceIdiom interfaceIdiom: UIUserInterfaceIdiom) - where T: ReuseIdentifierProtocol, T: UITableViewCell, T: NibNameProtocol { - - let nib = UINib(nibName: T.nibName(forConfiguration: interfaceIdiom)) - register(nib, forCellReuseIdentifier: T.reuseIdentifier) - } - -}