Compare commits
163 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cac1cf4b2 | |||
| 918918649c | |||
| e36c794651 | |||
| 1f42c0229c | |||
| 6f0ead5af5 | |||
| 4a70c08f37 | |||
| 7830a7512a | |||
| 2bb85661b1 | |||
| dbffe4f688 | |||
| ed69a9fdee | |||
| 6344062be2 | |||
| 8dcf50b722 | |||
| 3c145a392b | |||
| 25e4877614 | |||
| 18743a36a5 | |||
| 8e254accd6 | |||
| d3e8d79d27 | |||
| e3b2df4363 | |||
| c25bbf4671 | |||
| c0e7c31844 | |||
| e43ba2b58f | |||
| 6d92df2dad | |||
| 5b85a492a6 | |||
| 774947dea5 | |||
| 21d6b335fc | |||
| b45f490bec | |||
| b37e139060 | |||
| 1e3636cebf | |||
| 54bb598dd8 | |||
| 1aa9643feb | |||
| 1bccfe2cc1 | |||
| 1b16b2bb74 | |||
| 32c45514c8 | |||
| e73f58ced5 | |||
| 54b73d3cc0 | |||
| 8fc34e8d12 | |||
| 6af9321ea9 | |||
| 1584281c41 | |||
| 5ac3f8ae18 | |||
| 5d93293649 | |||
| a4f113d066 | |||
| 41436d8083 | |||
| 22785514bd | |||
| d8f6836c0f | |||
| 20ea9e3e1c | |||
| 64dee3b6bc | |||
| 911d0c5df8 | |||
| cc85786658 | |||
| 3b695da3ee | |||
| 5a73ca4c6b | |||
| 90d31b75ca | |||
| 9d6d6e3798 | |||
| 81e13530aa | |||
| f11af83808 | |||
| 162f6d29c3 | |||
| cb97450102 | |||
| 9de5f16735 | |||
| 418da11c82 | |||
| 90fe59ffc6 | |||
| 422b23b4c2 | |||
| 08a4c284f4 | |||
| b775f12fe5 | |||
| 9f75ddffdf | |||
| 225fac033a | |||
| fe3229278d | |||
| de0d273258 | |||
| d1231f19ff | |||
| 20f927f338 | |||
| 8144d96129 | |||
| 0d9e3ef7ab | |||
| 888067cae0 | |||
| 0180ca76c7 | |||
| 951b95b0fb | |||
| 1803722b6a | |||
| 4f5ee72f97 | |||
| 9e17ebb58f | |||
| 28acb5a8d6 | |||
| 5c6fa430e0 | |||
| 5108f3651f | |||
| 05ec840ffd | |||
| 5189d880c4 | |||
| 308051a898 | |||
| 56481d5f8a | |||
| 3882befd7b | |||
| cf88115eb6 | |||
| 663bafce52 | |||
| 6911104a98 | |||
| 369252ee7c | |||
| 3322107688 | |||
| 7731adc79c | |||
| 5c48b2482a | |||
| 83416d6870 | |||
| 4f9540b4df | |||
| 304c3e61f6 | |||
| 026153f502 | |||
| 6e53ee01c7 | |||
| 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
|
||||
@@ -41,4 +41,7 @@ variable_name:
|
||||
- id
|
||||
- URL
|
||||
- GlobalAPIKey
|
||||
- i
|
||||
- lb
|
||||
- rb
|
||||
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle)
|
||||
|
||||
@@ -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/Imaginary" ~> 5.0.0
|
||||
github "hyperoslo/Cache" ~> 6.0.0
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
github "hyperoslo/Hue" "f82ffc7dd55d093d3acc6ce5b3d36ca259091fdd"
|
||||
github "hyperoslo/Cache" "6.0.0"
|
||||
github "hyperoslo/Imaginary" "5.0.0"
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
opt_in_rules: # some rules are only opt-in
|
||||
- empty_count
|
||||
# Find all the available rules by running:
|
||||
# swiftlint rules
|
||||
included: # paths to include during linting. `--path` is ignored if present.
|
||||
- ../../Source
|
||||
excluded: # paths to ignore during linting. Takes precedence over `included`.
|
||||
- Carthage
|
||||
- Pods
|
||||
|
||||
# configurable rules can be customized from this configuration file
|
||||
# binary rules can set their severity level
|
||||
force_cast: warning # implicitly
|
||||
force_try:
|
||||
severity: warning # explicitly
|
||||
# rules that have both warning and error levels, can set just the warning level
|
||||
# implicitly
|
||||
line_length: 200
|
||||
# they can set both implicitly with an array
|
||||
type_body_length:
|
||||
- 300 # warning
|
||||
- 400 # error
|
||||
# or they can set both explicitly
|
||||
file_length:
|
||||
warning: 500
|
||||
error: 1200
|
||||
# naming rules can set warnings/errors for min_length and max_length
|
||||
# additionally they can set excluded names
|
||||
type_name:
|
||||
min_length: 3 # only warning
|
||||
max_length: # warning and error
|
||||
warning: 40
|
||||
error: 50
|
||||
excluded: iPhone # excluded via string
|
||||
variable_name:
|
||||
min_length: # only min_length
|
||||
error: 2 # only error
|
||||
excluded: # excluded via string array
|
||||
- x
|
||||
- y
|
||||
- id
|
||||
- URL
|
||||
- GlobalAPIKey
|
||||
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle)
|
||||
@@ -1,374 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
29B4A42D1C43A4320060ED52 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B4A42C1C43A4320060ED52 /* AppDelegate.swift */; };
|
||||
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 */; };
|
||||
/* 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; };
|
||||
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>"; };
|
||||
DAE713340DA5D2F2EF13EA8D /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
29B4A4261C43A4320060ED52 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7193005DD460E198432D8F06 /* Pods_DemoLightbox.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
29B4A4201C43A4320060ED52 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B4A42B1C43A4320060ED52 /* DemoLightbox */,
|
||||
29B4A42A1C43A4320060ED52 /* Products */,
|
||||
B1B2B3DADEEC7FD14D4A9FF8 /* Frameworks */,
|
||||
80F119CA8153119A6934480D /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B4A42A1C43A4320060ED52 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B4A4291C43A4320060ED52 /* DemoLightbox.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B4A42B1C43A4320060ED52 /* DemoLightbox */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B4A42C1C43A4320060ED52 /* AppDelegate.swift */,
|
||||
29B4A42E1C43A4320060ED52 /* ViewController.swift */,
|
||||
29B4A4331C43A4320060ED52 /* Assets.xcassets */,
|
||||
29B4A4351C43A4320060ED52 /* LaunchScreen.storyboard */,
|
||||
29B4A4381C43A4320060ED52 /* Info.plist */,
|
||||
);
|
||||
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 */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
29B4A4281C43A4320060ED52 /* DemoLightbox */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 29B4A43B1C43A4320060ED52 /* Build configuration list for PBXNativeTarget "DemoLightbox" */;
|
||||
buildPhases = (
|
||||
2CF277B8821F7CE6E2730C9C /* [CP] Check Pods Manifest.lock */,
|
||||
29B4A4251C43A4320060ED52 /* Sources */,
|
||||
29B4A4261C43A4320060ED52 /* Frameworks */,
|
||||
29B4A4271C43A4320060ED52 /* Resources */,
|
||||
831C9CD301B03A92F6320AEE /* [CP] Embed Pods Frameworks */,
|
||||
3BCDC27EE322C46C109D231B /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = DemoLightbox;
|
||||
productName = DemoLightbox;
|
||||
productReference = 29B4A4291C43A4320060ED52 /* DemoLightbox.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
29B4A4211C43A4320060ED52 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0720;
|
||||
LastUpgradeCheck = 0800;
|
||||
ORGANIZATIONNAME = "Hyper Interaktiv AS";
|
||||
TargetAttributes = {
|
||||
29B4A4281C43A4320060ED52 = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
DevelopmentTeam = LG4DBY4QF9;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 29B4A4241C43A4320060ED52 /* Build configuration list for PBXProject "DemoLightbox" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 29B4A4201C43A4320060ED52;
|
||||
productRefGroup = 29B4A42A1C43A4320060ED52 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
29B4A4281C43A4320060ED52 /* DemoLightbox */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
29B4A4271C43A4320060ED52 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
29B4A4371C43A4320060ED52 /* LaunchScreen.storyboard in Resources */,
|
||||
29B4A4341C43A4320060ED52 /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
2CF277B8821F7CE6E2730C9C /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
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";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3BCDC27EE322C46C109D231B /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
831C9CD301B03A92F6320AEE /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
29B4A4251C43A4320060ED52 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
29B4A42F1C43A4320060ED52 /* ViewController.swift in Sources */,
|
||||
29B4A42D1C43A4320060ED52 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
29B4A4351C43A4320060ED52 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
29B4A4361C43A4320060ED52 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
29B4A4391C43A4320060ED52 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = 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_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
29B4A43A1C43A4320060ED52 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = 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_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
29B4A43C1C43A4320060ED52 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C37FDBF69CDC2A95E0E105A7 /* Pods-DemoLightbox.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
DEVELOPMENT_TEAM = LG4DBY4QF9;
|
||||
INFOPLIST_FILE = DemoLightbox/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.DemoLightbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
29B4A43D1C43A4320060ED52 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 5B9CE7F93A06A0459BF452D8 /* Pods-DemoLightbox.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
DEVELOPMENT_TEAM = LG4DBY4QF9;
|
||||
INFOPLIST_FILE = DemoLightbox/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.DemoLightbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
29B4A4241C43A4320060ED52 /* Build configuration list for PBXProject "DemoLightbox" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
29B4A4391C43A4320060ED52 /* Debug */,
|
||||
29B4A43A1C43A4320060ED52 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
29B4A43B1C43A4320060ED52 /* Build configuration list for PBXNativeTarget "DemoLightbox" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
29B4A43C1C43A4320060ED52 /* Debug */,
|
||||
29B4A43D1C43A4320060ED52 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B4A4211C43A4320060ED52 /* Project object */;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:DemoLightbox.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:DemoLightbox.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,18 +0,0 @@
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
lazy var controller: UIViewController = ViewController()
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
window = UIWindow()
|
||||
window?.rootViewController = controller
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import UIKit
|
||||
import Lightbox
|
||||
|
||||
class ViewController: UIViewController {
|
||||
|
||||
lazy var showButton: UIButton = { [unowned self] in
|
||||
let button = UIButton()
|
||||
button.addTarget(self, action: #selector(showLightbox), for: .touchUpInside)
|
||||
button.setTitle("Show me the lightbox", for: UIControlState())
|
||||
button.setTitleColor(UIColor(red:0.47, green:0.6, blue:0.13, alpha:1), for: UIControlState())
|
||||
button.titleLabel?.font = UIFont(name: "AvenirNextCondensed-DemiBold", size: 30)
|
||||
button.frame = UIScreen.main.bounds
|
||||
button.autoresizingMask = [.flexibleTopMargin, .flexibleLeftMargin, .flexibleRightMargin, .flexibleBottomMargin]
|
||||
|
||||
return button
|
||||
}()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
view.autoresizingMask = [.flexibleTopMargin, .flexibleLeftMargin, .flexibleRightMargin, .flexibleBottomMargin]
|
||||
view.backgroundColor = UIColor.white
|
||||
view.addSubview(showButton)
|
||||
}
|
||||
|
||||
// MARK: - Action methods
|
||||
|
||||
func showLightbox() {
|
||||
let images = [
|
||||
LightboxImage(imageURL: URL(string: "https://cdn.arstechnica.net/2011/10/05/iphone4s_sample_apple-4e8c706-intro.jpg")!),
|
||||
LightboxImage(
|
||||
image: UIImage(named: "photo1")!,
|
||||
text: "Some very long lorem ipsum text. Some very long lorem ipsum text. Some very long lorem ipsum text. Some very long lorem ipsum text"
|
||||
),
|
||||
LightboxImage(
|
||||
image: UIImage(named: "photo2")!,
|
||||
text: "",
|
||||
videoURL: URL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
|
||||
),
|
||||
LightboxImage(
|
||||
image: UIImage(named: "photo3")!,
|
||||
text: "Some very long lorem ipsum text."
|
||||
)
|
||||
]
|
||||
|
||||
let controller = LightboxController(images: images)
|
||||
controller.dynamicBackground = true
|
||||
|
||||
present(controller, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
platform :ios, '8.0'
|
||||
|
||||
use_frameworks!
|
||||
inhibit_all_warnings!
|
||||
|
||||
pod 'Lightbox', path: '../../'
|
||||
target 'DemoLightbox'
|
||||
@@ -1,19 +0,0 @@
|
||||
PODS:
|
||||
- Hue (2.0.1)
|
||||
- Lightbox (1.0.0):
|
||||
- Hue
|
||||
|
||||
DEPENDENCIES:
|
||||
- Lightbox (from `../../`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
Lightbox:
|
||||
:path: "../../"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Hue: 354caec055fdc9d38b5ef33ca2e7224721843baf
|
||||
Lightbox: eb4196a846a883c4c2a52209b29b283d1bc706e1
|
||||
|
||||
PODFILE CHECKSUM: cd88b68c201e5c39cef62070056649eaee91c71b
|
||||
|
||||
COCOAPODS: 1.1.1
|
||||
|
After Width: | Height: | Size: 290 KiB |
|
After Width: | Height: | Size: 296 KiB |
@@ -1,19 +1,19 @@
|
||||
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.5.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, '11.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 'Imaginary', '~> 5.0.0'
|
||||
s.swift_version = '5.0'
|
||||
|
||||
end
|
||||
|
||||
@@ -7,14 +7,24 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
166E3BA920333E04006799C1 /* LightboxImageStub.swift in Sources */ = {isa = PBXBuildFile; fileRef = 166E3BA820333E04006799C1 /* LightboxImageStub.swift */; };
|
||||
44E6A64A2495BFAB00543CF0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44E6A6492495BFAB00543CF0 /* AppDelegate.swift */; };
|
||||
44E6A6532495BFAC00543CF0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 44E6A6522495BFAC00543CF0 /* Assets.xcassets */; };
|
||||
44E6A6562495BFAC00543CF0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 44E6A6542495BFAC00543CF0 /* LaunchScreen.storyboard */; };
|
||||
44E6A65C2495BFD400543CF0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44E6A65B2495BFD400543CF0 /* ViewController.swift */; };
|
||||
44E6A6652495C0EB00543CF0 /* Lightbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D523B0A91C43AA2A001AD1EC /* Lightbox.framework */; };
|
||||
44E6A6662495C0EB00543CF0 /* Lightbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D523B0A91C43AA2A001AD1EC /* Lightbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
44E6A66A2495C13F00543CF0 /* Imaginary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2A58F5D1F7943A30064F14E /* Imaginary.framework */; };
|
||||
44E6A66B2495C13F00543CF0 /* Imaginary.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D2A58F5D1F7943A30064F14E /* Imaginary.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D22006741DFB4D9700E92898 /* Lightbox.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D22006731DFB4D9700E92898 /* Lightbox.bundle */; };
|
||||
D2258CC4215CD035005A9A1C /* Color+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2258CC3215CD035005A9A1C /* Color+Extensions.swift */; };
|
||||
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 */; };
|
||||
D523B0BE1C43AA8B001AD1EC /* LightboxController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D523B0B71C43AA8A001AD1EC /* LightboxController.swift */; };
|
||||
D54DFCBE1C5AAAD600ADEA0E /* InfoLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D54DFCBC1C5AAAD600ADEA0E /* InfoLabel.swift */; };
|
||||
D54DFCBF1C5AAAD600ADEA0E /* PageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D54DFCBD1C5AAAD600ADEA0E /* PageView.swift */; };
|
||||
D54DFCC21C5AAAF100ADEA0E /* Hue.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D54DFCC01C5AAAF100ADEA0E /* Hue.framework */; };
|
||||
D56F15C81E0AB79800F128AF /* LoadingIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D56F15C71E0AB79800F128AF /* LoadingIndicator.swift */; };
|
||||
D573A2F01C5B5605006053DD /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D573A2EF1C5B5605006053DD /* HeaderView.swift */; };
|
||||
D573A2F31C5B5C7B006053DD /* LayoutConfigurable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D573A2F21C5B5C7B006053DD /* LayoutConfigurable.swift */; };
|
||||
@@ -23,8 +33,42 @@
|
||||
D58A18CB1C5ABF8F000024BB /* FooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58A18CA1C5ABF8F000024BB /* FooterView.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
44E6A6672495C0EB00543CF0 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = D523B0A01C43AA2A001AD1EC /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = D523B0A81C43AA2A001AD1EC;
|
||||
remoteInfo = "Lightbox-iOS";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
44E6A6692495C0EB00543CF0 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
44E6A66B2495C13F00543CF0 /* Imaginary.framework in Embed Frameworks */,
|
||||
44E6A6662495C0EB00543CF0 /* Lightbox.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
166E3BA820333E04006799C1 /* LightboxImageStub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightboxImageStub.swift; sourceTree = "<group>"; };
|
||||
44E6A6472495BFAB00543CF0 /* iOSDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
44E6A6492495BFAB00543CF0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
44E6A6522495BFAC00543CF0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
44E6A6552495BFAC00543CF0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
44E6A6572495BFAC00543CF0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
44E6A65B2495BFD400543CF0 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
D22006731DFB4D9700E92898 /* Lightbox.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Lightbox.bundle; sourceTree = "<group>"; };
|
||||
D2258CC3215CD035005A9A1C /* Color+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extensions.swift"; 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; };
|
||||
@@ -33,7 +77,6 @@
|
||||
D523B0B71C43AA8A001AD1EC /* LightboxController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LightboxController.swift; sourceTree = "<group>"; };
|
||||
D54DFCBC1C5AAAD600ADEA0E /* InfoLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InfoLabel.swift; sourceTree = "<group>"; };
|
||||
D54DFCBD1C5AAAD600ADEA0E /* PageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageView.swift; sourceTree = "<group>"; };
|
||||
D54DFCC01C5AAAF100ADEA0E /* Hue.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Hue.framework; path = Carthage/Build/iOS/Hue.framework; sourceTree = "<group>"; };
|
||||
D56F15C71E0AB79800F128AF /* LoadingIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadingIndicator.swift; sourceTree = "<group>"; };
|
||||
D573A2EF1C5B5605006053DD /* HeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = "<group>"; };
|
||||
D573A2F21C5B5C7B006053DD /* LayoutConfigurable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutConfigurable.swift; sourceTree = "<group>"; };
|
||||
@@ -43,17 +86,38 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
44E6A6442495BFAB00543CF0 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
44E6A66A2495C13F00543CF0 /* Imaginary.framework in Frameworks */,
|
||||
44E6A6652495C0EB00543CF0 /* Lightbox.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D523B0A51C43AA2A001AD1EC /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D54DFCC21C5AAAF100ADEA0E /* Hue.framework in Frameworks */,
|
||||
D2A58F5E1F7943A30064F14E /* Imaginary.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
44E6A6482495BFAB00543CF0 /* iOSDemo */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
44E6A6492495BFAB00543CF0 /* AppDelegate.swift */,
|
||||
44E6A65B2495BFD400543CF0 /* ViewController.swift */,
|
||||
44E6A6522495BFAC00543CF0 /* Assets.xcassets */,
|
||||
44E6A6542495BFAC00543CF0 /* LaunchScreen.storyboard */,
|
||||
44E6A6572495BFAC00543CF0 /* Info.plist */,
|
||||
);
|
||||
path = iOSDemo;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D22006721DFB4D9700E92898 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -62,21 +126,33 @@
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2A58F5C1F7943A30064F14E /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2A58F5D1F7943A30064F14E /* Imaginary.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D523B09F1C43AA2A001AD1EC = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D22006721DFB4D9700E92898 /* Resources */,
|
||||
D54DFCC01C5AAAF100ADEA0E /* Hue.framework */,
|
||||
D523B0B41C43AA8A001AD1EC /* Source */,
|
||||
D523B0AB1C43AA2A001AD1EC /* Lightbox */,
|
||||
44E6A6482495BFAB00543CF0 /* iOSDemo */,
|
||||
D523B0AA1C43AA2A001AD1EC /* Products */,
|
||||
D2A58F5C1F7943A30064F14E /* Frameworks */,
|
||||
);
|
||||
indentWidth = 4;
|
||||
sourceTree = "<group>";
|
||||
tabWidth = 4;
|
||||
};
|
||||
D523B0AA1C43AA2A001AD1EC /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D523B0A91C43AA2A001AD1EC /* Lightbox.framework */,
|
||||
44E6A6472495BFAB00543CF0 /* iOSDemo.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -97,6 +173,7 @@
|
||||
D523B0B61C43AA8A001AD1EC /* LightboxConfig.swift */,
|
||||
D523B0B71C43AA8A001AD1EC /* LightboxController.swift */,
|
||||
D5026B3B1C5BF3FD003BC1A3 /* LightboxImage.swift */,
|
||||
166E3BA820333E04006799C1 /* LightboxImageStub.swift */,
|
||||
D2D71BBB1D54DA77006AB907 /* AssetManager.swift */,
|
||||
);
|
||||
path = Source;
|
||||
@@ -120,6 +197,7 @@
|
||||
D573A2F41C5B5CA4006053DD /* LightboxTransition.swift */,
|
||||
D573A2F21C5B5C7B006053DD /* LayoutConfigurable.swift */,
|
||||
D573A2F61C5B5E55006053DD /* UIView+Gradient.swift */,
|
||||
D2258CC3215CD035005A9A1C /* Color+Extensions.swift */,
|
||||
);
|
||||
path = Library;
|
||||
sourceTree = "<group>";
|
||||
@@ -137,6 +215,25 @@
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
44E6A6462495BFAB00543CF0 /* iOSDemo */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 44E6A6582495BFAC00543CF0 /* Build configuration list for PBXNativeTarget "iOSDemo" */;
|
||||
buildPhases = (
|
||||
44E6A6432495BFAB00543CF0 /* Sources */,
|
||||
44E6A6442495BFAB00543CF0 /* Frameworks */,
|
||||
44E6A6452495BFAB00543CF0 /* Resources */,
|
||||
44E6A6692495C0EB00543CF0 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
44E6A6682495C0EB00543CF0 /* PBXTargetDependency */,
|
||||
);
|
||||
name = iOSDemo;
|
||||
productName = iOSDemo;
|
||||
productReference = 44E6A6472495BFAB00543CF0 /* iOSDemo.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
D523B0A81C43AA2A001AD1EC /* Lightbox-iOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = D523B0B11C43AA2A001AD1EC /* Build configuration list for PBXNativeTarget "Lightbox-iOS" */;
|
||||
@@ -145,7 +242,6 @@
|
||||
D523B0A51C43AA2A001AD1EC /* Frameworks */,
|
||||
D523B0A61C43AA2A001AD1EC /* Headers */,
|
||||
D523B0A71C43AA2A001AD1EC /* Resources */,
|
||||
D54DFCC41C5AAAF600ADEA0E /* Copy frameworks with Carthage */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -162,21 +258,27 @@
|
||||
D523B0A01C43AA2A001AD1EC /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0800;
|
||||
LastSwiftUpdateCheck = 1150;
|
||||
LastUpgradeCheck = 1200;
|
||||
ORGANIZATIONNAME = "Hyper Interaktiv AS";
|
||||
TargetAttributes = {
|
||||
44E6A6462495BFAB00543CF0 = {
|
||||
CreatedOnToolsVersion = 11.5;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
D523B0A81C43AA2A001AD1EC = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 1150;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = D523B0A31C43AA2A001AD1EC /* Build configuration list for PBXProject "Lightbox" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = D523B09F1C43AA2A001AD1EC;
|
||||
productRefGroup = D523B0AA1C43AA2A001AD1EC /* Products */;
|
||||
@@ -184,11 +286,21 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
D523B0A81C43AA2A001AD1EC /* Lightbox-iOS */,
|
||||
44E6A6462495BFAB00543CF0 /* iOSDemo */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
44E6A6452495BFAB00543CF0 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
44E6A6562495BFAC00543CF0 /* LaunchScreen.storyboard in Resources */,
|
||||
44E6A6532495BFAC00543CF0 /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D523B0A71C43AA2A001AD1EC /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -199,25 +311,16 @@
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
D54DFCC41C5AAAF600ADEA0E /* Copy frameworks with Carthage */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
44E6A6432495BFAB00543CF0 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"$(SRCROOT)/Carthage/Build/iOS/Hue.framework",
|
||||
);
|
||||
name = "Copy frameworks with Carthage";
|
||||
outputPaths = (
|
||||
44E6A65C2495BFD400543CF0 /* ViewController.swift in Sources */,
|
||||
44E6A64A2495BFAB00543CF0 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/usr/local/bin/carthage copy-frameworks";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
D523B0A41C43AA2A001AD1EC /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -233,29 +336,116 @@
|
||||
D58A18CB1C5ABF8F000024BB /* FooterView.swift in Sources */,
|
||||
D573A2F01C5B5605006053DD /* HeaderView.swift in Sources */,
|
||||
D573A2F51C5B5CA4006053DD /* LightboxTransition.swift in Sources */,
|
||||
D2258CC4215CD035005A9A1C /* Color+Extensions.swift in Sources */,
|
||||
166E3BA920333E04006799C1 /* LightboxImageStub.swift in Sources */,
|
||||
D2D71BBC1D54DA77006AB907 /* AssetManager.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
44E6A6682495C0EB00543CF0 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = D523B0A81C43AA2A001AD1EC /* Lightbox-iOS */;
|
||||
targetProxy = 44E6A6672495C0EB00543CF0 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
44E6A6542495BFAC00543CF0 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
44E6A6552495BFAC00543CF0 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
44E6A6592495BFAC00543CF0 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = iOSDemo/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.elvisnunez.iOSDemo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
44E6A65A2495BFAC00543CF0 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = iOSDemo/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.elvisnunez.iOSDemo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
D523B0AF1C43AA2A001AD1EC /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
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 +469,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 = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -295,18 +485,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
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 +524,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 = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -350,12 +550,14 @@
|
||||
);
|
||||
INFOPLIST_FILE = Lightbox/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.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;
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -373,18 +575,29 @@
|
||||
);
|
||||
INFOPLIST_FILE = Lightbox/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.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;
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
44E6A6582495BFAC00543CF0 /* Build configuration list for PBXNativeTarget "iOSDemo" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
44E6A6592495BFAC00543CF0 /* Debug */,
|
||||
44E6A65A2495BFAC00543CF0 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
D523B0A31C43AA2A001AD1EC /* Build configuration list for PBXProject "Lightbox" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "1200"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -27,10 +27,29 @@
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D523B0A81C43AA2A001AD1EC"
|
||||
BuildableName = "Lightbox.framework"
|
||||
BlueprintName = "Lightbox-iOS"
|
||||
ReferencedContainer = "container:Lightbox.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO"
|
||||
parallelizable = "YES"
|
||||
testExecutionOrdering = "random">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D229B5E01FC3123F00F04123"
|
||||
BuildableName = "Lightbox-iOS-Tests.xctest"
|
||||
BlueprintName = "Lightbox-iOS-Tests"
|
||||
ReferencedContainer = "container:Lightbox.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -51,8 +70,6 @@
|
||||
ReferencedContainer = "container:Lightbox.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// swift-tools-version:5.1
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Lightbox",
|
||||
products: [
|
||||
.library(
|
||||
name: "Lightbox",
|
||||
targets: ["Lightbox"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/hyperoslo/Imaginary", .branch("master"))
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "Lightbox",
|
||||
dependencies: ["Imaginary"],
|
||||
path: "Source"
|
||||
)
|
||||
],
|
||||
swiftLanguageVersions: [.v5]
|
||||
)
|
||||
@@ -1,11 +1,10 @@
|
||||
# Lightbox
|
||||
|
||||
[](http://cocoadocs.org/docsets/Lightbox)
|
||||
[](https://travis-ci.org/hyperoslo/Lightbox)
|
||||
[](https://circleci.com/gh/hyperoslo/Lightbox)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](http://cocoadocs.org/docsets/Lightbox)
|
||||
[](http://cocoadocs.org/docsets/Lightbox)
|
||||

|
||||

|
||||
|
||||
<img src="https://raw.githubusercontent.com/hyperoslo/Lightbox/master/Images/Icon.png" alt="Lightbox Icon" align="right" />
|
||||
|
||||
@@ -16,10 +15,16 @@ packed with all the features you expect:
|
||||
- [x] Video support.
|
||||
- [x] Double-tap to zoom.
|
||||
- [x] Image caption.
|
||||
- [x] Dynamic background.
|
||||
- [x] Dynamic background based on [Hue](https://github.com/hyperoslo/Hue)
|
||||
- [x] Remote image loading and caching based on [Imaginary](https://github.com/hyperoslo/Imaginary)
|
||||
- [x] Interactive transition animations.
|
||||
- [x] Powerful configuration.
|
||||
- [x] Demo project.
|
||||
- [x] [Live Demo](https://appetize.io/app/wfgwc2uvg82m9pzbt17p4rrgh4?device=iphone5s&scale=75&orientation=portrait&osVersion=9.3)
|
||||
|
||||
<div align="center">
|
||||
<img src="Images/demo.png" height="500">
|
||||
<img src="Images/demo2.png" height="500">
|
||||
</div>
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@@ -105,9 +110,7 @@ extension ViewController: LightboxControllerDismissalDelegate: class {
|
||||
|
||||
### Image loading
|
||||
|
||||
By default images are loaded using `sendAsynchronousRequest` method of
|
||||
`NSURLConnection`. But it's easy to change this behavior using **Lightbox**
|
||||
configuration.
|
||||
By default images are loaded using [Imaginary](https://github.com/hyperoslo/Imaginary) for reliable loading and caching. But it's easy to change this behavior using **LightboxConfig**
|
||||
|
||||
```swift
|
||||
LightboxConfig.loadImage = {
|
||||
@@ -118,7 +121,7 @@ LightboxConfig.loadImage = {
|
||||
|
||||
### Video
|
||||
|
||||
**Lightbox** has video support out of the box. Configure video by using `videoURL`:
|
||||
**Lightbox** can show and plays video using default `AVPlayerViewController`. Showning video by using `videoURL`:
|
||||
|
||||
```swift
|
||||
LightboxImage(
|
||||
@@ -156,7 +159,7 @@ LightboxConfig.DeleteButton.image = UIImage(named: ImageList.Lightbox.deleteButt
|
||||
LightboxConfig.DeleteButton.textAttributes = TextAttributes.Lightbox.deleteButton
|
||||
LightboxConfig.DeleteButton.text = "Delete"
|
||||
|
||||
LightboxConfig.InfoLabel.ellipsisText = "ShowMore"
|
||||
LightboxConfig.InfoLabel.ellipsisText = "Show more"
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import UIKit
|
||||
|
||||
/// Used to load assets from Lightbox bundle
|
||||
class AssetManager {
|
||||
|
||||
static func image(_ named: String) -> UIImage? {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import UIKit
|
||||
|
||||
internal extension UIColor {
|
||||
/// Constructing color from hex string
|
||||
///
|
||||
/// - Parameter hex: A hex string, can either contain # or not
|
||||
convenience init(hex string: String) {
|
||||
var hex = string.hasPrefix("#")
|
||||
? String(string.dropFirst())
|
||||
: string
|
||||
guard hex.count == 3 || hex.count == 6
|
||||
else {
|
||||
self.init(white: 1.0, alpha: 0.0)
|
||||
return
|
||||
}
|
||||
if hex.count == 3 {
|
||||
for (index, char) in hex.enumerated() {
|
||||
hex.insert(char, at: hex.index(hex.startIndex, offsetBy: index * 2))
|
||||
}
|
||||
}
|
||||
|
||||
self.init(
|
||||
red: CGFloat((Int(hex, radix: 16)! >> 16) & 0xFF) / 255.0,
|
||||
green: CGFloat((Int(hex, radix: 16)! >> 8) & 0xFF) / 255.0,
|
||||
blue: CGFloat((Int(hex, radix: 16)!) & 0xFF) / 255.0, alpha: 1.0)
|
||||
}
|
||||
}
|
||||
@@ -28,14 +28,6 @@ class LightboxTransition: UIPercentDrivenInteractiveTransition {
|
||||
func transition(_ show: Bool) {
|
||||
guard let controller = lightboxController else { return }
|
||||
|
||||
controller.headerView.transform = show
|
||||
? CGAffineTransform.identity
|
||||
: CGAffineTransform(translationX: 0, y: -200)
|
||||
|
||||
controller.footerView.transform = show
|
||||
? CGAffineTransform.identity
|
||||
: CGAffineTransform(translationX: 0, y: 250)
|
||||
|
||||
if interactive {
|
||||
controller.view.backgroundColor = UIColor.black.withAlphaComponent(show ? 1 : 0)
|
||||
} else {
|
||||
@@ -45,7 +37,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 +103,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 +115,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 +139,8 @@ extension LightboxTransition: UIViewControllerTransitioningDelegate {
|
||||
}
|
||||
|
||||
func animationController(forPresented presented: UIViewController,
|
||||
presenting: UIViewController,
|
||||
source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
|
||||
presenting: UIViewController,
|
||||
source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
|
||||
dismissing = false
|
||||
return self
|
||||
}
|
||||
@@ -169,7 +163,7 @@ extension LightboxTransition: UIGestureRecognizerDelegate {
|
||||
|
||||
if let panGestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer {
|
||||
let translation = panGestureRecognizer.translation(in: gestureRecognizer.view)
|
||||
if fabs(translation.x) < fabs(translation.y) {
|
||||
if abs(translation.x) < abs(translation.y) {
|
||||
result = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,30 +1,14 @@
|
||||
import UIKit
|
||||
import Hue
|
||||
import AVKit
|
||||
import AVFoundation
|
||||
import Imaginary
|
||||
|
||||
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,76 @@ open class LightboxConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/// How to load image onto UIImageView
|
||||
public static var loadImage: (UIImageView, URL, ((UIImage?) -> Void)?) -> Void = { (imageView, imageURL, completion) in
|
||||
|
||||
// Use Imaginary by default
|
||||
imageView.setImage(url: imageURL, placeholder: nil, completion: { result in
|
||||
switch result {
|
||||
case .value(let image):
|
||||
completion?(image)
|
||||
case .error:
|
||||
completion?(nil)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Indicator is used to show while image is being fetched
|
||||
public static var makeLoadingIndicator: () -> UIView = {
|
||||
return LoadingIndicator()
|
||||
}
|
||||
|
||||
/// Number of images to preload.
|
||||
///
|
||||
/// 0 - Preload all images (default).
|
||||
public static var preload = 0
|
||||
|
||||
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: [NSAttributedString.Key: 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: [NSAttributedString.Key: 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: [NSAttributedString.Key: Any] = [
|
||||
.font: UIFont.boldSystemFont(ofSize: 16),
|
||||
.foregroundColor: UIColor(hex: "FA2F5B"),
|
||||
.paragraphStyle: {
|
||||
var style = NSMutableParagraphStyle()
|
||||
style.alignment = .center
|
||||
return style
|
||||
}()
|
||||
}()
|
||||
]
|
||||
}
|
||||
|
||||
@@ -88,9 +96,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: [NSAttributedString.Key: Any] = [
|
||||
.font: UIFont.systemFont(ofSize: 12),
|
||||
.foregroundColor: UIColor(hex: "DBDBDB")
|
||||
]
|
||||
}
|
||||
|
||||
@@ -98,8 +106,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import UIKit
|
||||
import Hue
|
||||
|
||||
public protocol LightboxControllerPageDelegate: class {
|
||||
|
||||
@@ -11,21 +10,24 @@ 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
|
||||
|
||||
lazy var scrollView: UIScrollView = { [unowned self] in
|
||||
let scrollView = UIScrollView()
|
||||
scrollView.frame = self.screenBounds
|
||||
scrollView.isPagingEnabled = false
|
||||
scrollView.delegate = self
|
||||
scrollView.isUserInteractionEnabled = true
|
||||
scrollView.showsHorizontalScrollIndicator = false
|
||||
scrollView.decelerationRate = UIScrollViewDecelerationRateFast
|
||||
scrollView.decelerationRate = UIScrollView.DecelerationRate.fast
|
||||
|
||||
return scrollView
|
||||
}()
|
||||
}()
|
||||
|
||||
lazy var overlayTapGestureRecognizer: UITapGestureRecognizer = { [unowned self] in
|
||||
let gesture = UITapGestureRecognizer()
|
||||
@@ -56,29 +58,25 @@ open class LightboxController: UIViewController {
|
||||
view.delegate = self
|
||||
|
||||
return view
|
||||
}()
|
||||
}()
|
||||
|
||||
open fileprivate(set) lazy var footerView: FooterView = { [unowned self] in
|
||||
let view = FooterView()
|
||||
view.delegate = self
|
||||
|
||||
return view
|
||||
}()
|
||||
}()
|
||||
|
||||
open fileprivate(set) lazy var overlayView: UIView = { [unowned self] in
|
||||
let view = UIView(frame: CGRect.zero)
|
||||
let gradient = CAGradientLayer()
|
||||
let colors = [UIColor(hex: "090909").alpha(0), UIColor(hex: "040404")]
|
||||
let colors = [UIColor(hex: "090909").withAlphaComponent(0), UIColor(hex: "040404")]
|
||||
|
||||
_ = view.addGradientLayer(colors)
|
||||
view.addGradientLayer(colors)
|
||||
view.alpha = 0
|
||||
|
||||
return view
|
||||
}()
|
||||
|
||||
var screenBounds: CGRect {
|
||||
return UIScreen.main.bounds
|
||||
}
|
||||
}()
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -92,9 +90,11 @@ open class LightboxController: UIViewController {
|
||||
seen = true
|
||||
}
|
||||
|
||||
reconfigurePagesForPreload()
|
||||
|
||||
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)
|
||||
}
|
||||
@@ -122,7 +122,7 @@ open class LightboxController: UIViewController {
|
||||
|
||||
open var spacing: CGFloat = 20 {
|
||||
didSet {
|
||||
configureLayout()
|
||||
configureLayout(view.bounds.size)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,12 +131,14 @@ open class LightboxController: UIViewController {
|
||||
return pageViews.map { $0.image }
|
||||
}
|
||||
set(value) {
|
||||
initialImages = value
|
||||
configurePages(value)
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -144,7 +146,7 @@ open class LightboxController: UIViewController {
|
||||
var pageViews = [PageView]()
|
||||
var statusBarHidden = false
|
||||
|
||||
fileprivate let initialImages: [LightboxImage]
|
||||
fileprivate var initialImages: [LightboxImage]
|
||||
fileprivate let initialPage: Int
|
||||
|
||||
// MARK: - Initializers
|
||||
@@ -164,6 +166,10 @@ open class LightboxController: UIViewController {
|
||||
open override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// 9 July 2020: @3lvis
|
||||
// Lightbox hasn't been optimized to be used in presentation styles other than fullscreen.
|
||||
modalPresentationStyle = .fullScreen
|
||||
|
||||
statusBarHidden = UIApplication.shared.isStatusBarHidden
|
||||
|
||||
view.backgroundColor = UIColor.black
|
||||
@@ -175,30 +181,42 @@ open class LightboxController: UIViewController {
|
||||
overlayView.addGestureRecognizer(overlayTapGestureRecognizer)
|
||||
|
||||
configurePages(initialImages)
|
||||
currentPage = initialPage
|
||||
|
||||
goTo(currentPage, animated: false)
|
||||
goTo(initialPage, animated: false)
|
||||
}
|
||||
|
||||
open override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
if LightboxConfig.hideStatusBar {
|
||||
UIApplication.shared.setStatusBarHidden(true, with: .fade)
|
||||
}
|
||||
|
||||
if !presented {
|
||||
presented = true
|
||||
configureLayout()
|
||||
configureLayout(view.bounds.size)
|
||||
}
|
||||
}
|
||||
|
||||
open override func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
open override func viewDidLayoutSubviews() {
|
||||
super.viewDidLayoutSubviews()
|
||||
|
||||
if LightboxConfig.hideStatusBar {
|
||||
UIApplication.shared.setStatusBarHidden(statusBarHidden, with: .fade)
|
||||
}
|
||||
scrollView.frame = view.bounds
|
||||
footerView.frame.size = CGSize(
|
||||
width: view.bounds.width,
|
||||
height: 100
|
||||
)
|
||||
|
||||
footerView.frame.origin = CGPoint(
|
||||
x: 0,
|
||||
y: view.bounds.height - footerView.frame.height
|
||||
)
|
||||
|
||||
headerView.frame = CGRect(
|
||||
x: 0,
|
||||
y: 16,
|
||||
width: view.bounds.width,
|
||||
height: 100
|
||||
)
|
||||
}
|
||||
|
||||
open override var prefersStatusBarHidden: Bool {
|
||||
return LightboxConfig.hideStatusBar
|
||||
}
|
||||
|
||||
// MARK: - Rotation
|
||||
@@ -206,9 +224,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
|
||||
@@ -217,15 +235,34 @@ open class LightboxController: UIViewController {
|
||||
pageViews.forEach { $0.removeFromSuperview() }
|
||||
pageViews = []
|
||||
|
||||
for image in images {
|
||||
let pageView = PageView(image: image)
|
||||
let preloadIndicies = calculatePreloadIndicies()
|
||||
|
||||
for i in 0..<images.count {
|
||||
let pageView = PageView(image: preloadIndicies.contains(i) ? images[i] : LightboxImageStub())
|
||||
pageView.pageViewDelegate = self
|
||||
|
||||
scrollView.addSubview(pageView)
|
||||
pageViews.append(pageView)
|
||||
}
|
||||
|
||||
configureLayout()
|
||||
configureLayout(view.bounds.size)
|
||||
}
|
||||
|
||||
func reconfigurePagesForPreload() {
|
||||
let preloadIndicies = calculatePreloadIndicies()
|
||||
|
||||
for i in 0..<initialImages.count {
|
||||
let pageView = pageViews[i]
|
||||
if preloadIndicies.contains(i) {
|
||||
if type(of: pageView.image) == LightboxImageStub.self {
|
||||
pageView.update(with: initialImages[i])
|
||||
}
|
||||
} else {
|
||||
if type(of: pageView.image) != LightboxImageStub.self {
|
||||
pageView.update(with: LightboxImageStub())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Pagination
|
||||
@@ -240,7 +277,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 +292,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) {
|
||||
scrollView.frame.size = size
|
||||
scrollView.contentSize = CGSize(
|
||||
width: size.width * CGFloat(numberOfPages) + spacing * CGFloat(numberOfPages - 1),
|
||||
@@ -276,25 +315,15 @@ open class LightboxController: UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
let bounds = scrollView.bounds
|
||||
let headerViewHeight = headerView.closeButton.frame.height > headerView.deleteButton.frame.height
|
||||
? headerView.closeButton.frame.height
|
||||
: headerView.deleteButton.frame.height
|
||||
|
||||
headerView.frame = CGRect(x: 0, y: 16, width: bounds.width, height: headerViewHeight)
|
||||
footerView.frame = CGRect(x: 0, y: 0, width: bounds.width, height: 70)
|
||||
|
||||
[headerView, footerView].forEach { ($0 as AnyObject).configureLayout() }
|
||||
|
||||
footerView.frame.origin.y = bounds.height - footerView.frame.height
|
||||
|
||||
overlayView.frame = scrollView.frame
|
||||
overlayView.resizeGradientLayer()
|
||||
}
|
||||
|
||||
fileprivate func loadDynamicBackground(_ image: UIImage) {
|
||||
backgroundView.image = image
|
||||
backgroundView.layer.add(CATransition(), forKey: kCATransitionFade)
|
||||
backgroundView.layer.add(CATransition(), forKey: "fade")
|
||||
}
|
||||
|
||||
func toggleControls(pageView: PageView?, visible: Bool, duration: TimeInterval = 0.1, delay: TimeInterval = 0) {
|
||||
@@ -308,6 +337,22 @@ open class LightboxController: UIViewController {
|
||||
pageView?.playButton.alpha = alpha
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
// MARK: - Helper functions
|
||||
func calculatePreloadIndicies () -> [Int] {
|
||||
var preloadIndicies: [Int] = []
|
||||
let preload = LightboxConfig.preload
|
||||
if preload > 0 {
|
||||
let lb = max(0, currentPage - preload)
|
||||
let rb = min(initialImages.count, currentPage + preload)
|
||||
for i in lb..<rb {
|
||||
preloadIndicies.append(i)
|
||||
}
|
||||
} else {
|
||||
preloadIndicies = [Int](0..<initialImages.count)
|
||||
}
|
||||
return preloadIndicies
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - UIScrollViewDelegate
|
||||
@@ -333,7 +378,7 @@ extension LightboxController: UIScrollViewDelegate {
|
||||
}
|
||||
|
||||
targetContentOffset.pointee.x = x
|
||||
currentPage = Int(x / screenBounds.width)
|
||||
currentPage = Int(x / pageWidth)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,8 +386,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 +411,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)
|
||||
}
|
||||
@@ -388,8 +443,8 @@ extension LightboxController: HeaderViewDelegate {
|
||||
self.pageViews.remove(at: prevIndex).removeFromSuperview()
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
|
||||
self.configureLayout()
|
||||
self.currentPage = Int(self.scrollView.contentOffset.x / self.screenBounds.width)
|
||||
self.configureLayout(self.view.bounds.size)
|
||||
self.currentPage = Int(self.scrollView.contentOffset.x / self.view.bounds.width)
|
||||
deleteButton.isEnabled = true
|
||||
}
|
||||
}
|
||||
@@ -407,11 +462,9 @@ extension LightboxController: HeaderViewDelegate {
|
||||
extension LightboxController: FooterViewDelegate {
|
||||
|
||||
public func footerView(_ footerView: FooterView, didExpand expanded: Bool) {
|
||||
footerView.frame.origin.y = screenBounds.height - footerView.frame.height
|
||||
|
||||
UIView.animate(withDuration: 0.25, animations: {
|
||||
self.overlayView.alpha = expanded ? 1.0 : 0.0
|
||||
self.headerView.deleteButton.alpha = expanded ? 0.0 : 1.0
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,51 @@
|
||||
import UIKit
|
||||
import Imaginary
|
||||
|
||||
open class LightboxImage {
|
||||
|
||||
open fileprivate(set) var image: UIImage?
|
||||
open fileprivate(set) var imageURL: URL?
|
||||
open fileprivate(set) var videoURL: URL?
|
||||
open fileprivate(set) var imageClosure: (() -> UIImage)?
|
||||
open var text: String
|
||||
|
||||
// MARK: - Initialization
|
||||
|
||||
internal init(text: String = "") {
|
||||
self.text = text
|
||||
}
|
||||
|
||||
public init(image: UIImage, text: String = "", videoURL: URL? = nil) {
|
||||
self.image = image
|
||||
self.text = text
|
||||
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
|
||||
}
|
||||
|
||||
open func addImageTo(_ imageView: UIImageView, completion: ((_ image: UIImage?) -> Void)? = nil) {
|
||||
public init(imageClosure: @escaping () -> UIImage, text: String = "", videoURL: URL? = nil) {
|
||||
self.imageClosure = imageClosure
|
||||
self.text = text
|
||||
self.videoURL = videoURL
|
||||
}
|
||||
|
||||
open func addImageTo(_ imageView: UIImageView, completion: ((UIImage?) -> Void)? = nil) {
|
||||
if let image = image {
|
||||
imageView.image = image
|
||||
completion?(image)
|
||||
} else if let imageURL = imageURL {
|
||||
LightboxConfig.loadImage(imageView, imageURL) { error, image in
|
||||
completion?(image)
|
||||
}
|
||||
LightboxConfig.loadImage(imageView, imageURL, completion)
|
||||
} else if let imageClosure = imageClosure {
|
||||
let img = imageClosure()
|
||||
imageView.image = img
|
||||
completion?(img)
|
||||
} else {
|
||||
imageView.image = nil
|
||||
completion?(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import UIKit
|
||||
|
||||
internal class LightboxImageStub: LightboxImage {
|
||||
|
||||
// MARK: - Initialization
|
||||
init () {
|
||||
super.init()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,7 +16,7 @@ open class FooterView: UIView {
|
||||
label.delegate = self
|
||||
|
||||
return label
|
||||
}()
|
||||
}()
|
||||
|
||||
open fileprivate(set) lazy var pageLabel: UILabel = { [unowned self] in
|
||||
let label = UILabel(frame: CGRect.zero)
|
||||
@@ -24,7 +24,7 @@ open class FooterView: UIView {
|
||||
label.numberOfLines = 1
|
||||
|
||||
return label
|
||||
}()
|
||||
}()
|
||||
|
||||
open fileprivate(set) lazy var separatorView: UIView = { [unowned self] in
|
||||
let view = UILabel(frame: CGRect.zero)
|
||||
@@ -32,9 +32,9 @@ open class FooterView: UIView {
|
||||
view.backgroundColor = LightboxConfig.PageIndicator.separatorColor
|
||||
|
||||
return view
|
||||
}()
|
||||
}()
|
||||
|
||||
let gradientColors = [UIColor(hex: "040404").alpha(0.1), UIColor(hex: "040404")]
|
||||
let gradientColors = [UIColor(hex: "040404").withAlphaComponent(0.1), UIColor(hex: "040404")]
|
||||
open weak var delegate: FooterViewDelegate?
|
||||
|
||||
// MARK: - Initializers
|
||||
@@ -76,17 +76,29 @@ open class FooterView: UIView {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Layout
|
||||
open override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
fileprivate func resetFrames() {
|
||||
frame.size.height = infoLabel.frame.height + 40 + 0.5
|
||||
do {
|
||||
let bottomPadding: CGFloat
|
||||
if #available(iOS 11, *) {
|
||||
bottomPadding = safeAreaInsets.bottom
|
||||
} else {
|
||||
bottomPadding = 0
|
||||
}
|
||||
|
||||
pageLabel.frame.origin = CGPoint(
|
||||
x: (frame.width - pageLabel.frame.width) / 2,
|
||||
y: frame.height - pageLabel.frame.height - 2)
|
||||
pageLabel.frame.origin = CGPoint(
|
||||
x: (frame.width - pageLabel.frame.width) / 2,
|
||||
y: frame.height - pageLabel.frame.height - 2 - bottomPadding
|
||||
)
|
||||
}
|
||||
|
||||
separatorView.frame = CGRect(x: 0, y: pageLabel.frame.minY - 2.5,
|
||||
width: frame.width, height: 0.5)
|
||||
separatorView.frame = CGRect(
|
||||
x: 0,
|
||||
y: pageLabel.frame.minY - 2.5,
|
||||
width: frame.width,
|
||||
height: 0.5
|
||||
)
|
||||
|
||||
infoLabel.frame.origin.y = separatorView.frame.minY - infoLabel.frame.height - 15
|
||||
|
||||
@@ -98,7 +110,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()
|
||||
}
|
||||
@@ -107,8 +119,7 @@ extension FooterView: LayoutConfigurable {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,6 @@ protocol HeaderViewDelegate: class {
|
||||
}
|
||||
|
||||
open class HeaderView: UIView {
|
||||
|
||||
var centerTextStyle: NSMutableParagraphStyle = {
|
||||
var style = NSMutableParagraphStyle()
|
||||
style.alignment = .center
|
||||
return style
|
||||
}()
|
||||
|
||||
open fileprivate(set) lazy var closeButton: UIButton = { [unowned self] in
|
||||
let title = NSAttributedString(
|
||||
string: LightboxConfig.CloseButton.text,
|
||||
@@ -20,19 +13,25 @@ open class HeaderView: UIView {
|
||||
|
||||
let button = UIButton(type: .system)
|
||||
|
||||
button.frame.size = LightboxConfig.CloseButton.size
|
||||
button.setAttributedTitle(title, for: UIControlState())
|
||||
button.setAttributedTitle(title, for: UIControl.State())
|
||||
|
||||
if let size = LightboxConfig.CloseButton.size {
|
||||
button.frame.size = size
|
||||
} else {
|
||||
button.sizeToFit()
|
||||
}
|
||||
|
||||
button.addTarget(self, action: #selector(closeButtonDidPress(_:)),
|
||||
for: .touchUpInside)
|
||||
|
||||
if let image = LightboxConfig.CloseButton.image {
|
||||
button.setBackgroundImage(image, for: UIControlState())
|
||||
button.setBackgroundImage(image, for: UIControl.State())
|
||||
}
|
||||
|
||||
button.isHidden = !LightboxConfig.CloseButton.enabled
|
||||
|
||||
return button
|
||||
}()
|
||||
}()
|
||||
|
||||
open fileprivate(set) lazy var deleteButton: UIButton = { [unowned self] in
|
||||
let title = NSAttributedString(
|
||||
@@ -41,19 +40,25 @@ 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)
|
||||
|
||||
if let image = LightboxConfig.DeleteButton.image {
|
||||
button.setBackgroundImage(image, for: UIControlState())
|
||||
button.setBackgroundImage(image, for: UIControl.State())
|
||||
}
|
||||
|
||||
button.isHidden = !LightboxConfig.DeleteButton.enabled
|
||||
|
||||
return button
|
||||
}()
|
||||
}()
|
||||
|
||||
weak var delegate: HeaderViewDelegate?
|
||||
|
||||
@@ -73,11 +78,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,10 +91,23 @@ open class HeaderView: UIView {
|
||||
|
||||
extension HeaderView: LayoutConfigurable {
|
||||
|
||||
public func configureLayout() {
|
||||
closeButton.frame.origin = CGPoint(
|
||||
x: bounds.width - closeButton.frame.width - 17, y: 0)
|
||||
@objc public func configureLayout() {
|
||||
let topPadding: CGFloat
|
||||
|
||||
deleteButton.frame.origin = CGPoint(x: 17, y: 0)
|
||||
if #available(iOS 11, *) {
|
||||
topPadding = safeAreaInsets.top
|
||||
} else {
|
||||
topPadding = 0
|
||||
}
|
||||
|
||||
closeButton.frame.origin = CGPoint(
|
||||
x: bounds.width - closeButton.frame.width - 17,
|
||||
y: topPadding
|
||||
)
|
||||
|
||||
deleteButton.frame.origin = CGPoint(
|
||||
x: 17,
|
||||
y: topPadding
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,22 +41,32 @@ open class InfoLabel: UILabel {
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate var truncatedText: String {
|
||||
var truncatedText: String {
|
||||
var truncatedText = fullText
|
||||
|
||||
guard numberOfLines(fullText) > numberOfVisibleLines else {
|
||||
return truncatedText
|
||||
}
|
||||
|
||||
// Perform quick "rough cut"
|
||||
while numberOfLines(truncatedText) > numberOfVisibleLines * 2 {
|
||||
truncatedText = String(truncatedText.prefix(truncatedText.count / 2))
|
||||
}
|
||||
|
||||
// Capture the endIndex of truncatedText before appending ellipsis
|
||||
var truncatedTextCursor = truncatedText.endIndex
|
||||
|
||||
truncatedText += ellipsis
|
||||
|
||||
let start = truncatedText.characters.index(truncatedText.endIndex, offsetBy: -(ellipsis.characters.count + 1))
|
||||
let end = truncatedText.characters.index(truncatedText.endIndex, offsetBy: -ellipsis.characters.count)
|
||||
var range = start..<end
|
||||
|
||||
// Remove characters ahead of ellipsis until the text is the right number of lines
|
||||
while numberOfLines(truncatedText) > numberOfVisibleLines {
|
||||
truncatedText.removeSubrange(range)
|
||||
range = truncatedText.index(range.lowerBound, offsetBy: -1)..<truncatedText.index(range.upperBound, offsetBy: -1)
|
||||
// To avoid "Cannot decrement before startIndex"
|
||||
guard truncatedTextCursor > truncatedText.startIndex else {
|
||||
break
|
||||
}
|
||||
|
||||
truncatedTextCursor = truncatedText.index(before: truncatedTextCursor)
|
||||
truncatedText.remove(at: truncatedTextCursor)
|
||||
}
|
||||
|
||||
return truncatedText
|
||||
@@ -81,7 +91,7 @@ open class InfoLabel: UILabel {
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
func labelDidTap(_ tapGestureRecognizer: UITapGestureRecognizer) {
|
||||
@objc func labelDidTap(_ tapGestureRecognizer: UITapGestureRecognizer) {
|
||||
shortText = truncatedText
|
||||
expanded ? collapse() : expand()
|
||||
}
|
||||
@@ -101,13 +111,13 @@ open class InfoLabel: UILabel {
|
||||
}
|
||||
|
||||
fileprivate func updateText(_ string: String) {
|
||||
let attributedString = NSMutableAttributedString(string: string,
|
||||
attributes: LightboxConfig.InfoLabel.textAttributes)
|
||||
let textAttributes = LightboxConfig.InfoLabel.textAttributes
|
||||
let attributedString = NSMutableAttributedString(string: string, attributes: textAttributes)
|
||||
|
||||
if string.range(of: ellipsis) != nil {
|
||||
let range = (string as NSString).range(of: ellipsis)
|
||||
attributedString.addAttribute(NSForegroundColorAttributeName,
|
||||
value: LightboxConfig.InfoLabel.ellipsisColor, range: range)
|
||||
if let range = string.range(of: ellipsis) {
|
||||
let ellipsisColor = LightboxConfig.InfoLabel.ellipsisColor
|
||||
let ellipsisRange = NSRange(range, in: string)
|
||||
attributedString.addAttribute(.foregroundColor, value: ellipsisColor, range: ellipsisRange)
|
||||
}
|
||||
|
||||
attributedText = attributedString
|
||||
@@ -119,12 +129,12 @@ open class InfoLabel: UILabel {
|
||||
return string.boundingRect(
|
||||
with: CGSize(width: bounds.size.width, height: CGFloat.greatestFiniteMagnitude),
|
||||
options: [.usesLineFragmentOrigin, .usesFontLeading],
|
||||
attributes: [NSFontAttributeName : font],
|
||||
attributes: [NSAttributedString.Key.font: font!],
|
||||
context: nil).height
|
||||
}
|
||||
|
||||
fileprivate func numberOfLines(_ string: String) -> Int {
|
||||
let lineHeight = "A".size(attributes: [NSFontAttributeName: font]).height
|
||||
let lineHeight = "A".size(withAttributes: [NSAttributedString.Key.font: font!]).height
|
||||
let totalHeight = heightForString(string)
|
||||
|
||||
return Int(totalHeight / lineHeight)
|
||||
@@ -135,7 +145,7 @@ open class InfoLabel: UILabel {
|
||||
|
||||
extension InfoLabel: LayoutConfigurable {
|
||||
|
||||
public func configureLayout() {
|
||||
@objc public func configureLayout() {
|
||||
shortText = truncatedText
|
||||
expanded ? expand() : collapse()
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class LoadingIndicator: UIView {
|
||||
alpha = 0
|
||||
|
||||
indicator = UIActivityIndicatorView()
|
||||
indicator.activityIndicatorViewStyle = .whiteLarge
|
||||
indicator.style = .whiteLarge
|
||||
indicator.startAnimating()
|
||||
|
||||
addSubview(indicator)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -22,8 +22,20 @@ class PageView: UIScrollView {
|
||||
lazy var playButton: UIButton = {
|
||||
let button = UIButton(type: .custom)
|
||||
button.frame.size = CGSize(width: 60, height: 60)
|
||||
button.setBackgroundImage(AssetManager.image("lightbox_play"), for: UIControlState())
|
||||
var buttonImage = AssetManager.image("lightbox_play")
|
||||
|
||||
// Note by Elvis Nuñez on Mon 22 Jun 08:06
|
||||
// When using SPM you might find that assets are note included. This is a workaround to provide default assets
|
||||
// under iOS 13 so using SPM can work without problems.
|
||||
if #available(iOS 13.0, *) {
|
||||
if buttonImage == nil {
|
||||
buttonImage = UIImage(systemName: "play.circle.fill")
|
||||
}
|
||||
}
|
||||
|
||||
button.setBackgroundImage(buttonImage, for: UIControl.State())
|
||||
button.addTarget(self, action: #selector(playButtonTouched(_:)), for: .touchUpInside)
|
||||
button.tintColor = .white
|
||||
|
||||
button.layer.shadowOffset = CGSize(width: 1, height: 1)
|
||||
button.layer.shadowColor = UIColor.gray.cgColor
|
||||
@@ -33,7 +45,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,16 +63,7 @@ class PageView: UIScrollView {
|
||||
|
||||
configure()
|
||||
|
||||
activityIndicator.alpha = 1
|
||||
self.image.addImageTo(imageView) { image in
|
||||
self.isUserInteractionEnabled = true
|
||||
self.configureImageView()
|
||||
self.pageViewDelegate?.remoteImageDidLoad(image)
|
||||
|
||||
UIView.animate(withDuration: 0.4) {
|
||||
self.activityIndicator.alpha = 0
|
||||
}
|
||||
}
|
||||
fetchImage()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
@@ -72,11 +75,9 @@ class PageView: UIScrollView {
|
||||
func configure() {
|
||||
addSubview(imageView)
|
||||
|
||||
if image.videoURL != nil {
|
||||
addSubview(playButton)
|
||||
}
|
||||
updatePlayButton()
|
||||
|
||||
addSubview(activityIndicator)
|
||||
addSubview(loadingIndicator)
|
||||
|
||||
delegate = self
|
||||
isMultipleTouchEnabled = true
|
||||
@@ -96,9 +97,42 @@ class PageView: UIScrollView {
|
||||
tapRecognizer.require(toFail: doubleTapRecognizer)
|
||||
}
|
||||
|
||||
// MARK: - Update
|
||||
func update(with image: LightboxImage) {
|
||||
self.image = image
|
||||
updatePlayButton()
|
||||
fetchImage()
|
||||
}
|
||||
|
||||
func updatePlayButton () {
|
||||
if self.image.videoURL != nil && !subviews.contains(playButton) {
|
||||
addSubview(playButton)
|
||||
} else if self.image.videoURL == nil && subviews.contains(playButton) {
|
||||
playButton.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Fetch
|
||||
private func fetchImage () {
|
||||
loadingIndicator.alpha = 1
|
||||
self.image.addImageTo(imageView) { [weak self] image in
|
||||
guard let self = self else {
|
||||
return
|
||||
}
|
||||
|
||||
self.isUserInteractionEnabled = true
|
||||
self.configureImageView()
|
||||
self.pageViewDelegate?.remoteImageDidLoad(image, imageView: self.imageView)
|
||||
|
||||
UIView.animate(withDuration: 0.4) {
|
||||
self.loadingIndicator.alpha = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Recognizers
|
||||
|
||||
func scrollViewDoubleTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
@objc func scrollViewDoubleTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
let pointInView = recognizer.location(in: imageView)
|
||||
let newZoomScale = zoomScale > minimumZoomScale
|
||||
? minimumZoomScale
|
||||
@@ -114,7 +148,7 @@ class PageView: UIScrollView {
|
||||
zoom(to: rectToZoomTo, animated: true)
|
||||
}
|
||||
|
||||
func viewTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
@objc func viewTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
pageViewDelegate?.pageViewDidTouch(self)
|
||||
}
|
||||
|
||||
@@ -123,12 +157,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 +207,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
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
machine:
|
||||
xcode:
|
||||
version: "9.0"
|
||||
|
||||
dependencies:
|
||||
override:
|
||||
- rm -rf Carthage
|
||||
- carthage update
|
||||
|
||||
test:
|
||||
override:
|
||||
- set -o pipefail && xcodebuild -project Lightbox.xcodeproj -scheme "Lightbox-iOS" -sdk iphonesimulator clean build
|
||||
@@ -0,0 +1,18 @@
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
lazy var controller: UINavigationController = UINavigationController(rootViewController: ViewController())
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
window = UIWindow()
|
||||
window?.rootViewController = controller
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"scale" : "1x",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 987 KiB After Width: | Height: | Size: 987 KiB |
@@ -1,22 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -13,11 +13,9 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
@@ -34,13 +32,12 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<!--Include to allow all connections (DANGER)-->
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,56 @@
|
||||
import UIKit
|
||||
import Lightbox
|
||||
|
||||
class ViewController: UIViewController {
|
||||
|
||||
lazy var showButton: UIButton = { [unowned self] in
|
||||
let button = UIButton()
|
||||
button.addTarget(self, action: #selector(showLightbox), for: .touchUpInside)
|
||||
button.setTitle("Show me the lightbox", for: UIControl.State())
|
||||
button.setTitleColor(UIColor(red:0.47, green:0.6, blue:0.13, alpha:1), for: UIControl.State())
|
||||
button.titleLabel?.font = UIFont(name: "AvenirNextCondensed-DemiBold", size: 30)
|
||||
button.frame = UIScreen.main.bounds
|
||||
button.autoresizingMask = [.flexibleTopMargin, .flexibleLeftMargin, .flexibleRightMargin, .flexibleBottomMargin]
|
||||
|
||||
return button
|
||||
}()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
view.autoresizingMask = [.flexibleTopMargin, .flexibleLeftMargin, .flexibleRightMargin, .flexibleBottomMargin]
|
||||
view.backgroundColor = UIColor.white
|
||||
view.addSubview(showButton)
|
||||
title = "Lightbox"
|
||||
}
|
||||
|
||||
// MARK: - Action methods
|
||||
|
||||
@objc func showLightbox() {
|
||||
let images = [
|
||||
LightboxImage(
|
||||
image: UIImage(named: "photo1")!,
|
||||
text: "Photography is the science, art, application and practice of creating durable images by recording light or other electromagnetic radiation, either electronically by means of an image sensor, or chemically by means of a light-sensitive material such as photographic film"
|
||||
),
|
||||
|
||||
LightboxImage(imageURL: URL(string: "https://via.placeholder.com/300.png/09f/fff")!),
|
||||
|
||||
|
||||
LightboxImage(
|
||||
image: UIImage(named: "photo2")!,
|
||||
text: "Emoji 😍 (/ɪˈmoʊdʒi/; singular emoji, plural emoji or emojis;[4] from the Japanese 絵文字えもじ, pronounced [emodʑi]) are ideograms and smileys used in electronic messages and web pages. Emoji are used much like emoticons and exist in various genres, including facial expressions, common objects, places and types of weather 🌅☔️💦, and animals 🐶🐱",
|
||||
videoURL: URL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
|
||||
),
|
||||
LightboxImage(
|
||||
image: UIImage(named: "photo3")!,
|
||||
text: "A lightbox is a translucent surface illuminated from behind, used for situations where a shape laid upon the surface needs to be seen with high contrast."
|
||||
)
|
||||
]
|
||||
|
||||
let controller = LightboxController(images: images)
|
||||
controller.dynamicBackground = true
|
||||
|
||||
present(controller, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||