Compare commits
67 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9882c474a6 | |||
| 593c2ac5f3 | |||
| 23340fc075 | |||
| 0bd57097aa | |||
| 9ede29331a | |||
| 8f51e95e35 | |||
| eb4b12f633 | |||
| c00d8b62dd | |||
| 0d60426da2 | |||
| fec46dbd52 | |||
| 54da63c4a1 | |||
| 9d0a0a9811 | |||
| 401cfe185a | |||
| db80c7384c | |||
| d03d724746 | |||
| cb583ef202 | |||
| d92b2c3e79 | |||
| d0923f2660 | |||
| 961020ea94 | |||
| 8867836ff5 | |||
| aec061594d | |||
| 45abbf66ad | |||
| 59d59bd532 | |||
| 29f5e05f1b | |||
| 7885828fa3 | |||
| a69fb3da17 | |||
| 0e16f68dc1 | |||
| 5cd6b4b698 | |||
| b5d86f1f79 | |||
| 68a429be43 | |||
| ec1200faea | |||
| f0825e09d5 | |||
| 1e354c2675 | |||
| eade5ac4c8 | |||
| 8a33f9529b | |||
| 4abeb93ac7 | |||
| 619f84d89e | |||
| 9531315c94 | |||
| cfafbbcb14 | |||
| 6a6096e0b8 | |||
| 1480a44dfb | |||
| 2687d175c1 | |||
| c84682d3d9 | |||
| 6627936d23 | |||
| b26ee135bc | |||
| 96d7da82bb | |||
| 9707c7cfe4 | |||
| 4968853f8c | |||
| 053735d408 | |||
| 6052398040 | |||
| df48ce7b85 | |||
| eb44646978 | |||
| 6686d8f83b | |||
| 03be7479f4 | |||
| 3b54e8959d | |||
| 69813ee7fe | |||
| 4ccab620d6 | |||
| 3ea5a88e01 | |||
| 2b9216b1b8 | |||
| 48f307b003 | |||
| eb44c67f69 | |||
| e6452f116e | |||
| 96c660a424 | |||
| 4833dcde35 | |||
| 8f907c1fe9 | |||
| e314fea3e7 | |||
| b4ec75ca27 |
@@ -1,4 +0,0 @@
|
||||
ci_service: travis_ci
|
||||
coverage_service: coveralls
|
||||
xcodeproj: Tests/Tests.xcodeproj
|
||||
source_directory: Source
|
||||
@@ -0,0 +1 @@
|
||||
4.0
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
osx_image: xcode8
|
||||
language: objective-c
|
||||
|
||||
before_install:
|
||||
- brew update
|
||||
- if brew outdated | grep -qx carthage; then brew upgrade carthage; fi
|
||||
- travis_wait 35 carthage bootstrap --platform iOS
|
||||
|
||||
script:
|
||||
- xcodebuild clean build -project Lightbox.xcodeproj -scheme "Lightbox-iOS" -sdk iphonesimulator
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
@@ -1 +1,2 @@
|
||||
github "hyperoslo/Hue" "master"
|
||||
github "hyperoslo/Hue" ~> 3.0
|
||||
github "hyperoslo/Imaginary" ~> 3.0
|
||||
+4
-1
@@ -1 +1,4 @@
|
||||
github "hyperoslo/Hue" "f82ffc7dd55d093d3acc6ce5b3d36ca259091fdd"
|
||||
github "hyperoslo/Cache" "4.0.2"
|
||||
github "hyperoslo/Hue" "3.0.0"
|
||||
github "hyperoslo/Imaginary" "3.0.0"
|
||||
github "onmyway133/SwiftHash" "2.0.1"
|
||||
|
||||
@@ -11,20 +11,20 @@
|
||||
29B4A42F1C43A4320060ED52 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B4A42E1C43A4320060ED52 /* ViewController.swift */; };
|
||||
29B4A4341C43A4320060ED52 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29B4A4331C43A4320060ED52 /* Assets.xcassets */; };
|
||||
29B4A4371C43A4320060ED52 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 29B4A4351C43A4320060ED52 /* LaunchScreen.storyboard */; };
|
||||
7193005DD460E198432D8F06 /* Pods_DemoLightbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0977FB7C36F459186E043753 /* Pods_DemoLightbox.framework */; };
|
||||
B89E57B7A21C44D762123511 /* Pods_DemoLightbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE4E898FD95F4D90F624B067 /* Pods_DemoLightbox.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0977FB7C36F459186E043753 /* Pods_DemoLightbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DemoLightbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
064155DBC618EBACF5C257C6 /* Pods-DemoLightbox.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoLightbox.release.xcconfig"; path = "Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox.release.xcconfig"; sourceTree = "<group>"; };
|
||||
29B4A4291C43A4320060ED52 /* DemoLightbox.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoLightbox.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
29B4A42C1C43A4320060ED52 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
29B4A42E1C43A4320060ED52 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
29B4A4331C43A4320060ED52 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
29B4A4361C43A4320060ED52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
29B4A4381C43A4320060ED52 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
5B9CE7F93A06A0459BF452D8 /* Pods-DemoLightbox.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoLightbox.release.xcconfig"; path = "Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox.release.xcconfig"; sourceTree = "<group>"; };
|
||||
C37FDBF69CDC2A95E0E105A7 /* Pods-DemoLightbox.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoLightbox.debug.xcconfig"; path = "Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
6096248776155BE47C0A196A /* Pods-DemoLightbox.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoLightbox.debug.xcconfig"; path = "Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
DAE713340DA5D2F2EF13EA8D /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EE4E898FD95F4D90F624B067 /* Pods_DemoLightbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DemoLightbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -32,20 +32,29 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7193005DD460E198432D8F06 /* Pods_DemoLightbox.framework in Frameworks */,
|
||||
B89E57B7A21C44D762123511 /* Pods_DemoLightbox.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
0C8887567644E86396B8D885 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6096248776155BE47C0A196A /* Pods-DemoLightbox.debug.xcconfig */,
|
||||
064155DBC618EBACF5C257C6 /* Pods-DemoLightbox.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B4A4201C43A4320060ED52 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B4A42B1C43A4320060ED52 /* DemoLightbox */,
|
||||
29B4A42A1C43A4320060ED52 /* Products */,
|
||||
B1B2B3DADEEC7FD14D4A9FF8 /* Frameworks */,
|
||||
80F119CA8153119A6934480D /* Pods */,
|
||||
0C8887567644E86396B8D885 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -69,20 +78,11 @@
|
||||
path = DemoLightbox;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
80F119CA8153119A6934480D /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C37FDBF69CDC2A95E0E105A7 /* Pods-DemoLightbox.debug.xcconfig */,
|
||||
5B9CE7F93A06A0459BF452D8 /* Pods-DemoLightbox.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B1B2B3DADEEC7FD14D4A9FF8 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DAE713340DA5D2F2EF13EA8D /* Pods.framework */,
|
||||
0977FB7C36F459186E043753 /* Pods_DemoLightbox.framework */,
|
||||
EE4E898FD95F4D90F624B067 /* Pods_DemoLightbox.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -94,12 +94,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 29B4A43B1C43A4320060ED52 /* Build configuration list for PBXNativeTarget "DemoLightbox" */;
|
||||
buildPhases = (
|
||||
2CF277B8821F7CE6E2730C9C /* [CP] Check Pods Manifest.lock */,
|
||||
4DE126F6B5D0C8D6C0E7D848 /* [CP] Check Pods Manifest.lock */,
|
||||
29B4A4251C43A4320060ED52 /* Sources */,
|
||||
29B4A4261C43A4320060ED52 /* Frameworks */,
|
||||
29B4A4271C43A4320060ED52 /* Resources */,
|
||||
831C9CD301B03A92F6320AEE /* [CP] Embed Pods Frameworks */,
|
||||
3BCDC27EE322C46C109D231B /* [CP] Copy Pods Resources */,
|
||||
F162948C45248BBD677112BF /* [CP] Embed Pods Frameworks */,
|
||||
D1AB0C213924D367899FA1A2 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -117,7 +117,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0720;
|
||||
LastUpgradeCheck = 0800;
|
||||
LastUpgradeCheck = 0900;
|
||||
ORGANIZATIONNAME = "Hyper Interaktiv AS";
|
||||
TargetAttributes = {
|
||||
29B4A4281C43A4320060ED52 = {
|
||||
@@ -158,22 +158,25 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
2CF277B8821F7CE6E2730C9C /* [CP] Check Pods Manifest.lock */ = {
|
||||
4DE126F6B5D0C8D6C0E7D848 /* [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-DemoLightbox-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_ROOT}/../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;
|
||||
};
|
||||
3BCDC27EE322C46C109D231B /* [CP] Copy Pods Resources */ = {
|
||||
D1AB0C213924D367899FA1A2 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -188,15 +191,26 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
831C9CD301B03A92F6320AEE /* [CP] Embed Pods Frameworks */ = {
|
||||
F162948C45248BBD677112BF /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/Cache/Cache.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/Hue/Hue.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/Imaginary/Imaginary.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/Lightbox/Lightbox.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SwiftHash/SwiftHash.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cache.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Hue.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Imaginary.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lightbox.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftHash.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
@@ -237,14 +251,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;
|
||||
@@ -272,7 +292,7 @@
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -284,14 +304,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;
|
||||
@@ -312,14 +338,14 @@
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 4.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
29B4A43C1C43A4320060ED52 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C37FDBF69CDC2A95E0E105A7 /* Pods-DemoLightbox.debug.xcconfig */;
|
||||
baseConfigurationReference = 6096248776155BE47C0A196A /* Pods-DemoLightbox.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
@@ -328,13 +354,13 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.DemoLightbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
29B4A43D1C43A4320060ED52 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 5B9CE7F93A06A0459BF452D8 /* Pods-DemoLightbox.release.xcconfig */;
|
||||
baseConfigurationReference = 064155DBC618EBACF5C257C6 /* Pods-DemoLightbox.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
@@ -343,7 +369,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.DemoLightbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ class ViewController: UIViewController {
|
||||
|
||||
// MARK: - Action methods
|
||||
|
||||
func showLightbox() {
|
||||
@objc func showLightbox() {
|
||||
let images = [
|
||||
LightboxImage(imageURL: URL(string: "https://cdn.arstechnica.net/2011/10/05/iphone4s_sample_apple-4e8c706-intro.jpg")!),
|
||||
LightboxImage(
|
||||
@@ -34,7 +34,7 @@ class ViewController: UIViewController {
|
||||
),
|
||||
LightboxImage(
|
||||
image: UIImage(named: "photo2")!,
|
||||
text: "",
|
||||
text: "🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🏃 🌲 🏃♀️ 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲\n\nSuspendisse massa massa, maximus et finibus ac, auctor volutpat diam.\n\nPellentesque consequat magna condimentum mauris bibendum, nec ornare nisl hendrerit. Phasellus nec ultrices sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\nSuspendisse sit amet facilisis ante, ac suscipit sem. Integer feugiat sit amet erat sit amet mattis. Donec tristique, nunc ut varius elementum, nisi elit viverra ipsum, vitae aliquam justo libero in arcu. Quisque tempor et justo at malesuada. Curabitur justo dolor, ornare convallis sollicitudin sed, consectetur eu turpis. \n\nNulla et dui condimentum, laoreet lacus eu, ultrices nisl. Vivamus in ante volutpat, gravida nunc scelerisque, sagittis tellus. Nullam justo purus, sagittis a tincidunt a, maximus nec sem.",
|
||||
videoURL: URL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
|
||||
),
|
||||
LightboxImage(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
platform :ios, '8.0'
|
||||
platform :ios, '9.0'
|
||||
|
||||
use_frameworks!
|
||||
inhibit_all_warnings!
|
||||
|
||||
pod 'Lightbox', path: '../../'
|
||||
target 'DemoLightbox'
|
||||
target 'DemoLightbox' do
|
||||
use_frameworks!
|
||||
pod 'Lightbox', path: '../../'
|
||||
end
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
PODS:
|
||||
- Hue (2.0.1)
|
||||
- Lightbox (1.0.0):
|
||||
- Hue
|
||||
- Cache (4.0.2):
|
||||
- SwiftHash (~> 2.0.0)
|
||||
- Hue (3.0.0)
|
||||
- Imaginary (3.0.0):
|
||||
- Cache (~> 4.0)
|
||||
- Lightbox (2.0.0):
|
||||
- Hue (~> 3.0)
|
||||
- Imaginary (~> 3.0)
|
||||
- SwiftHash (2.0.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- Lightbox (from `../../`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
Lightbox:
|
||||
:path: "../../"
|
||||
:path: ../../
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Hue: 354caec055fdc9d38b5ef33ca2e7224721843baf
|
||||
Lightbox: eb4196a846a883c4c2a52209b29b283d1bc706e1
|
||||
Cache: 363b6899cee63c82ccbd291e64a6c202abc17a88
|
||||
Hue: b8fe1e43eef13631331eebecb2198b68e2622f95
|
||||
Imaginary: 2765d293d425cbed3b07fa11642554cbaebe913d
|
||||
Lightbox: f7f1cc942d81e84d85095531208f5fe1bfd9c639
|
||||
SwiftHash: d2e09b13495447178cdfb8e46e54a5c46f15f5a9
|
||||
|
||||
PODFILE CHECKSUM: cd88b68c201e5c39cef62070056649eaee91c71b
|
||||
PODFILE CHECKSUM: 408ae3477507a1d4b7ff06ffb3f162eda443424f
|
||||
|
||||
COCOAPODS: 1.1.1
|
||||
COCOAPODS: 1.3.1
|
||||
|
||||
+7
-6
@@ -1,19 +1,20 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Lightbox"
|
||||
s.summary = "A short description of Lightbox."
|
||||
s.version = "1.0.0"
|
||||
s.summary = "A a convenient and easy to use image viewer for your iOS app, packed with all the features you expect"
|
||||
s.version = "2.0.0"
|
||||
s.homepage = "https://github.com/hyperoslo/Lightbox"
|
||||
s.license = 'MIT'
|
||||
s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" }
|
||||
s.source = { :git => "https://github.com/hyperoslo/Lightbox.git", :tag => s.version.to_s }
|
||||
s.social_media_url = 'https://twitter.com/hyperoslo'
|
||||
s.platform = :ios, '8.0'
|
||||
s.platform = :ios, '9.0'
|
||||
s.requires_arc = true
|
||||
s.source_files = 'Source/**/*'
|
||||
s.ios.resource = 'Resources/Lightbox.bundle'
|
||||
|
||||
s.frameworks = 'UIKit', 'AVFoundation', 'AVKit'
|
||||
s.dependency 'Hue'
|
||||
|
||||
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' }
|
||||
s.dependency 'Hue', '~> 3.0'
|
||||
s.dependency 'Imaginary', '~> 3.0'
|
||||
|
||||
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
D22006741DFB4D9700E92898 /* Lightbox.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D22006731DFB4D9700E92898 /* Lightbox.bundle */; };
|
||||
D2A58F5E1F7943A30064F14E /* Imaginary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2A58F5D1F7943A30064F14E /* Imaginary.framework */; };
|
||||
D2D71BBC1D54DA77006AB907 /* AssetManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D71BBB1D54DA77006AB907 /* AssetManager.swift */; };
|
||||
D5026B3C1C5BF3FD003BC1A3 /* LightboxImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5026B3B1C5BF3FD003BC1A3 /* LightboxImage.swift */; };
|
||||
D523B0BD1C43AA8B001AD1EC /* LightboxConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = D523B0B61C43AA8A001AD1EC /* LightboxConfig.swift */; };
|
||||
@@ -25,6 +26,7 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
D22006731DFB4D9700E92898 /* Lightbox.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Lightbox.bundle; sourceTree = "<group>"; };
|
||||
D2A58F5D1F7943A30064F14E /* Imaginary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Imaginary.framework; path = Carthage/Build/iOS/Imaginary.framework; sourceTree = "<group>"; };
|
||||
D2D71BBB1D54DA77006AB907 /* AssetManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssetManager.swift; sourceTree = "<group>"; };
|
||||
D5026B3B1C5BF3FD003BC1A3 /* LightboxImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LightboxImage.swift; sourceTree = "<group>"; };
|
||||
D523B0A91C43AA2A001AD1EC /* Lightbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Lightbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -47,6 +49,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D2A58F5E1F7943A30064F14E /* Imaginary.framework in Frameworks */,
|
||||
D54DFCC21C5AAAF100ADEA0E /* Hue.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -62,6 +65,14 @@
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2A58F5C1F7943A30064F14E /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2A58F5D1F7943A30064F14E /* Imaginary.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D523B09F1C43AA2A001AD1EC = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -70,6 +81,7 @@
|
||||
D523B0B41C43AA8A001AD1EC /* Source */,
|
||||
D523B0AB1C43AA2A001AD1EC /* Lightbox */,
|
||||
D523B0AA1C43AA2A001AD1EC /* Products */,
|
||||
D2A58F5C1F7943A30064F14E /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -146,6 +158,7 @@
|
||||
D523B0A61C43AA2A001AD1EC /* Headers */,
|
||||
D523B0A71C43AA2A001AD1EC /* Resources */,
|
||||
D54DFCC41C5AAAF600ADEA0E /* Copy frameworks with Carthage */,
|
||||
5CF8A88D1F50B4EA00C28475 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -162,12 +175,12 @@
|
||||
D523B0A01C43AA2A001AD1EC /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0800;
|
||||
LastUpgradeCheck = 0900;
|
||||
ORGANIZATIONNAME = "Hyper Interaktiv AS";
|
||||
TargetAttributes = {
|
||||
D523B0A81C43AA2A001AD1EC = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 0900;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -200,6 +213,19 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
5CF8A88D1F50B4EA00C28475 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
|
||||
};
|
||||
D54DFCC41C5AAAF600ADEA0E /* Copy frameworks with Carthage */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -207,6 +233,9 @@
|
||||
);
|
||||
inputPaths = (
|
||||
"$(SRCROOT)/Carthage/Build/iOS/Hue.framework",
|
||||
"$(SRCROOT)/Carthage/Build/iOS/Imaginary.framework",
|
||||
"$(SRCROOT)/Carthage/Build/iOS/Cache.framework",
|
||||
"$(SRCROOT)/Carthage/Build/iOS/SwiftHash.framework",
|
||||
);
|
||||
name = "Copy frameworks with Carthage";
|
||||
outputPaths = (
|
||||
@@ -248,14 +277,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;
|
||||
@@ -279,12 +314,12 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -299,14 +334,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;
|
||||
@@ -324,11 +365,11 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -350,12 +391,11 @@
|
||||
);
|
||||
INFOPLIST_FILE = Lightbox/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.Lightbox;
|
||||
PRODUCT_NAME = Lightbox;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -373,12 +413,11 @@
|
||||
);
|
||||
INFOPLIST_FILE = Lightbox/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.Lightbox;
|
||||
PRODUCT_NAME = Lightbox;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
@@ -36,6 +37,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
# Lightbox
|
||||
|
||||
[](http://cocoadocs.org/docsets/Lightbox)
|
||||
[](https://travis-ci.org/hyperoslo/Lightbox)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](http://cocoadocs.org/docsets/Lightbox)
|
||||
[](http://cocoadocs.org/docsets/Lightbox)
|
||||

|
||||

|
||||
|
||||
[Demo](https://appetize.io/app/wfgwc2uvg82m9pzbt17p4rrgh4?device=iphone5s&scale=75&orientation=portrait&osVersion=9.3)
|
||||
|
||||
<img src="https://raw.githubusercontent.com/hyperoslo/Lightbox/master/Images/Icon.png" alt="Lightbox Icon" align="right" />
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import UIKit
|
||||
|
||||
/// Used to load assets from Lightbox bundle
|
||||
class AssetManager {
|
||||
|
||||
static func image(_ named: String) -> UIImage? {
|
||||
|
||||
@@ -45,7 +45,7 @@ class LightboxTransition: UIPercentDrivenInteractiveTransition {
|
||||
|
||||
// MARK: - Pan gesture recognizer
|
||||
|
||||
func handlePanGesture(_ gesture: UIPanGestureRecognizer) {
|
||||
@objc func handlePanGesture(_ gesture: UIPanGestureRecognizer) {
|
||||
let translation = gesture.translation(in: scrollView)
|
||||
let percentage = abs(translation.y) / UIScreen.main.bounds.height / 1.5
|
||||
let velocity = gesture.velocity(in: scrollView)
|
||||
@@ -111,8 +111,8 @@ extension LightboxTransition: UIViewControllerAnimatedTransitioning {
|
||||
func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
|
||||
let container = transitionContext.containerView
|
||||
|
||||
guard let fromView = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)?.view,
|
||||
let toView = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)?.view
|
||||
guard let fromView = transitionContext.view(forKey: UITransitionContextViewKey.from),
|
||||
let toView = transitionContext.view(forKey: UITransitionContextViewKey.to)
|
||||
else { return }
|
||||
|
||||
let firstView = dismissing ? toView : fromView
|
||||
@@ -123,6 +123,8 @@ extension LightboxTransition: UIViewControllerAnimatedTransitioning {
|
||||
container.addSubview(firstView)
|
||||
container.addSubview(secondView)
|
||||
|
||||
toView.frame = container.bounds
|
||||
|
||||
let duration = transitionDuration(using: transitionContext)
|
||||
|
||||
UIView.animate(withDuration: duration, animations: {
|
||||
@@ -145,8 +147,8 @@ extension LightboxTransition: UIViewControllerTransitioningDelegate {
|
||||
}
|
||||
|
||||
func animationController(forPresented presented: UIViewController,
|
||||
presenting: UIViewController,
|
||||
source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
|
||||
presenting: UIViewController,
|
||||
source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
|
||||
dismissing = false
|
||||
return self
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import UIKit
|
||||
|
||||
extension UIView {
|
||||
|
||||
func addGradientLayer(_ colors: [UIColor]) -> CAGradientLayer {
|
||||
@discardableResult func addGradientLayer(_ colors: [UIColor]) -> CAGradientLayer {
|
||||
if let gradientLayer = gradientLayer { return gradientLayer }
|
||||
|
||||
let gradient = CAGradientLayer()
|
||||
|
||||
+30
-45
@@ -3,28 +3,12 @@ import Hue
|
||||
import AVKit
|
||||
import AVFoundation
|
||||
|
||||
open class LightboxConfig {
|
||||
public class LightboxConfig {
|
||||
/// Whether to show status bar while Lightbox is presented
|
||||
public static var hideStatusBar = true
|
||||
|
||||
public typealias LoadImageCompletion = (_ error: NSError?, _ image: UIImage?) -> Void
|
||||
|
||||
open static var hideStatusBar = true
|
||||
|
||||
open static var loadImage: (_ imageView: UIImageView, _ URL: URL, _ completion: LoadImageCompletion?) -> Void = {
|
||||
imageView, URL, completion in
|
||||
let imageRequest: URLRequest = URLRequest(url: URL)
|
||||
|
||||
NSURLConnection.sendAsynchronousRequest(imageRequest,
|
||||
queue: OperationQueue.main,
|
||||
completionHandler: { response, data, error in
|
||||
if let data = data, let image = UIImage(data: data) {
|
||||
imageView.image = image
|
||||
}
|
||||
|
||||
completion?(error as NSError?, imageView.image)
|
||||
})
|
||||
}
|
||||
|
||||
open static var handleVideo: (_ from: UIViewController, _ videoURL: URL) -> Void = { from, videoURL in
|
||||
/// Provide a closure to handle selected video
|
||||
public static var handleVideo: (_ from: UIViewController, _ videoURL: URL) -> Void = { from, videoURL in
|
||||
let videoController = AVPlayerViewController()
|
||||
videoController.player = AVPlayer(url: videoURL)
|
||||
|
||||
@@ -33,52 +17,57 @@ open class LightboxConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/// Indicator is used to show while image is being fetched
|
||||
public static var makeLoadingIndicator: () -> UIView = {
|
||||
return LoadingIndicator()
|
||||
}
|
||||
|
||||
public struct PageIndicator {
|
||||
public static var enabled = true
|
||||
public static var separatorColor = UIColor(hex: "3D4757")
|
||||
|
||||
public static var textAttributes = [
|
||||
NSFontAttributeName: UIFont.systemFont(ofSize: 12),
|
||||
NSForegroundColorAttributeName: UIColor(hex: "899AB8"),
|
||||
NSParagraphStyleAttributeName: {
|
||||
public static var textAttributes: [NSAttributedStringKey: Any] = [
|
||||
.font: UIFont.systemFont(ofSize: 12),
|
||||
.foregroundColor: UIColor(hex: "899AB8"),
|
||||
.paragraphStyle: {
|
||||
var style = NSMutableParagraphStyle()
|
||||
style.alignment = .center
|
||||
return style
|
||||
}()
|
||||
}()
|
||||
]
|
||||
}
|
||||
|
||||
public struct CloseButton {
|
||||
public static var enabled = true
|
||||
public static var size = CGSize(width: 60, height: 25)
|
||||
public static var size: CGSize?
|
||||
public static var text = NSLocalizedString("Close", comment: "")
|
||||
public static var image: UIImage?
|
||||
|
||||
public static var textAttributes = [
|
||||
NSFontAttributeName: UIFont.boldSystemFont(ofSize: 16),
|
||||
NSForegroundColorAttributeName: UIColor.white,
|
||||
NSParagraphStyleAttributeName: {
|
||||
public static var textAttributes: [NSAttributedStringKey: Any] = [
|
||||
.font: UIFont.boldSystemFont(ofSize: 16),
|
||||
.foregroundColor: UIColor.white,
|
||||
.paragraphStyle: {
|
||||
var style = NSMutableParagraphStyle()
|
||||
style.alignment = .center
|
||||
return style
|
||||
}()
|
||||
}()
|
||||
]
|
||||
}
|
||||
|
||||
public struct DeleteButton {
|
||||
public static var enabled = false
|
||||
public static var size = CGSize(width: 70, height: 25)
|
||||
public static var size: CGSize?
|
||||
public static var text = NSLocalizedString("Delete", comment: "")
|
||||
public static var image: UIImage?
|
||||
|
||||
public static var textAttributes = [
|
||||
NSFontAttributeName: UIFont.boldSystemFont(ofSize: 16),
|
||||
NSForegroundColorAttributeName: UIColor(hex: "FA2F5B"),
|
||||
NSParagraphStyleAttributeName: {
|
||||
public static var textAttributes: [NSAttributedStringKey: Any] = [
|
||||
.font: UIFont.boldSystemFont(ofSize: 16),
|
||||
.foregroundColor: UIColor(hex: "FA2F5B"),
|
||||
.paragraphStyle: {
|
||||
var style = NSMutableParagraphStyle()
|
||||
style.alignment = .center
|
||||
return style
|
||||
}()
|
||||
}()
|
||||
]
|
||||
}
|
||||
|
||||
@@ -88,9 +77,9 @@ open class LightboxConfig {
|
||||
public static var ellipsisText = NSLocalizedString("Show more", comment: "")
|
||||
public static var ellipsisColor = UIColor(hex: "899AB9")
|
||||
|
||||
public static var textAttributes = [
|
||||
NSFontAttributeName: UIFont.systemFont(ofSize: 12),
|
||||
NSForegroundColorAttributeName: UIColor(hex: "DBDBDB")
|
||||
public static var textAttributes: [NSAttributedStringKey: Any] = [
|
||||
.font: UIFont.systemFont(ofSize: 12),
|
||||
.foregroundColor: UIColor(hex: "DBDBDB")
|
||||
]
|
||||
}
|
||||
|
||||
@@ -98,8 +87,4 @@ open class LightboxConfig {
|
||||
public static var minimumScale: CGFloat = 1.0
|
||||
public static var maximumScale: CGFloat = 3.0
|
||||
}
|
||||
|
||||
public struct LoadingIndicator {
|
||||
public static var configure: ((UIActivityIndicatorView) -> Void)? = nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,11 @@ public protocol LightboxControllerDismissalDelegate: class {
|
||||
func lightboxControllerWillDismiss(_ controller: LightboxController)
|
||||
}
|
||||
|
||||
public protocol LightboxControllerTouchDelegate: class {
|
||||
|
||||
func lightboxController(_ controller: LightboxController, didTouch image: LightboxImage, at index: Int)
|
||||
}
|
||||
|
||||
open class LightboxController: UIViewController {
|
||||
|
||||
// MARK: - Internal views
|
||||
@@ -70,14 +75,14 @@ open class LightboxController: UIViewController {
|
||||
let gradient = CAGradientLayer()
|
||||
let colors = [UIColor(hex: "090909").alpha(0), UIColor(hex: "040404")]
|
||||
|
||||
_ = view.addGradientLayer(colors)
|
||||
view.addGradientLayer(colors)
|
||||
view.alpha = 0
|
||||
|
||||
return view
|
||||
}()
|
||||
|
||||
var screenBounds: CGRect {
|
||||
return UIScreen.main.bounds
|
||||
return UIApplication.shared.delegate?.window??.bounds ?? .zero
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -94,7 +99,7 @@ open class LightboxController: UIViewController {
|
||||
|
||||
pageDelegate?.lightboxController(self, didMoveToPage: currentPage)
|
||||
|
||||
if let image = pageViews[currentPage].imageView.image , dynamicBackground {
|
||||
if let image = pageViews[currentPage].imageView.image, dynamicBackground {
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.125) {
|
||||
self.loadDynamicBackground(image)
|
||||
}
|
||||
@@ -137,6 +142,7 @@ open class LightboxController: UIViewController {
|
||||
|
||||
open weak var pageDelegate: LightboxControllerPageDelegate?
|
||||
open weak var dismissalDelegate: LightboxControllerDismissalDelegate?
|
||||
open weak var imageTouchDelegate: LightboxControllerTouchDelegate?
|
||||
open internal(set) var presented = false
|
||||
open fileprivate(set) var seen = false
|
||||
|
||||
@@ -182,23 +188,14 @@ open class LightboxController: UIViewController {
|
||||
|
||||
open override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
if LightboxConfig.hideStatusBar {
|
||||
UIApplication.shared.setStatusBarHidden(true, with: .fade)
|
||||
}
|
||||
|
||||
if !presented {
|
||||
presented = true
|
||||
configureLayout()
|
||||
}
|
||||
}
|
||||
|
||||
open override func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
|
||||
if LightboxConfig.hideStatusBar {
|
||||
UIApplication.shared.setStatusBarHidden(statusBarHidden, with: .fade)
|
||||
}
|
||||
open override var prefersStatusBarHidden: Bool {
|
||||
return LightboxConfig.hideStatusBar
|
||||
}
|
||||
|
||||
// MARK: - Rotation
|
||||
@@ -206,9 +203,9 @@ open class LightboxController: UIViewController {
|
||||
override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
||||
super.viewWillTransition(to: size, with: coordinator)
|
||||
|
||||
coordinator.animate(alongsideTransition: { (UIViewControllerTransitionCoordinatorContext) -> Void in
|
||||
coordinator.animate(alongsideTransition: { _ in
|
||||
self.configureLayout(size)
|
||||
}, completion: nil)
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
// MARK: - Configuration
|
||||
@@ -240,7 +237,9 @@ open class LightboxController: UIViewController {
|
||||
var offset = scrollView.contentOffset
|
||||
offset.x = CGFloat(page) * (scrollView.frame.width + spacing)
|
||||
|
||||
scrollView.setContentOffset(offset, animated: animated)
|
||||
let shouldAnimated = view.window != nil ? animated : false
|
||||
|
||||
scrollView.setContentOffset(offset, animated: shouldAnimated)
|
||||
}
|
||||
|
||||
open func next(_ animated: Bool = true) {
|
||||
@@ -253,13 +252,13 @@ open class LightboxController: UIViewController {
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
func overlayViewDidTap(_ tapGestureRecognizer: UITapGestureRecognizer) {
|
||||
@objc func overlayViewDidTap(_ tapGestureRecognizer: UITapGestureRecognizer) {
|
||||
footerView.expand(false)
|
||||
}
|
||||
|
||||
// MARK: - Layout
|
||||
|
||||
open func configureLayout(_ size: CGSize = UIScreen.main.bounds.size) {
|
||||
open func configureLayout(_ size: CGSize = UIApplication.shared.delegate?.window??.bounds.size ?? .zero) {
|
||||
scrollView.frame.size = size
|
||||
scrollView.contentSize = CGSize(
|
||||
width: size.width * CGFloat(numberOfPages) + spacing * CGFloat(numberOfPages - 1),
|
||||
@@ -341,8 +340,16 @@ extension LightboxController: UIScrollViewDelegate {
|
||||
|
||||
extension LightboxController: PageViewDelegate {
|
||||
|
||||
func remoteImageDidLoad(_ image: UIImage?) {
|
||||
guard let image = image , dynamicBackground else { return }
|
||||
func remoteImageDidLoad(_ image: UIImage?, imageView: UIImageView) {
|
||||
guard let image = image, dynamicBackground else {
|
||||
return
|
||||
}
|
||||
|
||||
let imageViewFrame = imageView.convert(imageView.frame, to: view)
|
||||
guard view.frame.intersects(imageViewFrame) else {
|
||||
return
|
||||
}
|
||||
|
||||
loadDynamicBackground(image)
|
||||
}
|
||||
|
||||
@@ -358,6 +365,8 @@ extension LightboxController: PageViewDelegate {
|
||||
func pageViewDidTouch(_ pageView: PageView) {
|
||||
guard !pageView.hasZoomed else { return }
|
||||
|
||||
imageTouchDelegate?.lightboxController(self, didTouch: images[currentPage], at: currentPage)
|
||||
|
||||
let visible = (headerView.alpha == 1.0)
|
||||
toggleControls(pageView: pageView, visible: !visible)
|
||||
}
|
||||
@@ -412,6 +421,6 @@ extension LightboxController: FooterViewDelegate {
|
||||
UIView.animate(withDuration: 0.25, animations: {
|
||||
self.overlayView.alpha = expanded ? 1.0 : 0.0
|
||||
self.headerView.deleteButton.alpha = expanded ? 0.0 : 1.0
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import UIKit
|
||||
import Imaginary
|
||||
|
||||
open class LightboxImage {
|
||||
|
||||
@@ -15,7 +16,7 @@ open class LightboxImage {
|
||||
self.videoURL = videoURL
|
||||
}
|
||||
|
||||
public init(imageURL: URL, text: String = "", videoURL: URL? = nil ) {
|
||||
public init(imageURL: URL, text: String = "", videoURL: URL? = nil) {
|
||||
self.imageURL = imageURL
|
||||
self.text = text
|
||||
self.videoURL = videoURL
|
||||
@@ -26,9 +27,14 @@ open class LightboxImage {
|
||||
imageView.image = image
|
||||
completion?(image)
|
||||
} else if let imageURL = imageURL {
|
||||
LightboxConfig.loadImage(imageView, imageURL) { error, image in
|
||||
completion?(image)
|
||||
}
|
||||
imageView.setImage(url: imageURL, placeholder: nil, completion: { result in
|
||||
switch result {
|
||||
case .value(let image):
|
||||
completion?(image)
|
||||
case .error:
|
||||
completion?(nil)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ open class FooterView: UIView {
|
||||
|
||||
extension FooterView: LayoutConfigurable {
|
||||
|
||||
public func configureLayout() {
|
||||
@objc public func configureLayout() {
|
||||
infoLabel.frame = CGRect(x: 17, y: 0, width: frame.width - 17 * 2, height: 35)
|
||||
infoLabel.configureLayout()
|
||||
}
|
||||
@@ -108,7 +108,7 @@ extension FooterView: InfoLabelDelegate {
|
||||
|
||||
public func infoLabel(_ infoLabel: InfoLabel, didExpand expanded: Bool) {
|
||||
resetFrames()
|
||||
_ = expanded ? removeGradientLayer() : addGradientLayer(gradientColors)
|
||||
_ = (expanded || infoLabel.fullText.isEmpty) ? removeGradientLayer() : addGradientLayer(gradientColors)
|
||||
delegate?.footerView(self, didExpand: expanded)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,14 @@ open class HeaderView: UIView {
|
||||
|
||||
let button = UIButton(type: .system)
|
||||
|
||||
button.frame.size = LightboxConfig.CloseButton.size
|
||||
button.setAttributedTitle(title, for: UIControlState())
|
||||
|
||||
if let size = LightboxConfig.CloseButton.size {
|
||||
button.frame.size = size
|
||||
} else {
|
||||
button.sizeToFit()
|
||||
}
|
||||
|
||||
button.addTarget(self, action: #selector(closeButtonDidPress(_:)),
|
||||
for: .touchUpInside)
|
||||
|
||||
@@ -41,8 +47,14 @@ open class HeaderView: UIView {
|
||||
|
||||
let button = UIButton(type: .system)
|
||||
|
||||
button.frame.size = LightboxConfig.DeleteButton.size
|
||||
button.setAttributedTitle(title, for: .normal)
|
||||
|
||||
if let size = LightboxConfig.DeleteButton.size {
|
||||
button.frame.size = size
|
||||
} else {
|
||||
button.sizeToFit()
|
||||
}
|
||||
|
||||
button.addTarget(self, action: #selector(deleteButtonDidPress(_:)),
|
||||
for: .touchUpInside)
|
||||
|
||||
@@ -73,11 +85,11 @@ open class HeaderView: UIView {
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
func deleteButtonDidPress(_ button: UIButton) {
|
||||
@objc func deleteButtonDidPress(_ button: UIButton) {
|
||||
delegate?.headerView(self, didPressDeleteButton: button)
|
||||
}
|
||||
|
||||
func closeButtonDidPress(_ button: UIButton) {
|
||||
@objc func closeButtonDidPress(_ button: UIButton) {
|
||||
delegate?.headerView(self, didPressCloseButton: button)
|
||||
}
|
||||
}
|
||||
@@ -86,7 +98,7 @@ open class HeaderView: UIView {
|
||||
|
||||
extension HeaderView: LayoutConfigurable {
|
||||
|
||||
public func configureLayout() {
|
||||
@objc public func configureLayout() {
|
||||
closeButton.frame.origin = CGPoint(
|
||||
x: bounds.width - closeButton.frame.width - 17, y: 0)
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@ open class InfoLabel: UILabel {
|
||||
return truncatedText
|
||||
}
|
||||
|
||||
while numberOfLines(truncatedText) > numberOfVisibleLines * 2 {
|
||||
truncatedText = String(truncatedText.characters.prefix(truncatedText.characters.count / 2))
|
||||
}
|
||||
|
||||
truncatedText += ellipsis
|
||||
|
||||
let start = truncatedText.characters.index(truncatedText.endIndex, offsetBy: -(ellipsis.characters.count + 1))
|
||||
@@ -81,7 +85,7 @@ open class InfoLabel: UILabel {
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
func labelDidTap(_ tapGestureRecognizer: UITapGestureRecognizer) {
|
||||
@objc func labelDidTap(_ tapGestureRecognizer: UITapGestureRecognizer) {
|
||||
shortText = truncatedText
|
||||
expanded ? collapse() : expand()
|
||||
}
|
||||
@@ -106,7 +110,7 @@ open class InfoLabel: UILabel {
|
||||
|
||||
if string.range(of: ellipsis) != nil {
|
||||
let range = (string as NSString).range(of: ellipsis)
|
||||
attributedString.addAttribute(NSForegroundColorAttributeName,
|
||||
attributedString.addAttribute(NSAttributedStringKey.foregroundColor,
|
||||
value: LightboxConfig.InfoLabel.ellipsisColor, range: range)
|
||||
}
|
||||
|
||||
@@ -119,12 +123,12 @@ open class InfoLabel: UILabel {
|
||||
return string.boundingRect(
|
||||
with: CGSize(width: bounds.size.width, height: CGFloat.greatestFiniteMagnitude),
|
||||
options: [.usesLineFragmentOrigin, .usesFontLeading],
|
||||
attributes: [NSFontAttributeName : font],
|
||||
attributes: [NSAttributedStringKey.font: font],
|
||||
context: nil).height
|
||||
}
|
||||
|
||||
fileprivate func numberOfLines(_ string: String) -> Int {
|
||||
let lineHeight = "A".size(attributes: [NSFontAttributeName: font]).height
|
||||
let lineHeight = "A".size(withAttributes: [NSAttributedStringKey.font: font]).height
|
||||
let totalHeight = heightForString(string)
|
||||
|
||||
return Int(totalHeight / lineHeight)
|
||||
@@ -135,7 +139,7 @@ open class InfoLabel: UILabel {
|
||||
|
||||
extension InfoLabel: LayoutConfigurable {
|
||||
|
||||
public func configureLayout() {
|
||||
@objc public func configureLayout() {
|
||||
shortText = truncatedText
|
||||
expanded ? expand() : collapse()
|
||||
}
|
||||
|
||||
+22
-25
@@ -3,7 +3,7 @@ import UIKit
|
||||
protocol PageViewDelegate: class {
|
||||
|
||||
func pageViewDidZoom(_ pageView: PageView)
|
||||
func remoteImageDidLoad(_ image: UIImage?)
|
||||
func remoteImageDidLoad(_ image: UIImage?, imageView: UIImageView)
|
||||
func pageView(_ pageView: PageView, didTouchPlayButton videoURL: URL)
|
||||
func pageViewDidTouch(_ pageView: PageView)
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class PageView: UIScrollView {
|
||||
return button
|
||||
}()
|
||||
|
||||
lazy var activityIndicator: LoadingIndicator = LoadingIndicator()
|
||||
lazy var loadingIndicator: UIView = LightboxConfig.makeLoadingIndicator()
|
||||
|
||||
var image: LightboxImage
|
||||
var contentFrame = CGRect.zero
|
||||
@@ -51,14 +51,18 @@ class PageView: UIScrollView {
|
||||
|
||||
configure()
|
||||
|
||||
activityIndicator.alpha = 1
|
||||
self.image.addImageTo(imageView) { image in
|
||||
self.isUserInteractionEnabled = true
|
||||
self.configureImageView()
|
||||
self.pageViewDelegate?.remoteImageDidLoad(image)
|
||||
loadingIndicator.alpha = 1
|
||||
self.image.addImageTo(imageView) { [weak self] image in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
|
||||
strongSelf.isUserInteractionEnabled = true
|
||||
strongSelf.configureImageView()
|
||||
strongSelf.pageViewDelegate?.remoteImageDidLoad(image, imageView: strongSelf.imageView)
|
||||
|
||||
UIView.animate(withDuration: 0.4) {
|
||||
self.activityIndicator.alpha = 0
|
||||
strongSelf.loadingIndicator.alpha = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,7 +80,7 @@ class PageView: UIScrollView {
|
||||
addSubview(playButton)
|
||||
}
|
||||
|
||||
addSubview(activityIndicator)
|
||||
addSubview(loadingIndicator)
|
||||
|
||||
delegate = self
|
||||
isMultipleTouchEnabled = true
|
||||
@@ -98,7 +102,7 @@ class PageView: UIScrollView {
|
||||
|
||||
// MARK: - Recognizers
|
||||
|
||||
func scrollViewDoubleTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
@objc func scrollViewDoubleTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
let pointInView = recognizer.location(in: imageView)
|
||||
let newZoomScale = zoomScale > minimumZoomScale
|
||||
? minimumZoomScale
|
||||
@@ -114,7 +118,7 @@ class PageView: UIScrollView {
|
||||
zoom(to: rectToZoomTo, animated: true)
|
||||
}
|
||||
|
||||
func viewTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
@objc func viewTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
pageViewDelegate?.pageViewDidTouch(self)
|
||||
}
|
||||
|
||||
@@ -123,12 +127,15 @@ class PageView: UIScrollView {
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
activityIndicator.center = imageView.center
|
||||
loadingIndicator.center = imageView.center
|
||||
playButton.center = imageView.center
|
||||
}
|
||||
|
||||
func configureImageView() {
|
||||
guard let image = imageView.image else { return }
|
||||
guard let image = imageView.image else {
|
||||
centerImageView()
|
||||
return
|
||||
}
|
||||
|
||||
let imageViewSize = imageView.frame.size
|
||||
let imageSize = image.size
|
||||
@@ -170,28 +177,18 @@ class PageView: UIScrollView {
|
||||
|
||||
// MARK: - Action
|
||||
|
||||
func playButtonTouched(_ button: UIButton) {
|
||||
@objc func playButtonTouched(_ button: UIButton) {
|
||||
guard let videoURL = image.videoURL else { return }
|
||||
|
||||
pageViewDelegate?.pageView(self, didTouchPlayButton: videoURL as URL)
|
||||
}
|
||||
|
||||
// MARK: - Controls
|
||||
|
||||
func makeActivityIndicator() -> UIActivityIndicatorView {
|
||||
let view = UIActivityIndicatorView(activityIndicatorStyle: .white)
|
||||
LightboxConfig.LoadingIndicator.configure?(view)
|
||||
view.startAnimating()
|
||||
|
||||
return view
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - LayoutConfigurable
|
||||
|
||||
extension PageView: LayoutConfigurable {
|
||||
|
||||
func configureLayout() {
|
||||
@objc func configureLayout() {
|
||||
contentFrame = frame
|
||||
contentSize = frame.size
|
||||
imageView.frame = frame
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
carthage bootstrap
|
||||
cp Cartfile.resolved Carthage
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! cmp -s Cartfile.resolved Carthage/Cartfile.resolved; then
|
||||
bin/bootstrap
|
||||
fi
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
machine:
|
||||
xcode:
|
||||
version: "9.0"
|
||||
|
||||
dependencies:
|
||||
override:
|
||||
- bin/bootstrap-if-needed
|
||||
cache_directories:
|
||||
- "Carthage"
|
||||
|
||||
test:
|
||||
override:
|
||||
- set -o pipefail && xcodebuild -project Lightbox.xcodeproj -scheme "Lightbox-iOS" -sdk iphonesimulator clean build
|
||||
Reference in New Issue
Block a user