Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Upgrade to Swift 5.0 #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- UIEmptyState (4.0.0)
- UIEmptyState (5.0.0)

DEPENDENCIES:
- UIEmptyState (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
UIEmptyState: a299e655ecb6fc077dfb503c375ef9a023103240
UIEmptyState: ffd62f9923a67a2d53c31238f00e120be2cc231f

PODFILE CHECKSUM: 2410e5e41e5d4570ddd34538c5ba93d5d35ce08c

COCOAPODS: 1.5.3
COCOAPODS: 1.6.1
22 changes: 13 additions & 9 deletions Example/UIEmptyStateExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,20 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Luis Padron";
TargetAttributes = {
A05AA1BD1E4560E800B851F7 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 4FNMZ7SN42;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = A05AA1B91E4560E800B851F7 /* Build configuration list for PBXProject "UIEmptyStateExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -188,7 +188,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-UIEmptyStateExample/Pods-UIEmptyStateExample-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-UIEmptyStateExample/Pods-UIEmptyStateExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/UIEmptyState/UIEmptyState.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -197,7 +197,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-UIEmptyStateExample/Pods-UIEmptyStateExample-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-UIEmptyStateExample/Pods-UIEmptyStateExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
7D72286EB8A21429E4DC3E74 /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -258,6 +258,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand All @@ -267,13 +268,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -314,6 +317,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand All @@ -323,13 +327,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -369,8 +375,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.luispadron.UIEmptyStateExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -384,8 +389,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.luispadron.UIEmptyStateExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions UIEmptyState.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Pod::Spec.new do |s|

s.name = "UIEmptyState"
s.version = "4.0.1"
s.version = "5.0.0"
s.summary = "An empty state control to give visually appealing context when building iOS applications."
s.description = <<-DESC
s.swift_version = '4.2'
s.swift_version = '5.0'
Empty state control which gives context with either a message, image, and buttons to the user when ever there is a reason the state is empty.
Easily conform to the protocol to provide a visually appealing view to an empty table view controller.
DESC
Expand Down
33 changes: 15 additions & 18 deletions src/UIEmptyState.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,29 +163,28 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Luis Padron";
TargetAttributes = {
A0AABE4B1E3FED13006CD69C = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 4FNMZ7SN42;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
A0AABE541E3FED14006CD69C = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 4FNMZ7SN42;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = A0AABE461E3FED13006CD69C /* Build configuration list for PBXProject "UIEmptyState" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = A0AABE421E3FED13006CD69C;
productRefGroup = A0AABE4D1E3FED14006CD69C /* Products */;
Expand Down Expand Up @@ -250,6 +249,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -312,6 +312,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -369,7 +370,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4FNMZ7SN42;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -381,8 +382,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -392,7 +392,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4FNMZ7SN42;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -403,36 +403,33 @@
PRODUCT_BUNDLE_IDENTIFIER = com.luispadron.UIEmptyState;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
A0AABE641E3FED14006CD69C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
DEVELOPMENT_TEAM = 4FNMZ7SN42;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = UIEmptyStateTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.luispadron.UIEmptyStateTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
A0AABE651E3FED14006CD69C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
DEVELOPMENT_TEAM = 4FNMZ7SN42;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = UIEmptyStateTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.luispadron.UIEmptyStateTests;
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 = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions src/UIEmptyState/UIEmptyStateView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private extension UILabel {
let maxSize = CGSize(width: width, height: .greatestFiniteMagnitude)

#if swift(>=4.0)
let attrString = NSAttributedString(string: txt, attributes: [.font: self.font])
let attrString = NSAttributedString(string: txt, attributes: [.font: self.font as Any])
#else
let attrString = NSAttributedString(string: txt, attributes: [NSFontAttributeName: self.font])
#endif
Expand Down Expand Up @@ -270,7 +270,7 @@ open class UIEmptyStateView: UIView {
private func handleAdding(view: UIView) {
// The order we want is 1. Image View, 2. Title Label, 3. Detail Label, 4. Button
// If already added we can return
if contentView.subviews.index(of: view) != nil { return }
if contentView.subviews.firstIndex(of: view) != nil { return }

// Tags correspond to the views AND the order we want them in
switch view.tag {
Expand Down