Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 5 Migration + SwiftUI #696

Merged
merged 5 commits into from
Feb 8, 2021
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ node_modules
_book
xcodebuild.log
.swiftpm
/.bundle
59 changes: 28 additions & 31 deletions Hero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -776,46 +776,40 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1120;
ORGANIZATIONNAME = "Luke Zhao";
TargetAttributes = {
2D1F7FBE1E49DCB5004D944B = {
CreatedOnToolsVersion = 8.2;
DevelopmentTeam = 4VSEW78TKT;
ProvisioningStyle = Automatic;
};
2D1F7FE11E49DD90004D944B = {
CreatedOnToolsVersion = 8.2;
DevelopmentTeam = 4VSEW78TKT;
ProvisioningStyle = Automatic;
};
A306D3B11E1C7A2E00B6C23A = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 4VSEW78TKT;
LastSwiftMigration = 1000;
LastSwiftMigration = 1120;
ProvisioningStyle = Automatic;
};
A33E60A01DE761C90065CBD8 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = 683UGRW72Z;
LastSwiftMigration = 1000;
LastSwiftMigration = 1120;
ProvisioningStyle = Automatic;
};
AF1E1B501E66822C00ECE039 = {
CreatedOnToolsVersion = 8.2;
DevelopmentTeam = 4VSEW78TKT;
LastSwiftMigration = 1000;
LastSwiftMigration = 1120;
ProvisioningStyle = Automatic;
TestTargetID = A33E60A01DE761C90065CBD8;
};
};
};
buildConfigurationList = A33E609C1DE761C90065CBD8 /* Build configuration list for PBXProject "Hero" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -1179,7 +1173,7 @@
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4VSEW78TKT;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -1206,7 +1200,7 @@
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4VSEW78TKT;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -1233,7 +1227,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
DEVELOPMENT_TEAM = 4VSEW78TKT;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = TvOSExamples/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.6.0;
Expand All @@ -1253,7 +1247,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
DEVELOPMENT_TEAM = 4VSEW78TKT;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = TvOSExamples/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.6.0;
Expand All @@ -1273,9 +1267,10 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4VSEW78TKT;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -1288,7 +1283,7 @@
PRODUCT_NAME = Hero;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -1302,7 +1297,7 @@
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4VSEW78TKT;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -1314,7 +1309,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero;
PRODUCT_NAME = Hero;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -1325,6 +1320,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 @@ -1351,7 +1347,6 @@
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -1377,14 +1372,15 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
A33E60B21DE761C90065CBD8 /* Release */ = {
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 @@ -1411,7 +1407,6 @@
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
Expand All @@ -1429,7 +1424,7 @@
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -1439,14 +1434,14 @@
baseConfigurationReference = 5CD4F09A588E81DA75C2BE38 /* Pods-HeroExamples.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 683UGRW72Z;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/Examples/Resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.6.0;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroExamples;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -1456,14 +1451,14 @@
baseConfigurationReference = C377744CBFF1E24426E80F55 /* Pods-HeroExamples.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 683UGRW72Z;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/Examples/Resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.6.0;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroExamples;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -1473,13 +1468,14 @@
baseConfigurationReference = C51A6465EC2CB38D82F28B93 /* Pods-HeroTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = 4VSEW78TKT;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HeroExamples.app/HeroExamples";
};
name = Debug;
Expand All @@ -1489,13 +1485,14 @@
baseConfigurationReference = 5CEC69C9A9A60129002FD931 /* Pods-HeroTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = 4VSEW78TKT;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HeroExamples.app/HeroExamples";
};
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 = "1100"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Hero.xcodeproj/xcshareddata/xcschemes/Hero.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1100"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
target 'HeroExamples' do
platform :ios, '9.0'
use_frameworks!
pod 'CollectionKit'
pod 'CollectionKit', :inhibit_warnings => true

target 'HeroTests' do
inherit! :search_paths
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ DEPENDENCIES:
- CollectionKit

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
https://cdn.cocoapods.org/:
- CollectionKit

SPEC CHECKSUMS:
CollectionKit: 5caa5341860d4c9b748ebfeaab97530b2d02c7c0

PODFILE CHECKSUM: efc6b025c2cee81dcc6fa480009618ed1af56837
PODFILE CHECKSUM: bfa4251748617deb38237ad241be4629254392c1

COCOAPODS: 1.8.4
2 changes: 1 addition & 1 deletion Sources/HeroContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ extension HeroContext {
let pairedView = pairedView(for: view),
let pairedSnapshot = snapshotViews[pairedView],
let siblingViews = pairedView.superview?.subviews,
let index = siblingViews.firstIndex(of: pairedView) {
let index = siblingViews.firstIndex(of: pairedView) {
let nextSiblings = siblingViews[index+1..<siblingViews.count]
containerView.addSubview(pairedSnapshot)
containerView.addSubview(snapshot)
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import CoreGraphics
import UIKit

extension CMTime {
static let zero = kCMTimeZero
static let zero = CMTime.zero
}

enum CAMediaTimingFillMode {
Expand Down Expand Up @@ -44,7 +44,7 @@ extension UIViewController {

extension RunLoop {
enum Mode {
static let common = RunLoopMode.commonModes
static let common = RunLoop.Mode.common
}
}

Expand Down