diff --git a/Example/ExpandableTableViewController.xcodeproj/project.pbxproj b/Example/ExpandableTableViewController.xcodeproj/project.pbxproj index d6cf9e3..a8a325d 100644 --- a/Example/ExpandableTableViewController.xcodeproj/project.pbxproj +++ b/Example/ExpandableTableViewController.xcodeproj/project.pbxproj @@ -241,11 +241,11 @@ TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0810; + LastSwiftMigration = 1000; }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0810; + LastSwiftMigration = 1000; TestTargetID = 607FACCF1AFB9204008FA782; }; }; @@ -534,7 +534,8 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -549,7 +550,8 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -566,7 +568,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -579,7 +582,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Example/ExpandableTableViewController.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/ExpandableTableViewController.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/ExpandableTableViewController.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/ExpandableTableViewController/AppDelegate.swift b/Example/ExpandableTableViewController/AppDelegate.swift index c531052..cbb3db7 100644 --- a/Example/ExpandableTableViewController/AppDelegate.swift +++ b/Example/ExpandableTableViewController/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } diff --git a/Example/ExpandableTableViewController/DemoCells/CommonTableViewCell.swift b/Example/ExpandableTableViewController/DemoCells/CommonTableViewCell.swift index 1191fbb..3ea75d1 100644 --- a/Example/ExpandableTableViewController/DemoCells/CommonTableViewCell.swift +++ b/Example/ExpandableTableViewController/DemoCells/CommonTableViewCell.swift @@ -32,18 +32,18 @@ class CommonTableViewCell: UITableViewCell { func openArrow(){ UIView.animate(withDuration: 0.25, animations: { - self.arrowIndicatorImageView.transform = CGAffineTransform(rotationAngle: (CGFloat(M_PI) / 180.0)*0.0); + self.arrowIndicatorImageView.transform = CGAffineTransform(rotationAngle: (CGFloat.pi / 180.0)*0.0); }) } func closeArrow(){ UIView.animate(withDuration: 0.25, animations: { - self.arrowIndicatorImageView.transform = CGAffineTransform(rotationAngle: (CGFloat(M_PI) / 180.0)*180.0); + self.arrowIndicatorImageView.transform = CGAffineTransform(rotationAngle: (CGFloat.pi / 180.0)*180.0); }) } func showSeparator(){ - self.separatorInset = UIEdgeInsetsMake(0, self.frame.width, 0, 0); + self.separatorInset = UIEdgeInsets.init(top: 0, left: self.frame.width, bottom: 0, right: 0); } func hideSeparator(){ diff --git a/Example/ExpandableTableViewController/DemoTableViewController.swift b/Example/ExpandableTableViewController/DemoTableViewController.swift index c1859de..1fee55a 100644 --- a/Example/ExpandableTableViewController/DemoTableViewController.swift +++ b/Example/ExpandableTableViewController/DemoTableViewController.swift @@ -157,7 +157,7 @@ class DemoTableViewController: ExpandableTableViewController, ExpandableTableVie func expandableTableView(_ expandableTableView: ExpandableTableView, heightForSubRowAtExpandableIndexPath expandableIndexPath: ExpandableIndexPath) -> CGFloat { switch(expandableIndexPath.row){ case TableViewRows.text.rawValue: - return UITableViewAutomaticDimension + return UITableView.automaticDimension case TableViewRows.datePicker.rawValue: return 163.0 case TableViewRows.list.rawValue: diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index d41f4b1..0e4241b 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -34,29 +34,29 @@ /* Begin PBXFileReference section */ 05B693FAE2F9EA614B18A6886191EEC6 /* ExpandableTableViewController-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ExpandableTableViewController-prefix.pch"; sourceTree = ""; }; 08EDA1A0F0DD2C42AF0301DE3A2B4858 /* Pods-ExpandableTableViewController_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ExpandableTableViewController_Tests-acknowledgements.markdown"; sourceTree = ""; }; - 14096D92D77EC79363012B5301770E58 /* Pods_ExpandableTableViewController_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ExpandableTableViewController_Tests.framework; path = "Pods-ExpandableTableViewController_Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 14096D92D77EC79363012B5301770E58 /* Pods_ExpandableTableViewController_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ExpandableTableViewController_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 14D8F2891751E8B547A90D2FEEA31E9B /* Pods-ExpandableTableViewController_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ExpandableTableViewController_Tests-acknowledgements.plist"; sourceTree = ""; }; 15D9EA0249B99929698C3E4D403B5216 /* ExpandableTableViewDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ExpandableTableViewDelegate.swift; sourceTree = ""; }; 1FCD9854B4E5B32E1ED0DB8D9E5C7EBF /* Pods-ExpandableTableViewController_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-ExpandableTableViewController_Example-dummy.m"; sourceTree = ""; }; 223CF067B08249EFA182D06A147F9A54 /* Pods-ExpandableTableViewController_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ExpandableTableViewController_Example-frameworks.sh"; sourceTree = ""; }; 2731A634E85122E61667E4640A8ABC9C /* Pods-ExpandableTableViewController_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-ExpandableTableViewController_Tests-umbrella.h"; sourceTree = ""; }; - 369B1EC4976FDB376500730ADBD93150 /* ExpandableTableViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = ExpandableTableViewController.framework; path = ExpandableTableViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 369B1EC4976FDB376500730ADBD93150 /* ExpandableTableViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ExpandableTableViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3DBEADC4907DB69DF8A5A05A42F4D638 /* Pods-ExpandableTableViewController_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ExpandableTableViewController_Tests.release.xcconfig"; sourceTree = ""; }; 3F556F81024DCCFDCD1BC89BF6929303 /* ArrayExtension.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayExtension.swift; sourceTree = ""; }; - 3FB6FA158B8BE097E55CA4C9DFEE2833 /* Pods_ExpandableTableViewController_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ExpandableTableViewController_Example.framework; path = "Pods-ExpandableTableViewController_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3FB6FA158B8BE097E55CA4C9DFEE2833 /* Pods_ExpandableTableViewController_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ExpandableTableViewController_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 407915F12593128EDA6CC7E3BA783BA1 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51DD480B8E00F07B84A8353F34221DE3 /* Pods-ExpandableTableViewController_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ExpandableTableViewController_Example-acknowledgements.markdown"; sourceTree = ""; }; 5A7213FA73F940CB541E1985B1DC66AA /* Pods-ExpandableTableViewController_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ExpandableTableViewController_Example-acknowledgements.plist"; sourceTree = ""; }; 5D10F9C5A71C8F4E724A0F8C0115D44A /* Pods-ExpandableTableViewController_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ExpandableTableViewController_Tests-frameworks.sh"; sourceTree = ""; }; - 64B381627F7463D8CAC1ED0EE6F58F75 /* ExpandableTableViewController.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = ExpandableTableViewController.modulemap; sourceTree = ""; }; + 64B381627F7463D8CAC1ED0EE6F58F75 /* ExpandableTableViewController.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = ExpandableTableViewController.modulemap; sourceTree = ""; }; 6AA80E5E3C71992E0A9CA40DBD47DEF2 /* Pods-ExpandableTableViewController_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ExpandableTableViewController_Example-resources.sh"; sourceTree = ""; }; - 7CDC9260A397B9B692891C194F522D78 /* Pods-ExpandableTableViewController_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-ExpandableTableViewController_Example.modulemap"; sourceTree = ""; }; + 7CDC9260A397B9B692891C194F522D78 /* Pods-ExpandableTableViewController_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-ExpandableTableViewController_Example.modulemap"; sourceTree = ""; }; 7DCCC26642164BBE4795D2EB5F95BACF /* Pods-ExpandableTableViewController_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ExpandableTableViewController_Example.release.xcconfig"; sourceTree = ""; }; 82CCF143E97CC81E9EC1BF572CC967D0 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; A967976D35AF0FC23AAD37AAC6BAF9D0 /* Pods-ExpandableTableViewController_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-ExpandableTableViewController_Tests-dummy.m"; sourceTree = ""; }; A9F1860D33685004983D78DAECD7425D /* Pods-ExpandableTableViewController_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ExpandableTableViewController_Example.debug.xcconfig"; sourceTree = ""; }; - AA5ABC8909800B4458C60F8DE67AE5DE /* Pods-ExpandableTableViewController_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-ExpandableTableViewController_Tests.modulemap"; sourceTree = ""; }; + AA5ABC8909800B4458C60F8DE67AE5DE /* Pods-ExpandableTableViewController_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-ExpandableTableViewController_Tests.modulemap"; sourceTree = ""; }; BBEADDA31CA39FF71CFD9B9C7923002B /* Pods-ExpandableTableViewController_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ExpandableTableViewController_Tests.debug.xcconfig"; sourceTree = ""; }; BCB69F6876A6BD735DEDD1B5EC3CC557 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C051EE08790BFDD2F675108239B82C9C /* ExpandableTableViewController-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ExpandableTableViewController-umbrella.h"; sourceTree = ""; }; @@ -109,7 +109,6 @@ children = ( E4F3A7C860F119B2DF92DF1EAE315953 /* Classes */, ); - name = ExpandableTableViewController; path = ExpandableTableViewController; sourceTree = ""; }; @@ -226,7 +225,6 @@ E9DD87D6204B69F74520477228EFBCA1 /* ExpandableTableViewController.swift */, 15D9EA0249B99929698C3E4D403B5216 /* ExpandableTableViewDelegate.swift */, ); - name = Classes; path = Classes; sourceTree = ""; }; @@ -320,6 +318,11 @@ attributes = { LastSwiftUpdateCheck = 0730; LastUpgradeCheck = 0700; + TargetAttributes = { + 96AFA871D25A87F6FCCFED071D32EBC8 = { + LastSwiftMigration = 1000; + }; + }; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; @@ -450,7 +453,8 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -627,7 +631,8 @@ PRODUCT_NAME = ExpandableTableViewController; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/ExpandableTableViewController/Classes/ExpandableTableViewController.swift b/ExpandableTableViewController/Classes/ExpandableTableViewController.swift index 8d8cfee..887c481 100644 --- a/ExpandableTableViewController/Classes/ExpandableTableViewController.swift +++ b/ExpandableTableViewController/Classes/ExpandableTableViewController.swift @@ -211,7 +211,7 @@ open class ExpandableTableViewController: UITableViewController { } tableView.beginUpdates() - tableView.insertRows(at: indexesArray, with: UITableViewRowAnimation.middle) + tableView.insertRows(at: indexesArray, with: UITableView.RowAnimation.middle) tableView.endUpdates() // Avoids an old-fashioned scrolling to the top when inserting cells and the table view is scrolled. @@ -238,7 +238,7 @@ open class ExpandableTableViewController: UITableViewController { } tableView.beginUpdates() - tableView.deleteRows(at: indexesArray, with: UITableViewRowAnimation.middle) + tableView.deleteRows(at: indexesArray, with: UITableView.RowAnimation.middle) tableView.endUpdates() // Avoids an old-fashioned scrolling to the top when deleting cells and the table view is scrolled.