Skip to content

Commit

Permalink
Merge pull request #15 from bcylin/feature/swift-4
Browse files Browse the repository at this point in the history
Swift 4
  • Loading branch information
shujin authored Jan 4, 2018
2 parents 0193af6 + 3040a07 commit 6dd1462
Show file tree
Hide file tree
Showing 22 changed files with 467 additions and 426 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1
4.0
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode8.3
osx_image: xcode9.2
podfile: Example/Podfile
cache:
bundler: true
Expand All @@ -9,7 +9,7 @@ cache:
- Example/Pods/SwiftLint
before_install:
- xcrun instruments -s devices
- xcrun instruments -w "iPhone 7 (10.3.1) [" || true
- xcrun instruments -w "iPhone 7 (11.2) [" || true
install:
- bundle install --jobs=3 --retry=3 --deployment
- bundle exec pod install --project-directory=Example
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## Next Release

* Update to Swift 4 with Xcode 9 [#15](https://github.com/carousell/pickle/pull/15)

## v1.2.0

* Drop iOS 8 support [#13](https://github.com/carousell/pickle/pull/13)
Expand Down
44 changes: 35 additions & 9 deletions Example/Pickle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
B563515C1F06278E00B5A46D /* UITests */ = {
isa = PBXGroup;
children = (
B563515D1F06278E00B5A46D /* UITests.swift */,
B563515F1F06278E00B5A46D /* Info.plist */,
B563515D1F06278E00B5A46D /* UITests.swift */,
);
path = UITests;
sourceTree = "<group>";
Expand Down Expand Up @@ -215,15 +215,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = Carousell;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 0900;
};
B563515A1F06278E00B5A46D = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
TestTargetID = 607FACCF1AFB9204008FA782;
};
Expand Down Expand Up @@ -274,13 +275,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-PickleExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
6602408F2886C3A7E9355419 /* [CP] Copy Pods Resources */ = {
Expand All @@ -304,13 +308,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-PickleUITests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
AF94885251D96D308FF9F657 /* [CP] Copy Pods Resources */ = {
Expand Down Expand Up @@ -363,9 +370,12 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-PickleExample/Pods-PickleExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Pickle/Pickle.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Pickle.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -423,14 +433,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -470,14 +486,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -514,7 +536,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "com.carousell.pickle-example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -530,7 +553,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "com.carousell.pickle-example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -549,7 +573,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
TEST_TARGET_NAME = PickleExample;
};
name = Debug;
Expand All @@ -567,7 +592,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.carousell.UITests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
TEST_TARGET_NAME = PickleExample;
};
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 = "0820"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,6 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -69,6 +70,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
20 changes: 10 additions & 10 deletions Example/Pickle/CarousellImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ internal class CarousellImagePickerController: ImagePickerController {
let title = NSMutableAttributedString(
string: "What are you listing?\n",
attributes: [
NSFontAttributeName: UIFont.boldSystemFont(ofSize: 22),
NSForegroundColorAttributeName: UIColor.black,
NSBackgroundColorAttributeName: UIColor.white,
NSParagraphStyleAttributeName: titleStyle
.font: UIFont.boldSystemFont(ofSize: 22),
.foregroundColor: UIColor.black,
.backgroundColor: UIColor.white,
.paragraphStyle: titleStyle
]
)

let subtitle = NSAttributedString(
string: "You can choose up to 4 photos for your listing.\n",
attributes: [
NSFontAttributeName: UIFont.systemFont(ofSize: 12),
NSForegroundColorAttributeName: UIColor.darkGray,
NSBackgroundColorAttributeName: UIColor.white,
NSParagraphStyleAttributeName: subtitleStyle
.font: UIFont.systemFont(ofSize: 12),
.foregroundColor: UIColor.darkGray,
.backgroundColor: UIColor.white,
.paragraphStyle: subtitleStyle
]
)

Expand Down Expand Up @@ -96,8 +96,8 @@ private struct CarousellTheme: ImagePickerConfigurable {

// MARK: - Image Selections

var imageTagTextAttributes: [String: Any]? = nil
var selectedImageOverlayColor: UIColor? = nil
let imageTagTextAttributes: [NSAttributedStringKey: Any]? = nil
let selectedImageOverlayColor: UIColor? = nil
let allowedSelections: ImagePickerSelection? = .limit(to: 4)

// MARK: -
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use_frameworks!

target 'PickleExample' do
pod 'Pickle', :path => '../'
pod 'SwiftLint'
pod 'SwiftLint', '0.23.1'

target 'PickleUITests' do
inherit! :search_paths
Expand Down
12 changes: 6 additions & 6 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
PODS:
- Pickle (1.2.0)
- SwiftLint (0.18.1)
- SwiftLint (0.23.1)

DEPENDENCIES:
- Pickle (from `../`)
- SwiftLint
- SwiftLint (= 0.23.1)

EXTERNAL SOURCES:
Pickle:
:path: "../"
:path: ../

SPEC CHECKSUMS:
Pickle: 80f99c9377a2785e48bd5c3ad061e7f614120312
SwiftLint: b467d08f5b25dc3b3cfed243d8e1b74b91714c67
SwiftLint: 1b670ce79284c76520f84060e87d645078fd32fa

PODFILE CHECKSUM: 83c0411086be0ec4861900c45c98a441a46c6431
PODFILE CHECKSUM: 47f97668e0890347a0b2faf96d7471347d1e708a

COCOAPODS: 1.2.1
COCOAPODS: 1.3.1
Loading

0 comments on commit 6dd1462

Please sign in to comment.