Skip to content

Commit

Permalink
Updated To Swift 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
epv44 committed Apr 5, 2021
1 parent 7f50920 commit d141ce9
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 57 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

3 changes: 2 additions & 1 deletion EVSlidingTableViewCell.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = 'EVSlidingTableViewCell'
s.version = '3.0.0'
s.version = '3.0.1'
s.homepage = 'https://github.com/epv44/EVSlidingTableViewCell'
s.author = { 'Eric Vennaro' => 'epv9@case.edu' }
s.summary = 'UITableViewCell implementing "swipe to reveal" a drawer view with customizable action buttons'
Expand All @@ -17,6 +17,7 @@ Custom UITableViewCell that can be swiped either way to reveal a "drawer" with b
s.documentation_url = 'https://epv44.github.io/docs/EVSlidingTableViewCell/index.html'

s.ios.deployment_target = '9.3'
s.swift_version = '5.0'

s.source_files = 'EVSlidingTableViewCell/Classes/**/*'

Expand Down
4 changes: 2 additions & 2 deletions EVSlidingTableViewCell/Classes/ContactItem/ContactItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ class ContactItem: UIView {

var buttonImage: UIImage {
get {
return button.image(for: UIControlState()) ?? UIImage()
return button.image(for: UIControl.State()) ?? UIImage()
}
set {
button.setImage(newValue, for: UIControlState())
button.setImage(newValue, for: UIControl.State())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public typealias DrawerViewClosureType = ((String) -> Bool)
UITableViewCell that takes a user defined overlay view and allows it to be "swiped" away revealing a serious of IBAction buttons. As the drawer option buttons are revealed they grow and fade in.
*/
public extension SlidingTableViewControllerCell {
public static var reuseIdentifier: String {
static var reuseIdentifier: String {
return "drawerViewCell"
}
}
Expand Down Expand Up @@ -175,7 +175,7 @@ open class SlidingTableViewControllerCell<T>: UITableViewCell {
return false
}
let translation = panGestureRecognizer.translation(in: superview!)
return fabs(translation.x) > fabs(translation.y)
return abs(translation.x) > abs(translation.y)
}

//MARK: Private Methods
Expand Down
2 changes: 1 addition & 1 deletion EVSlidingTableViewCell/Classes/EVConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct EVConstants {
return growthRateValue
}
set {
self.growthRateValue = growthRate
self.growthRateValue = newValue
}
}
}
Expand Down
28 changes: 16 additions & 12 deletions Example/EVSlidingTableViewCell.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,25 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = PQ553ZXC6M;
LastSwiftMigration = 0900;
LastSwiftMigration = 1240;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = PQ553ZXC6M;
LastSwiftMigration = 0900;
LastSwiftMigration = 1240;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
};
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "EVSlidingTableViewCell" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -435,6 +435,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -453,6 +454,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -478,7 +480,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -492,6 +494,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -510,6 +513,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -528,7 +532,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -546,13 +550,13 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = PQ553ZXC6M;
INFOPLIST_FILE = EVSlidingTableViewCell/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.EVSlidingTableViewCell-Example-";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -564,13 +568,13 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = PQ553ZXC6M;
INFOPLIST_FILE = EVSlidingTableViewCell/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.EVSlidingTableViewCell-Example-";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -589,7 +593,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -604,7 +608,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -41,6 +41,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "EVSlidingTableViewCell_Example.app"
BlueprintName = "EVSlidingTableViewCell_Example"
ReferencedContainer = "container:EVSlidingTableViewCell.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -53,17 +62,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "EVSlidingTableViewCell_Example.app"
BlueprintName = "EVSlidingTableViewCell_Example"
ReferencedContainer = "container:EVSlidingTableViewCell.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -85,8 +83,6 @@
ReferencedContainer = "container:EVSlidingTableViewCell.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
2 changes: 1 addition & 1 deletion Example/EVSlidingTableViewCell/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions Example/EVSlidingTableViewCell/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct Constants {

func emailClosure() -> DrawerViewClosureType {
func openEmail(text: String) -> (Bool) {
UIApplication.shared.openURL(NSURL(string: "mailto:\(text)")! as URL)
UIApplication.shared.open(NSURL(string: "mailto:\(text)")! as URL)
return true
}

Expand All @@ -37,7 +37,7 @@ func emailClosure() -> DrawerViewClosureType {
func phoneClosure() -> DrawerViewClosureType {
func openPhone(text: String) -> (Bool) {
let phoneNumber: String = text.components(separatedBy: NSCharacterSet.decimalDigits.inverted).joined(separator: "")
UIApplication.shared.openURL(NSURL(string: "tel://\(phoneNumber)")! as URL)
UIApplication.shared.open(NSURL(string: "tel://\(phoneNumber)")! as URL)
return true
}

Expand All @@ -47,7 +47,7 @@ func phoneClosure() -> DrawerViewClosureType {
func textClosure() -> DrawerViewClosureType {
func openMessenger(text: String) -> (Bool) {
let phoneNumber = text.components(separatedBy: NSCharacterSet.decimalDigits.inverted).joined(separator: "")
UIApplication.shared.openURL(NSURL(string: "sms:+\(phoneNumber)")! as URL)
UIApplication.shared.open(NSURL(string: "sms:+\(phoneNumber)")! as URL)
return true
}

Expand Down
2 changes: 1 addition & 1 deletion Example/EVSlidingTableViewCell/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
contactsTableView.register(SlidingTableViewControllerCell<MyStruct>.self, forCellReuseIdentifier: SlidingTableViewControllerCell<Any>.reuseIdentifier)
contactsTableView.rowHeight = UITableViewAutomaticDimension
contactsTableView.rowHeight = UITableView.automaticDimension
contactsTableView.estimatedRowHeight = 91
}

Expand Down
Loading

0 comments on commit d141ce9

Please sign in to comment.