Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2bfde4db3 | |||
| 4d503abebc | |||
| 43893485cc | |||
| 41fdbd2be0 | |||
| e0fa62820d | |||
| 3cc3d43b59 | |||
| 2e1748e25b | |||
| 847b88b3af | |||
| c987e11e77 | |||
| a6e3be745e | |||
| 96d3f40a48 | |||
| 7ffb2d3920 | |||
| 72ad3a47a5 | |||
| 8bccccb3f6 | |||
| 90c5ad9816 | |||
| b47ae2e431 | |||
| b52f9ddfbe | |||
| bb6ef1efb0 | |||
| eb682bbce1 | |||
| 56e22e7fd2 | |||
| f4e2ff40f9 | |||
| 05a8c02a36 | |||
| 61981d3020 | |||
| cf0f252395 | |||
| 29ae6fd7f6 | |||
| 08b0761aff |
@@ -1 +0,0 @@
|
||||
4.2
|
||||
+3
-2
@@ -3,12 +3,13 @@
|
||||
# * https://github.com/supermarin/xcpretty#usage
|
||||
|
||||
language: objective-c
|
||||
osx_image: xcode10
|
||||
osx_image: xcode12
|
||||
# cache: cocoapods
|
||||
# podfile: Example/Podfile
|
||||
before_install:
|
||||
- gem install cocoapods # Since Travis is not always on latest version
|
||||
# - pod install --project-directory=Example
|
||||
script:
|
||||
- set -o pipefail && xcodebuild -workspace Example/ScalingCarousel.xcworkspace -scheme ScalingCarousel-Example -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=12.0,name=iPhone Xs' ONLY_ACTIVE_ARCH=NO | xcpretty
|
||||
- set -o pipefail && xcodebuild -workspace Example/ScalingCarousel.xcworkspace -scheme ScalingCarousel-Example -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=13.0,name=iPhone 11' ONLY_ACTIVE_ARCH=NO | xcpretty
|
||||
- pod lib lint
|
||||
- swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"
|
||||
|
||||
@@ -2,10 +2,4 @@ use_frameworks!
|
||||
|
||||
target 'ScalingCarousel_Example' do
|
||||
pod 'ScalingCarousel', :path => '../'
|
||||
|
||||
target 'ScalingCarousel_Tests' do
|
||||
inherit! :search_paths
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
PODS:
|
||||
- ScalingCarousel (2.0.3)
|
||||
- ScalingCarousel (3.1.1)
|
||||
|
||||
DEPENDENCIES:
|
||||
- ScalingCarousel (from `../`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
ScalingCarousel:
|
||||
:path: ../
|
||||
:path: "../"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
ScalingCarousel: 826fde3393a7c5c68184256fd760dcbed77334d1
|
||||
ScalingCarousel: b7968a97f8bbefdd900e089221bb39a3e2069dd9
|
||||
|
||||
PODFILE CHECKSUM: aaf53f72e837000e0cec9b542eb92f29695d1812
|
||||
PODFILE CHECKSUM: eb98ed396fdf8c805a77f2d1f034cb686f11deb6
|
||||
|
||||
COCOAPODS: 1.3.1
|
||||
COCOAPODS: 1.9.3
|
||||
|
||||
+6
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ScalingCarousel",
|
||||
"version": "2.0.3",
|
||||
"version": "3.2.0",
|
||||
"summary": "A super simple carousel view with scaling transitions written in Swift",
|
||||
"description": "ScalingCarousel provides a simple carousel-style collection view.\nIt takes care of cell presentation, scaling each cell as the collection view is scrolled.\n\nIt is used in Bikey to present bike station information.",
|
||||
"homepage": "https://github.com/superpeteblaze/ScalingCarousel",
|
||||
@@ -13,10 +13,12 @@
|
||||
},
|
||||
"source": {
|
||||
"git": "https://github.com/superpeteblaze/ScalingCarousel.git",
|
||||
"tag": "v2.0.3"
|
||||
"tag": "v3.2.0"
|
||||
},
|
||||
"platforms": {
|
||||
"ios": "9.0"
|
||||
"ios": "10.0"
|
||||
},
|
||||
"source_files": "ScalingCarousel/Classes/**/*"
|
||||
"swift_versions": "5",
|
||||
"source_files": "Sources/ScalingCarousel/**/*",
|
||||
"swift_version": "5"
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,16 +1,16 @@
|
||||
PODS:
|
||||
- ScalingCarousel (2.0.3)
|
||||
- ScalingCarousel (3.1.1)
|
||||
|
||||
DEPENDENCIES:
|
||||
- ScalingCarousel (from `../`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
ScalingCarousel:
|
||||
:path: ../
|
||||
:path: "../"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
ScalingCarousel: 826fde3393a7c5c68184256fd760dcbed77334d1
|
||||
ScalingCarousel: b7968a97f8bbefdd900e089221bb39a3e2069dd9
|
||||
|
||||
PODFILE CHECKSUM: aaf53f72e837000e0cec9b542eb92f29695d1812
|
||||
PODFILE CHECKSUM: eb98ed396fdf8c805a77f2d1f034cb686f11deb6
|
||||
|
||||
COCOAPODS: 1.3.1
|
||||
COCOAPODS: 1.9.3
|
||||
|
||||
+349
-462
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "E9582E7E712D7CD7A32DF86E8120CBC5"
|
||||
BuildableName = "ScalingCarousel.framework"
|
||||
BlueprintName = "ScalingCarousel"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "E9582E7E712D7CD7A32DF86E8120CBC5"
|
||||
BuildableName = "ScalingCarousel.framework"
|
||||
BlueprintName = "ScalingCarousel"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
+110
-15
@@ -1,15 +1,33 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
function on_error {
|
||||
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
|
||||
}
|
||||
trap 'on_error $LINENO' ERR
|
||||
|
||||
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
|
||||
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
|
||||
# frameworks to, so exit 0 (signalling the script phase was successful).
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
|
||||
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
|
||||
|
||||
# Used as a return value for each invocation of `strip_invalid_archs` function.
|
||||
STRIP_BINARY_RETVAL=0
|
||||
|
||||
# This protects against multiple targets copying the same framework dependency at the same time. The solution
|
||||
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
|
||||
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
|
||||
|
||||
# Copies and strips a vendored framework
|
||||
install_framework()
|
||||
{
|
||||
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
|
||||
@@ -23,19 +41,24 @@ install_framework()
|
||||
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
if [ -L "${source}" ]; then
|
||||
echo "Symlinked..."
|
||||
source="$(readlink "${source}")"
|
||||
echo "Symlinked..."
|
||||
source="$(readlink "${source}")"
|
||||
fi
|
||||
|
||||
# Use filter instead of exclude so missing patterns don't throw errors.
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||
|
||||
local basename
|
||||
basename="$(basename -s .framework "$1")"
|
||||
binary="${destination}/${basename}.framework/${basename}"
|
||||
|
||||
if ! [ -r "$binary" ]; then
|
||||
binary="${destination}/${basename}"
|
||||
elif [ -L "${binary}" ]; then
|
||||
echo "Destination binary is symlinked..."
|
||||
dirname="$(dirname "${binary}")"
|
||||
binary="${dirname}/$(readlink "${binary}")"
|
||||
fi
|
||||
|
||||
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||
@@ -49,7 +72,7 @@ install_framework()
|
||||
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
|
||||
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
|
||||
local swift_runtime_libs
|
||||
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
||||
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
|
||||
for lib in $swift_runtime_libs; do
|
||||
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
||||
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
||||
@@ -58,21 +81,50 @@ install_framework()
|
||||
fi
|
||||
}
|
||||
|
||||
# Copies the dSYM of a vendored framework
|
||||
# Copies and strips a vendored dSYM
|
||||
install_dsym() {
|
||||
local source="$1"
|
||||
warn_missing_arch=${2:-true}
|
||||
if [ -r "$source" ]; then
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
|
||||
# Copy the dSYM into the targets temp dir.
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
|
||||
|
||||
local basename
|
||||
basename="$(basename -s .dSYM "$source")"
|
||||
binary_name="$(ls "$source/Contents/Resources/DWARF")"
|
||||
binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}"
|
||||
|
||||
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||
if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then
|
||||
strip_invalid_archs "$binary" "$warn_missing_arch"
|
||||
fi
|
||||
|
||||
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
|
||||
# Move the stripped file into its final destination.
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
|
||||
else
|
||||
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
|
||||
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Copies the bcsymbolmap files of a vendored framework
|
||||
install_bcsymbolmap() {
|
||||
local bcsymbolmap_path="$1"
|
||||
local destination="${BUILT_PRODUCTS_DIR}"
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"
|
||||
}
|
||||
|
||||
# Signs a framework with the provided identity
|
||||
code_sign_if_enabled() {
|
||||
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||
# Use the current code_sign_identitiy
|
||||
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||
# Use the current code_sign_identity
|
||||
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
||||
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
|
||||
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
|
||||
|
||||
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
|
||||
code_sign_cmd="$code_sign_cmd &"
|
||||
@@ -85,21 +137,64 @@ code_sign_if_enabled() {
|
||||
# Strip invalid architectures
|
||||
strip_invalid_archs() {
|
||||
binary="$1"
|
||||
# Get architectures for current file
|
||||
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
|
||||
warn_missing_arch=${2:-true}
|
||||
# Get architectures for current target binary
|
||||
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
|
||||
# Intersect them with the architectures we are building for
|
||||
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
|
||||
# If there are no archs supported by this binary then warn the user
|
||||
if [[ -z "$intersected_archs" ]]; then
|
||||
if [[ "$warn_missing_arch" == "true" ]]; then
|
||||
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
|
||||
fi
|
||||
STRIP_BINARY_RETVAL=0
|
||||
return
|
||||
fi
|
||||
stripped=""
|
||||
for arch in $archs; do
|
||||
for arch in $binary_archs; do
|
||||
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
|
||||
# Strip non-valid architectures in-place
|
||||
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
|
||||
lipo -remove "$arch" -output "$binary" "$binary"
|
||||
stripped="$stripped $arch"
|
||||
fi
|
||||
done
|
||||
if [[ "$stripped" ]]; then
|
||||
echo "Stripped $binary of architectures:$stripped"
|
||||
fi
|
||||
STRIP_BINARY_RETVAL=1
|
||||
}
|
||||
|
||||
install_artifact() {
|
||||
artifact="$1"
|
||||
base="$(basename "$artifact")"
|
||||
case $base in
|
||||
*.framework)
|
||||
install_framework "$artifact"
|
||||
;;
|
||||
*.dSYM)
|
||||
# Suppress arch warnings since XCFrameworks will include many dSYM files
|
||||
install_dsym "$artifact" "false"
|
||||
;;
|
||||
*.bcsymbolmap)
|
||||
install_bcsymbolmap "$artifact"
|
||||
;;
|
||||
*)
|
||||
echo "error: Unrecognized artifact "$artifact""
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
copy_artifacts() {
|
||||
file_list="$1"
|
||||
while read artifact; do
|
||||
install_artifact "$artifact"
|
||||
done <$file_list
|
||||
}
|
||||
|
||||
ARTIFACT_LIST_FILE="${BUILT_PRODUCTS_DIR}/cocoapods-artifacts-${CONFIGURATION}.txt"
|
||||
if [ -r "${ARTIFACT_LIST_FILE}" ]; then
|
||||
copy_artifacts "${ARTIFACT_LIST_FILE}"
|
||||
fi
|
||||
|
||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/ScalingCarousel/ScalingCarousel.framework"
|
||||
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
|
||||
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
||||
> "$RESOURCES_TO_COPY"
|
||||
|
||||
XCASSET_FILES=()
|
||||
|
||||
# This protects against multiple targets copying the same framework dependency at the same time. The solution
|
||||
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
|
||||
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
|
||||
|
||||
case "${TARGETED_DEVICE_FAMILY}" in
|
||||
1,2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
|
||||
;;
|
||||
1)
|
||||
TARGET_DEVICE_ARGS="--target-device iphone"
|
||||
;;
|
||||
2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad"
|
||||
;;
|
||||
3)
|
||||
TARGET_DEVICE_ARGS="--target-device tv"
|
||||
;;
|
||||
4)
|
||||
TARGET_DEVICE_ARGS="--target-device watch"
|
||||
;;
|
||||
*)
|
||||
TARGET_DEVICE_ARGS="--target-device mac"
|
||||
;;
|
||||
esac
|
||||
|
||||
install_resource()
|
||||
{
|
||||
if [[ "$1" = /* ]] ; then
|
||||
RESOURCE_PATH="$1"
|
||||
else
|
||||
RESOURCE_PATH="${PODS_ROOT}/$1"
|
||||
fi
|
||||
if [[ ! -e "$RESOURCE_PATH" ]] ; then
|
||||
cat << EOM
|
||||
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
|
||||
EOM
|
||||
exit 1
|
||||
fi
|
||||
case $RESOURCE_PATH in
|
||||
*.storyboard)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.xib)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.framework)
|
||||
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
;;
|
||||
*.xcdatamodel)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
|
||||
;;
|
||||
*.xcdatamodeld)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
|
||||
;;
|
||||
*.xcmappingmodel)
|
||||
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
|
||||
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
|
||||
;;
|
||||
*.xcassets)
|
||||
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
|
||||
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
||||
;;
|
||||
*)
|
||||
echo "$RESOURCE_PATH" || true
|
||||
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
|
||||
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
||||
rm -f "$RESOURCES_TO_COPY"
|
||||
|
||||
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
|
||||
then
|
||||
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
|
||||
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
|
||||
while read line; do
|
||||
if [[ $line != "${PODS_ROOT}*" ]]; then
|
||||
XCASSET_FILES+=("$line")
|
||||
fi
|
||||
done <<<"$OTHER_XCASSETS"
|
||||
|
||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
||||
+6
-5
@@ -1,11 +1,12 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel"
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ScalingCarousel"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ScalingCarousel/ScalingCarousel.framework/Headers"
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel/ScalingCarousel.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "ScalingCarousel"
|
||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||
|
||||
+6
-5
@@ -1,11 +1,12 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel"
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ScalingCarousel"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ScalingCarousel/ScalingCarousel.framework/Headers"
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel/ScalingCarousel.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "ScalingCarousel"
|
||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
# Acknowledgements
|
||||
This application makes use of the following third party libraries:
|
||||
Generated by CocoaPods - https://cocoapods.org
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreferenceSpecifiers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>This application makes use of the following third party libraries:</string>
|
||||
<key>Title</key>
|
||||
<string>Acknowledgements</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Generated by CocoaPods - https://cocoapods.org</string>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>StringsTable</key>
|
||||
<string>Acknowledgements</string>
|
||||
<key>Title</key>
|
||||
<string>Acknowledgements</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Generated
-5
@@ -1,5 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_Pods_ScalingCarousel_Tests : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_Pods_ScalingCarousel_Tests
|
||||
@end
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
|
||||
|
||||
# This protects against multiple targets copying the same framework dependency at the same time. The solution
|
||||
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
|
||||
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
|
||||
|
||||
install_framework()
|
||||
{
|
||||
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
|
||||
local source="${BUILT_PRODUCTS_DIR}/$1"
|
||||
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
|
||||
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
|
||||
elif [ -r "$1" ]; then
|
||||
local source="$1"
|
||||
fi
|
||||
|
||||
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
if [ -L "${source}" ]; then
|
||||
echo "Symlinked..."
|
||||
source="$(readlink "${source}")"
|
||||
fi
|
||||
|
||||
# Use filter instead of exclude so missing patterns don't throw errors.
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||
|
||||
local basename
|
||||
basename="$(basename -s .framework "$1")"
|
||||
binary="${destination}/${basename}.framework/${basename}"
|
||||
if ! [ -r "$binary" ]; then
|
||||
binary="${destination}/${basename}"
|
||||
fi
|
||||
|
||||
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
|
||||
strip_invalid_archs "$binary"
|
||||
fi
|
||||
|
||||
# Resign the code if required by the build settings to avoid unstable apps
|
||||
code_sign_if_enabled "${destination}/$(basename "$1")"
|
||||
|
||||
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
|
||||
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
|
||||
local swift_runtime_libs
|
||||
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
||||
for lib in $swift_runtime_libs; do
|
||||
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
||||
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
||||
code_sign_if_enabled "${destination}/${lib}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# Copies the dSYM of a vendored framework
|
||||
install_dsym() {
|
||||
local source="$1"
|
||||
if [ -r "$source" ]; then
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Signs a framework with the provided identity
|
||||
code_sign_if_enabled() {
|
||||
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||
# Use the current code_sign_identitiy
|
||||
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
||||
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
|
||||
|
||||
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
|
||||
code_sign_cmd="$code_sign_cmd &"
|
||||
fi
|
||||
echo "$code_sign_cmd"
|
||||
eval "$code_sign_cmd"
|
||||
fi
|
||||
}
|
||||
|
||||
# Strip invalid architectures
|
||||
strip_invalid_archs() {
|
||||
binary="$1"
|
||||
# Get architectures for current file
|
||||
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
|
||||
stripped=""
|
||||
for arch in $archs; do
|
||||
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
|
||||
# Strip non-valid architectures in-place
|
||||
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
|
||||
stripped="$stripped $arch"
|
||||
fi
|
||||
done
|
||||
if [[ "$stripped" ]]; then
|
||||
echo "Stripped $binary of architectures:$stripped"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
|
||||
wait
|
||||
fi
|
||||
Example/Pods/Target Support Files/Pods-ScalingCarousel_Tests/Pods-ScalingCarousel_Tests-resources.sh
Generated
-106
@@ -1,106 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
|
||||
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
||||
> "$RESOURCES_TO_COPY"
|
||||
|
||||
XCASSET_FILES=()
|
||||
|
||||
# This protects against multiple targets copying the same framework dependency at the same time. The solution
|
||||
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
|
||||
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
|
||||
|
||||
case "${TARGETED_DEVICE_FAMILY}" in
|
||||
1,2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
|
||||
;;
|
||||
1)
|
||||
TARGET_DEVICE_ARGS="--target-device iphone"
|
||||
;;
|
||||
2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad"
|
||||
;;
|
||||
3)
|
||||
TARGET_DEVICE_ARGS="--target-device tv"
|
||||
;;
|
||||
4)
|
||||
TARGET_DEVICE_ARGS="--target-device watch"
|
||||
;;
|
||||
*)
|
||||
TARGET_DEVICE_ARGS="--target-device mac"
|
||||
;;
|
||||
esac
|
||||
|
||||
install_resource()
|
||||
{
|
||||
if [[ "$1" = /* ]] ; then
|
||||
RESOURCE_PATH="$1"
|
||||
else
|
||||
RESOURCE_PATH="${PODS_ROOT}/$1"
|
||||
fi
|
||||
if [[ ! -e "$RESOURCE_PATH" ]] ; then
|
||||
cat << EOM
|
||||
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
|
||||
EOM
|
||||
exit 1
|
||||
fi
|
||||
case $RESOURCE_PATH in
|
||||
*.storyboard)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.xib)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.framework)
|
||||
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
;;
|
||||
*.xcdatamodel)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
|
||||
;;
|
||||
*.xcdatamodeld)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
|
||||
;;
|
||||
*.xcmappingmodel)
|
||||
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
|
||||
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
|
||||
;;
|
||||
*.xcassets)
|
||||
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
|
||||
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
||||
;;
|
||||
*)
|
||||
echo "$RESOURCE_PATH" || true
|
||||
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
|
||||
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
||||
rm -f "$RESOURCES_TO_COPY"
|
||||
|
||||
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
|
||||
then
|
||||
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
|
||||
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
|
||||
while read line; do
|
||||
if [[ $line != "${PODS_ROOT}*" ]]; then
|
||||
XCASSET_FILES+=("$line")
|
||||
fi
|
||||
done <<<"$OTHER_XCASSETS"
|
||||
|
||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
||||
Generated
-16
@@ -1,16 +0,0 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#ifndef FOUNDATION_EXPORT
|
||||
#if defined(__cplusplus)
|
||||
#define FOUNDATION_EXPORT extern "C"
|
||||
#else
|
||||
#define FOUNDATION_EXPORT extern
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
FOUNDATION_EXPORT double Pods_ScalingCarousel_TestsVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char Pods_ScalingCarousel_TestsVersionString[];
|
||||
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel/ScalingCarousel.framework/Headers"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
||||
Generated
-6
@@ -1,6 +0,0 @@
|
||||
framework module Pods_ScalingCarousel_Tests {
|
||||
umbrella header "Pods-ScalingCarousel_Tests-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel/ScalingCarousel.framework/Headers"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.4.1</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ScalingCarousel
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
SKIP_INSTALL = YES
|
||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ScalingCarousel
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
SKIP_INSTALL = YES
|
||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||
@@ -1,10 +0,0 @@
|
||||
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ScalingCarousel
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
|
||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
SKIP_INSTALL = YES
|
||||
@@ -7,7 +7,6 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
371D5443D4C13439BA9B90F3 /* Pods_ScalingCarousel_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 458709EF51094BC6F4D04000 /* Pods_ScalingCarousel_Example.framework */; };
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
|
||||
607FACD81AFB9204008FA782 /* StoryboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* StoryboardViewController.swift */; };
|
||||
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
|
||||
@@ -15,13 +14,11 @@
|
||||
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
|
||||
65678AFE206FEAF900A0ED42 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 65678AFD206FEAF900A0ED42 /* Default-568h@2x.png */; };
|
||||
65E99FA11E1519D50026BEC4 /* CodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65E99FA01E1519D50026BEC4 /* CodeViewController.swift */; };
|
||||
C6618DAE3DE8113DB4EAFAA9 /* Pods_ScalingCarousel_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EDBA98D3B6D4A1D88262FFD /* Pods_ScalingCarousel_Example.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2AC39C6CC3E82205FC41C768 /* Pods-ScalingCarousel_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScalingCarousel_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ScalingCarousel_Tests/Pods-ScalingCarousel_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
2CDA8F1B0A30ECE4574BBC6B /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||
458709EF51094BC6F4D04000 /* Pods_ScalingCarousel_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ScalingCarousel_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
54ACDAF6D64CCC3389CF9744 /* Pods-ScalingCarousel_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScalingCarousel_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
607FACD01AFB9204008FA782 /* ScalingCarousel_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScalingCarousel_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
@@ -33,11 +30,11 @@
|
||||
659A02AC202F775500587C36 /* ScalingCarousel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScalingCarousel.h; sourceTree = "<group>"; };
|
||||
659A02AD202F775500587C36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
65E99FA01E1519D50026BEC4 /* CodeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeViewController.swift; sourceTree = "<group>"; };
|
||||
76B5BA65FCAD75DAB10B57A9 /* Pods_ScalingCarousel_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ScalingCarousel_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
89D32616AEF95F03E816E2C3 /* Pods-ScalingCarousel_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScalingCarousel_Example.release.xcconfig"; path = "Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||
9EDBA98D3B6D4A1D88262FFD /* Pods_ScalingCarousel_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ScalingCarousel_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B4E24FA6EB33F7731B8832FD /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||
BA63361010B0F437C40DBABF /* Pods-ScalingCarousel_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScalingCarousel_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ScalingCarousel_Tests/Pods-ScalingCarousel_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
C076B0D8341FA770E7E1424B /* Pods-ScalingCarousel_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScalingCarousel_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||
D4431AA1F74964D7F1D89BD4 /* ScalingCarousel.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = ScalingCarousel.podspec; path = ../ScalingCarousel.podspec; sourceTree = "<group>"; };
|
||||
F172F921357CEEEB996B8EF4 /* Pods-ScalingCarousel_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScalingCarousel_Example.debug.xcconfig"; path = "Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -45,22 +42,13 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
371D5443D4C13439BA9B90F3 /* Pods_ScalingCarousel_Example.framework in Frameworks */,
|
||||
C6618DAE3DE8113DB4EAFAA9 /* Pods_ScalingCarousel_Example.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
3FA1F2A62E4ADD293B1EF2D3 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
458709EF51094BC6F4D04000 /* Pods_ScalingCarousel_Example.framework */,
|
||||
76B5BA65FCAD75DAB10B57A9 /* Pods_ScalingCarousel_Tests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACC71AFB9204008FA782 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -69,8 +57,8 @@
|
||||
607FACD21AFB9204008FA782 /* Example */,
|
||||
659A02AB202F775500587C36 /* ScalingCarousel */,
|
||||
607FACD11AFB9204008FA782 /* Products */,
|
||||
AB4C669AD33FFC8D61F2C71C /* Pods */,
|
||||
3FA1F2A62E4ADD293B1EF2D3 /* Frameworks */,
|
||||
B6A2109DB13DAE15C2E098DF /* Pods */,
|
||||
977EEA47608D0E4C3AD28941 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -156,15 +144,21 @@
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AB4C669AD33FFC8D61F2C71C /* Pods */ = {
|
||||
977EEA47608D0E4C3AD28941 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
54ACDAF6D64CCC3389CF9744 /* Pods-ScalingCarousel_Example.debug.xcconfig */,
|
||||
C076B0D8341FA770E7E1424B /* Pods-ScalingCarousel_Example.release.xcconfig */,
|
||||
BA63361010B0F437C40DBABF /* Pods-ScalingCarousel_Tests.debug.xcconfig */,
|
||||
2AC39C6CC3E82205FC41C768 /* Pods-ScalingCarousel_Tests.release.xcconfig */,
|
||||
9EDBA98D3B6D4A1D88262FFD /* Pods_ScalingCarousel_Example.framework */,
|
||||
);
|
||||
name = Pods;
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B6A2109DB13DAE15C2E098DF /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F172F921357CEEEB996B8EF4 /* Pods-ScalingCarousel_Example.debug.xcconfig */,
|
||||
89D32616AEF95F03E816E2C3 /* Pods-ScalingCarousel_Example.release.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
@@ -174,12 +168,11 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "ScalingCarousel_Example" */;
|
||||
buildPhases = (
|
||||
BA663BC8D55C4A023C2ED9E6 /* [CP] Check Pods Manifest.lock */,
|
||||
D93D57586D7582ADCFD48D6A /* [CP] Check Pods Manifest.lock */,
|
||||
607FACCC1AFB9204008FA782 /* Sources */,
|
||||
607FACCD1AFB9204008FA782 /* Frameworks */,
|
||||
607FACCE1AFB9204008FA782 /* Resources */,
|
||||
C3DFC5D82C263B445B53FBDD /* [CP] Embed Pods Frameworks */,
|
||||
2F81D719AB74666EA6BF3325 /* [CP] Copy Pods Resources */,
|
||||
4E0BE5B3C02A4D44C48EE380 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -203,7 +196,7 @@
|
||||
607FACCF1AFB9204008FA782 = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
DevelopmentTeam = 49CJ89TL4W;
|
||||
LastSwiftMigration = 1000;
|
||||
LastSwiftMigration = 1110;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -212,6 +205,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
@@ -240,46 +234,13 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
2F81D719AB74666EA6BF3325 /* [CP] Copy Pods Resources */ = {
|
||||
4E0BE5B3C02A4D44C48EE380 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
BA663BC8D55C4A023C2ED9E6 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-ScalingCarousel_Example-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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
C3DFC5D82C263B445B53FBDD /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example-frameworks.sh",
|
||||
"${PODS_ROOT}/Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/ScalingCarousel/ScalingCarousel.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
@@ -288,7 +249,29 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example-frameworks.sh\"\n";
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ScalingCarousel_Example/Pods-ScalingCarousel_Example-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
D93D57586D7582ADCFD48D6A /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-ScalingCarousel_Example-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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
@@ -431,35 +414,39 @@
|
||||
};
|
||||
607FACF01AFB9204008FA782 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 54ACDAF6D64CCC3389CF9744 /* Pods-ScalingCarousel_Example.debug.xcconfig */;
|
||||
baseConfigurationReference = F172F921357CEEEB996B8EF4 /* Pods-ScalingCarousel_Example.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 49CJ89TL4W;
|
||||
INFOPLIST_FILE = ScalingCarousel/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 3.2.0;
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
607FACF11AFB9204008FA782 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C076B0D8341FA770E7E1424B /* Pods-ScalingCarousel_Example.release.xcconfig */;
|
||||
baseConfigurationReference = 89D32616AEF95F03E816E2C3 /* Pods-ScalingCarousel_Example.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 49CJ89TL4W;
|
||||
INFOPLIST_FILE = ScalingCarousel/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 3.2.0;
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
+10
-13
@@ -41,6 +41,15 @@
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "ScalingCarousel_Example.app"
|
||||
BlueprintName = "ScalingCarousel_Example"
|
||||
ReferencedContainer = "container:ScalingCarousel.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
@@ -53,17 +62,6 @@
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "ScalingCarousel_Example.app"
|
||||
BlueprintName = "ScalingCarousel_Example"
|
||||
ReferencedContainer = "container:ScalingCarousel.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -76,6 +74,7 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
stopOnEveryThreadSanitizerIssue = "YES"
|
||||
stopOnEveryMainThreadCheckerIssue = "YES"
|
||||
migratedStopOnEveryIssue = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
@@ -88,8 +87,6 @@
|
||||
ReferencedContainer = "container:ScalingCarousel.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BY5-bO-M1j">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BY5-bO-M1j">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -19,10 +17,10 @@
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Mq8-SH-Mx8" customClass="ScalingCarouselView" customModule="ScalingCarousel">
|
||||
<rect key="frame" x="0.0" y="353" width="375" height="250"/>
|
||||
<rect key="frame" x="0.0" y="103" width="375" height="500"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="250" id="9nX-Ku-j46"/>
|
||||
<constraint firstAttribute="height" constant="500" id="9nX-Ku-j46"/>
|
||||
</constraints>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="BKc-yN-cAB">
|
||||
<size key="itemSize" width="50" height="50"/>
|
||||
@@ -39,7 +37,7 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RJs-7r-dhV">
|
||||
<rect key="frame" x="-0.5" y="0.0" width="50" height="50"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</subviews>
|
||||
@@ -66,14 +64,14 @@
|
||||
</connections>
|
||||
</collectionView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KAz-De-GJ8">
|
||||
<rect key="frame" x="150" y="105" width="74" height="30"/>
|
||||
<rect key="frame" x="150.5" y="85" width="74" height="30"/>
|
||||
<state key="normal" title="Show/Hide"/>
|
||||
<connections>
|
||||
<action selector="showHideButtonPressed:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Jsy-vc-cWp"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UYO-rO-XuZ">
|
||||
<rect key="frame" x="187" y="143" width="0.0" height="0.0"/>
|
||||
<rect key="frame" x="187.5" y="123" width="0.0" height="0.0"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
|
||||
@@ -61,6 +61,7 @@ class CodeViewController: UIViewController {
|
||||
|
||||
let frame = CGRect(x: 0, y: 0, width: 0, height: 0)
|
||||
scalingCarousel = ScalingCarouselView(withFrame: frame, andInset: 20)
|
||||
scalingCarousel.scrollDirection = .vertical
|
||||
scalingCarousel.dataSource = self
|
||||
scalingCarousel.delegate = self
|
||||
scalingCarousel.translatesAutoresizingMaskIntoConstraints = false
|
||||
@@ -102,6 +103,6 @@ extension CodeViewController: UICollectionViewDataSource {
|
||||
extension CodeViewController: UICollectionViewDelegate {
|
||||
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
//scalingCarousel.didScroll()
|
||||
scalingCarousel.didScroll()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.4.1</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -57,8 +57,10 @@ extension CarouselDatasource: UICollectionViewDataSource {
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
|
||||
|
||||
|
||||
if let scalingCell = cell as? ScalingCarouselCell {
|
||||
scalingCell.mainView.backgroundColor = .red
|
||||
scalingCell.cornerRadius = 40
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
@@ -74,7 +76,7 @@ typealias CarouselDelegate = StoryboardViewController
|
||||
extension StoryboardViewController: UICollectionViewDelegate {
|
||||
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
//carousel.didScroll()
|
||||
carousel.didScroll()
|
||||
|
||||
guard let currentCenterIndex = carousel.currentCenterCellIndex?.row else { return }
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// swift-tools-version:5.3
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "ScalingCarousel",
|
||||
platforms: [SupportedPlatform.iOS(.v10)],
|
||||
products: [
|
||||
// Products define the executables and libraries a package produces, and make them visible to other packages.
|
||||
.library(
|
||||
name: "ScalingCarousel",
|
||||
targets: ["ScalingCarousel"]),
|
||||
],
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
// .package(url: /* package url */, from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||
// Targets can depend on other targets in this package, and on products in packages this package depends on.
|
||||
.target(
|
||||
name: "ScalingCarousel",
|
||||
dependencies: []),
|
||||
.testTarget(
|
||||
name: "ScalingCarouselTests",
|
||||
dependencies: ["ScalingCarousel"]),
|
||||
]
|
||||
)
|
||||
@@ -5,6 +5,7 @@
|
||||
[](http://cocoapods.org/pods/ScalingCarousel)
|
||||
[](http://cocoapods.org/pods/ScalingCarousel)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](https://github.com/apple/swift-package-manager)
|
||||
|
||||
ScalingCarousel provides a simple carousel-style collection view.
|
||||
It takes care of cell presentation, scaling each cell as the collection view is scrolled.
|
||||
@@ -34,13 +35,13 @@ This property is declared in ScalingCarouselCell. You should add any cell conten
|
||||
|
||||
* Note: To ensure correct scaling of the ScalingCarouselCell, you need to call the following code after you configure your cell with it's data (e.g in `cellForItem(at:)`):
|
||||
|
||||
```
|
||||
```swift
|
||||
cell.setNeedsLayout()
|
||||
cell.layoutIfNeeded()
|
||||
```
|
||||
* Note: To ensure correct displayed of the ScalingCarousel, you need to call the following code in the method `viewWillTransition(to size:, with coordinator:)` of the ViewController:
|
||||
|
||||
```
|
||||
```swift
|
||||
super.viewWillTransition(to: size, with: coordinator)
|
||||
scalingCarousel.deviceRotated()
|
||||
```
|
||||
@@ -49,7 +50,7 @@ scalingCarousel.deviceRotated()
|
||||
|
||||
* Create a custom UICollectionViewCell which inherits from ScalingCarouselCell. Initialize the mainView property, which is declared in ScalingCarouselCell;
|
||||
|
||||
```
|
||||
```swift
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
||||
@@ -68,7 +69,7 @@ override init(frame: CGRect) {
|
||||
|
||||
* Create and add a ScalingCarouselView to your view, and implement the standard UICollectionViewDatasource methods in your view controller;
|
||||
|
||||
```
|
||||
```swift
|
||||
// Create our carousel
|
||||
let scalingCarousel = ScalingCarouselView(withFrame: frame, andInset: 20)
|
||||
scalingCarousel.dataSource = self
|
||||
@@ -92,13 +93,13 @@ scalingCarousel.topAnchor.constraint(equalTo: view.topAnchor, constant: 50).isAc
|
||||
|
||||
* Note: To ensure correct scaling of the ScalingCarouselCell, you need to call the following code after you configure your cell with it's data (e.g in `cellForItem(at:)`):
|
||||
|
||||
```
|
||||
```swift
|
||||
cell.setNeedsLayout()
|
||||
cell.layoutIfNeeded()
|
||||
```
|
||||
* Note: To ensure correct displayed of the ScalingCarousel, you need to call the following code in the method `viewWillTransition(to size:, with coordinator:)` of the ViewController, If you have created the ScalingCarousel by code in the viewDidLoad, It is important to verify that it exists when the method `viewWillTransition` is called or we will have a crash if we load the viewController with the device in landscape mode:
|
||||
|
||||
```
|
||||
```swift
|
||||
super.viewWillTransition(to: size, with: coordinator)
|
||||
if scalingCarousel != nil {
|
||||
scalingCarousel.deviceRotated()
|
||||
@@ -112,11 +113,11 @@ To run the example project, clone the repo, and run `pod install` from the Examp
|
||||
|
||||
## Requirements
|
||||
|
||||
iOS 9
|
||||
iOS 10
|
||||
|
||||
## Installation
|
||||
|
||||
ScalingCarousel is available through [CocoaPods](http://cocoapods.org) and [Carthage](https://github.com/Carthage/Carthage).
|
||||
ScalingCarousel is available through [CocoaPods](http://cocoapods.org), [Carthage](https://github.com/Carthage/Carthage) and [Swift Package Manager](https://swift.org/package-manager/).
|
||||
|
||||
To install via Cocoapods, add the following line to your Podfile:
|
||||
|
||||
@@ -130,6 +131,15 @@ To install via Carthage, add the following line to your Podfile:
|
||||
github "superpeteblaze/ScalingCarousel"
|
||||
```
|
||||
|
||||
To install via Swift package manager:
|
||||
|
||||
> Note: Instructions below are for using **SwiftPM** without the Xcode UI. It's the easiest to go to your Project Settings -> Swift Packages and add ScalingCarousel from there.
|
||||
|
||||
To integrate using Apple's Swift package manager, without Xcode integration, add the following as a dependency to your `Package.swift`:
|
||||
|
||||
```swift
|
||||
.package(url: "https://github.com/superpeteblaze/ScalingCarousel.git", .upToNextMajor(from: "3.2.0"))
|
||||
```
|
||||
## Author
|
||||
|
||||
Pete Smith, peadar81@gmail.com
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'ScalingCarousel'
|
||||
s.version = '2.4.1'
|
||||
s.version = '3.2.0'
|
||||
s.summary = 'A super simple carousel view with scaling transitions written in Swift'
|
||||
|
||||
s.description = <<-DESC
|
||||
@@ -26,6 +26,7 @@ It is used in Bikey to present bike station information.
|
||||
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
|
||||
|
||||
s.ios.deployment_target = '10.0'
|
||||
s.swift_version = '5'
|
||||
|
||||
s.source_files = 'ScalingCarousel/Classes/**/*'
|
||||
s.source_files = 'Sources/ScalingCarousel/**/*'
|
||||
end
|
||||
|
||||
+14
-7
@@ -32,6 +32,9 @@ open class ScalingCarouselCell: UICollectionViewCell {
|
||||
/// The minimum value to alpha to, should be set between 0 and 1
|
||||
open var alphaMinimum: CGFloat = 0.85
|
||||
|
||||
/// The corner radius value of the cell's main view
|
||||
open var cornerRadius: CGFloat = 20.0
|
||||
|
||||
// MARK: - IBOutlets
|
||||
|
||||
// This property should be connected to the main cell subview
|
||||
@@ -62,17 +65,21 @@ open class ScalingCarouselCell: UICollectionViewCell {
|
||||
guard let superview = superview,
|
||||
let mainView = mainView else { return }
|
||||
|
||||
// Get our absolute origin value
|
||||
let originX = superview.convert(frame, to: superview.superview).origin.x
|
||||
// Get our absolute origin value and width/height based on the scroll direction
|
||||
var origin = superview.convert(frame, to: superview.superview).origin.x
|
||||
var contentWidthOrHeight = frame.size.width
|
||||
if let collectionView = superview as? ScalingCarouselView, collectionView.scrollDirection == .vertical {
|
||||
origin = superview.convert(frame, to: superview.superview).origin.y
|
||||
contentWidthOrHeight = frame.size.height
|
||||
}
|
||||
|
||||
// Calculate our actual origin.x value using our inset
|
||||
let originXActual = originX - carouselInset
|
||||
let originActual = origin - carouselInset
|
||||
|
||||
let width = frame.size.width
|
||||
|
||||
// Calculate our scale values
|
||||
let scaleCalculator = abs(width - abs(originXActual))
|
||||
let percentageScale = (scaleCalculator/width)
|
||||
let scaleCalculator = abs(contentWidthOrHeight - abs(originActual))
|
||||
let percentageScale = (scaleCalculator/contentWidthOrHeight)
|
||||
|
||||
let scaleValue = scaleMinimum
|
||||
+ (percentageScale/scaleDivisor)
|
||||
@@ -87,6 +94,6 @@ open class ScalingCarouselCell: UICollectionViewCell {
|
||||
mainView.alpha = alphaValue
|
||||
|
||||
// ..also..round the corners
|
||||
mainView.layer.cornerRadius = 20
|
||||
mainView.layer.cornerRadius = cornerRadius
|
||||
}
|
||||
}
|
||||
+15
-3
@@ -35,16 +35,28 @@ open class ScalingCarouselLayout: UICollectionViewFlowLayout {
|
||||
|
||||
// Set itemSize based on total width and inset
|
||||
itemSize = collectionViewSize
|
||||
itemSize.width = itemSize.width - (inset * 2)
|
||||
|
||||
// Set scrollDirection and paging
|
||||
scrollDirection = .horizontal
|
||||
var direction: UICollectionView.ScrollDirection = .horizontal
|
||||
if let collectionView = collectionView as? ScalingCarouselView {
|
||||
direction = collectionView.scrollDirection
|
||||
}
|
||||
scrollDirection = direction
|
||||
|
||||
// set item height/width and sectionInset based on scroll direction
|
||||
if scrollDirection == .vertical {
|
||||
itemSize.height = itemSize.height - (inset * 2)
|
||||
sectionInset = UIEdgeInsets(top: inset, left: 0.0, bottom: inset, right: 0.0)
|
||||
|
||||
} else {
|
||||
itemSize.width = itemSize.width - (inset * 2)
|
||||
sectionInset = UIEdgeInsets(top: 0.0, left: inset, bottom: 0.0, right: inset)
|
||||
}
|
||||
collectionView?.isPagingEnabled = true
|
||||
|
||||
minimumLineSpacing = 0.0
|
||||
minimumInteritemSpacing = 0.0
|
||||
|
||||
sectionInset = UIEdgeInsets(top: 0.0, left: inset, bottom: 0.0, right: inset)
|
||||
footerReferenceSize = CGSize.zero
|
||||
headerReferenceSize = CGSize.zero
|
||||
}
|
||||
+58
-29
@@ -20,9 +20,11 @@ open class ScalingCarouselView: UICollectionView {
|
||||
// MARK: - Properties (Private)
|
||||
|
||||
private var lastCurrentCenterCellIndex: IndexPath?
|
||||
|
||||
|
||||
// MARK: - Properties (Public)
|
||||
|
||||
open var scrollDirection: UICollectionView.ScrollDirection = .horizontal
|
||||
|
||||
/// Inset of the main, center cell
|
||||
@IBInspectable public var inset: CGFloat = 0.0 {
|
||||
didSet {
|
||||
@@ -44,7 +46,9 @@ open class ScalingCarouselView: UICollectionView {
|
||||
|
||||
let cellRect = convert(cell.frame, to: nil)
|
||||
|
||||
if cellRect.origin.x > lowerBound && cellRect.origin.x < upperBound {
|
||||
if scrollDirection == .horizontal && cellRect.origin.x > lowerBound && cellRect.origin.x < upperBound {
|
||||
return cell
|
||||
} else if scrollDirection == .vertical && cellRect.origin.y > lowerBound && cellRect.origin.y < upperBound {
|
||||
return cell
|
||||
}
|
||||
|
||||
@@ -79,15 +83,20 @@ open class ScalingCarouselView: UICollectionView {
|
||||
}
|
||||
|
||||
// Set the invisibleScrollView contentSize width based on number of items
|
||||
let contentWidth = invisibleScrollView.frame.width * CGFloat(numberItems)
|
||||
invisibleScrollView.contentSize = CGSize(width: contentWidth, height: invisibleScrollView.frame.height)
|
||||
if scrollDirection == .horizontal {
|
||||
let contentWidth = invisibleScrollView.frame.width * CGFloat(numberItems)
|
||||
invisibleScrollView.contentSize = CGSize(width: contentWidth, height: invisibleScrollView.frame.height)
|
||||
} else {
|
||||
let contentHeight = invisibleScrollView.frame.height * CGFloat(numberItems)
|
||||
invisibleScrollView.contentSize = CGSize(width: invisibleScrollView.frame.width, height: contentHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Properties (Private)
|
||||
fileprivate var invisibleScrollView: UIScrollView!
|
||||
fileprivate var invisibleWidthConstraint: NSLayoutConstraint?
|
||||
fileprivate var invisibleLeftConstraint: NSLayoutConstraint?
|
||||
fileprivate var invisibleWidthOrHeightConstraint: NSLayoutConstraint?
|
||||
fileprivate var invisibleLeftOrTopConstraint: NSLayoutConstraint?
|
||||
|
||||
// MARK: - Lifecycle
|
||||
|
||||
@@ -118,9 +127,12 @@ open class ScalingCarouselView: UICollectionView {
|
||||
|
||||
override open func scrollToItem(at indexPath: IndexPath, at scrollPosition: UICollectionView.ScrollPosition, animated: Bool) {
|
||||
super.scrollToItem(at: indexPath, at: scrollPosition, animated: animated)
|
||||
|
||||
let originX = (CGFloat(indexPath.item) * (frame.size.width - (inset * 2)))
|
||||
let rect = CGRect(x: originX, y: 0, width: frame.size.width - (inset * 2), height: frame.height)
|
||||
var origin = (CGFloat(indexPath.item) * (frame.size.width - (inset * 2)))
|
||||
var rect = CGRect(x: origin, y: 0, width: frame.size.width - (inset * 2), height: frame.height)
|
||||
if scrollDirection == .vertical {
|
||||
origin = (CGFloat(indexPath.item) * (frame.size.height - (inset * 2)))
|
||||
rect = CGRect(x: 0, y: origin, width: frame.width, height: frame.size.height - (inset * 2))
|
||||
}
|
||||
scrollRectToVisible(rect, animated: animated)
|
||||
lastCurrentCenterCellIndex = indexPath
|
||||
}
|
||||
@@ -162,7 +174,11 @@ open class ScalingCarouselView: UICollectionView {
|
||||
guard let lastCurrentCenterCellIndex = currentCenterCellIndex ?? lastCurrentCenterCellIndex else { return }
|
||||
DispatchQueue.main.async {
|
||||
self.reloadData()
|
||||
self.scrollToItem(at: lastCurrentCenterCellIndex, at: .centeredHorizontally, animated: false)
|
||||
var position: UICollectionView.ScrollPosition = .centeredHorizontally
|
||||
if self.scrollDirection == .vertical {
|
||||
position = .centeredVertically
|
||||
}
|
||||
self.scrollToItem(at: lastCurrentCenterCellIndex, at: position, animated: false)
|
||||
self.didScroll()
|
||||
}
|
||||
}
|
||||
@@ -171,7 +187,7 @@ open class ScalingCarouselView: UICollectionView {
|
||||
private typealias PrivateAPI = ScalingCarouselView
|
||||
fileprivate extension PrivateAPI {
|
||||
|
||||
fileprivate func addInvisibleScrollView(to superview: UIView?) {
|
||||
func addInvisibleScrollView(to superview: UIView?) {
|
||||
guard let superview = superview else { return }
|
||||
|
||||
/// Add our 'invisible' scrollview
|
||||
@@ -179,6 +195,7 @@ fileprivate extension PrivateAPI {
|
||||
invisibleScrollView.translatesAutoresizingMaskIntoConstraints = false
|
||||
invisibleScrollView.isPagingEnabled = true
|
||||
invisibleScrollView.showsHorizontalScrollIndicator = false
|
||||
invisibleScrollView.showsVerticalScrollIndicator = false
|
||||
|
||||
/*
|
||||
Disable user interaction on the 'invisible' scrollview,
|
||||
@@ -190,13 +207,13 @@ fileprivate extension PrivateAPI {
|
||||
invisibleScrollView.delegate = self
|
||||
|
||||
/*
|
||||
Now add the invisible scrollview's pan
|
||||
Now add the invisible scrollview's pan
|
||||
gesture recognizer to the ScalingCarouselView
|
||||
*/
|
||||
addGestureRecognizer(invisibleScrollView.panGestureRecognizer)
|
||||
|
||||
/*
|
||||
Finally, add the 'invisible' scrollview as a subview
|
||||
Finally, add the 'invisible' scrollview as a subview
|
||||
of the ScalingCarousel's superview
|
||||
*/
|
||||
superview.addSubview(invisibleScrollView)
|
||||
@@ -205,9 +222,13 @@ fileprivate extension PrivateAPI {
|
||||
Add constraints for height and top, relative to the
|
||||
ScalingCarouselView
|
||||
*/
|
||||
invisibleScrollView.heightAnchor.constraint(equalTo: heightAnchor).isActive = true
|
||||
invisibleScrollView.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
||||
|
||||
if scrollDirection == .horizontal {
|
||||
invisibleScrollView.heightAnchor.constraint(equalTo: heightAnchor).isActive = true
|
||||
invisibleScrollView.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
||||
} else {
|
||||
invisibleScrollView.widthAnchor.constraint(equalTo: widthAnchor).isActive = true
|
||||
invisibleScrollView.leftAnchor.constraint(equalTo: leftAnchor).isActive = true
|
||||
}
|
||||
/*
|
||||
Further configure our layout and add more constraints
|
||||
for width and left position
|
||||
@@ -215,7 +236,7 @@ fileprivate extension PrivateAPI {
|
||||
configureLayout()
|
||||
}
|
||||
|
||||
fileprivate func configureLayout() {
|
||||
func configureLayout() {
|
||||
|
||||
// Create a ScalingCarouselLayout using our inset
|
||||
collectionViewLayout = ScalingCarouselLayout(
|
||||
@@ -228,21 +249,29 @@ fileprivate extension PrivateAPI {
|
||||
guard let invisibleScrollView = invisibleScrollView else { return }
|
||||
|
||||
// Remove constraints if they already exist
|
||||
invisibleWidthConstraint?.isActive = false
|
||||
invisibleLeftConstraint?.isActive = false
|
||||
invisibleWidthOrHeightConstraint?.isActive = false
|
||||
invisibleLeftOrTopConstraint?.isActive = false
|
||||
|
||||
/*
|
||||
Add constrants for width and left postion
|
||||
to our 'invisible' UIScrollView
|
||||
/*
|
||||
Add constrants for width and left postion
|
||||
to our 'invisible' UIScrollView if scroll Direction is horizontal
|
||||
height and top position if scroll Direction is vertical
|
||||
*/
|
||||
invisibleWidthConstraint = invisibleScrollView.widthAnchor.constraint(
|
||||
equalTo: widthAnchor, constant: -(2 * inset))
|
||||
invisibleLeftConstraint = invisibleScrollView.leftAnchor.constraint(
|
||||
equalTo: leftAnchor, constant: inset)
|
||||
|
||||
if scrollDirection == .horizontal {
|
||||
invisibleWidthOrHeightConstraint = invisibleScrollView.widthAnchor.constraint(equalTo: widthAnchor, constant: -(2 * inset))
|
||||
invisibleLeftOrTopConstraint = invisibleScrollView.leftAnchor.constraint(equalTo: leftAnchor, constant: inset)
|
||||
} else {
|
||||
invisibleWidthOrHeightConstraint = invisibleScrollView.heightAnchor.constraint(equalTo: heightAnchor, constant: -(2 * inset))
|
||||
invisibleLeftOrTopConstraint = invisibleScrollView.topAnchor.constraint(equalTo: topAnchor, constant: inset)
|
||||
}
|
||||
// Activate the constraints
|
||||
invisibleWidthConstraint?.isActive = true
|
||||
invisibleLeftConstraint?.isActive = true
|
||||
invisibleWidthOrHeightConstraint?.isActive = true
|
||||
invisibleLeftOrTopConstraint?.isActive = true
|
||||
|
||||
|
||||
// To avoid carousel moving when cell is tapped
|
||||
isPagingEnabled = true
|
||||
isScrollEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import XCTest
|
||||
|
||||
import ScalingCarouselTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += ScalingCarouselTests.allTests()
|
||||
XCTMain(tests)
|
||||
@@ -0,0 +1,14 @@
|
||||
import XCTest
|
||||
@testable import ScalingCarousel
|
||||
|
||||
final class ScalingCarouselTests: XCTestCase {
|
||||
func testExample() {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct
|
||||
// results.
|
||||
}
|
||||
|
||||
static var allTests = [
|
||||
("testExample", testExample),
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import XCTest
|
||||
|
||||
#if !canImport(ObjectiveC)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
return [
|
||||
testCase(ScalingCarouselTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user