93 Commits

Author SHA1 Message Date
Elvis Nunez c73d8292b5 Merge pull request #303 from kitwtnb/fix-build-error-for-main-actor-isolation
Fix build error for MainActor isolation.
2024-08-27 13:36:10 +02:00
Keita Watanabe de59c814c6 fix build error for MainActor isolation 2024-08-12 14:40:35 +09:00
Elvis Nunez f588347f58 Merge pull request #301 from kitwtnb/fix-existential-any
Fix existential-any for Swift6
2024-07-29 18:12:28 +02:00
Keita Watanabe dea5e8a4bd fix existential any 2024-07-15 16:27:21 +09:00
Elvis 398ee143f0 Merge pull request #295 from novr/fix_compiler_warning_class
fix: 'class' keyword to define a class-constrained protocol is deprecated
2022-12-21 06:39:24 +01:00
novr b7166be79f fix: 'class' keyword to define a class-constrained protocol is deprecated 2022-12-21 10:38:42 +09:00
Elvis 0119309a25 Merge pull request #287 from kitwtnb/remove-dependency-on-specific-image-request-library
Remove dependencies on specific image request library
2022-12-04 22:35:24 +01:00
Elvis 2ac28e0497 Merge pull request #291 from dknchris/expose-background
Expose image background color via LightboxConfig
2022-10-09 09:36:14 +02:00
Elvis 44c91b41c6 Merge pull request #293 from dknchris/tap-delegate
Add tap delegate for tap/double tap detection
2022-10-09 09:35:52 +02:00
Dicken Christian 619cbba91e Add tap delegate for tap/double tap detection
A reliable tap event helps users hide/unhide navigation bar or toolbars to give a full unobstructed view of the image.
2022-10-02 18:39:58 +05:30
Dicken Christian 2fbb4ba5af Expose image background color via LightboxConfig
This gives users the ability to use a custom background color using LightboxConfig.imageBackgroundColor
2022-10-02 15:39:14 +05:30
Elvis 9cc8c1972d Merge pull request #290 from MohammadRezaAnsari/master
Fixed SPM resolving issue
2022-09-13 23:55:09 +02:00
Mohammad Reza Ansary 88b08b262d Merge pull request #1 from MohammadRezaAnsari/hotFix
Remove Imaginary framework dependency
2022-09-11 14:49:23 +04:30
Mohammad Reza Ansary a3825a081a Remove Imaginary framework dependency 2022-09-11 14:45:41 +04:30
Elvis 63004497df Merge pull request #289 from alexstich/prod
Image deleting delegate
2022-08-18 20:58:10 +02:00
AlexStich daca12b64a Add LightboxControllerDeleteDelegate to have delegate for image deleting action 2022-08-03 22:44:56 +04:00
Keita Watanabe 3ac333b6a8 remove dependency on SDWebImage 2022-06-23 10:55:36 +09:00
Elvis 64573991e0 Merge pull request #283 from Saturn-Technologies/master
Using SDWedImage instead Imginery for caching
2022-02-10 14:49:23 +01:00
Steven Guo 7e06642187 update Podspec 2022-02-07 14:09:46 -05:00
Steven Guo 256610707e switch to SDWebImage from Imaginery and use the SDAnimatedGifView 2022-02-07 12:50:05 -05:00
E L V I S a07de07adb Merge pull request #267 from davidevincenzi/master
Move configureLayout(_) in viewDidLayoutSubviews()
2020-11-18 20:11:36 +01:00
Davide fbd246db01 Move configureLayout(_) in viewDidLayoutSubviews() 2020-11-01 09:26:18 +01:00
E L V I S 7b1b9370ab Merge pull request #265 from alexandrgl/delete-button-crash-fix
Fix app crash when tap delete button.
2020-10-30 06:16:29 +01:00
Aleksandr Glushchenko 502f9a6f92 Update LightboxController.swift 2020-10-29 19:55:16 +02:00
E L V I S 2cac1cf4b2 Update Lightbox.podspec 2020-10-04 08:41:44 +02:00
E L V I S 918918649c Merge pull request #264 from hyperoslo/update-project
Update project
2020-10-04 08:41:12 +02:00
Elvis e36c794651 Update projects 2020-10-04 08:40:54 +02:00
Elvis 1f42c0229c Update project 2020-10-04 08:17:54 +02:00
E L V I S 6f0ead5af5 Update Lightbox.podspec 2020-07-09 19:47:10 -05:00
E L V I S 4a70c08f37 Merge pull request #254 from hyperoslo/force-modalPresentationStyle
Force modal presentation style
2020-07-09 19:46:46 -05:00
Elvis 7830a7512a Add comment 2020-07-09 19:45:55 -05:00
Elvis 2bb85661b1 Force usage of modalPresentationStyle 2020-07-09 19:44:03 -05:00
Elvis dbffe4f688 Update demo to fix broken link and to show label bug 2020-06-22 08:29:04 -05:00
Elvis ed69a9fdee Add navigation controller to demo 2020-06-22 08:22:00 -05:00
E L V I S 6344062be2 Update Lightbox.podspec 2020-06-22 08:17:15 -05:00
Elvis 8dcf50b722 Add backup symbol for play button 2020-06-22 08:16:07 -05:00
E L V I S 3c145a392b Update README.md 2020-06-22 07:57:52 -05:00
Elvis 25e4877614 Fix demo 2020-06-22 07:56:43 -05:00
Elvis 18743a36a5 Update project 2020-06-17 11:56:23 -05:00
E L V I S 8e254accd6 Merge pull request #248 from Tobisaninfo/master
Introduce Swift Package Manager
2020-06-15 12:27:06 -05:00
E L V I S d3e8d79d27 Merge pull request #249 from yspreen/master
Add cache to carthage requirements.
2020-06-15 12:26:28 -05:00
Yannick Spreen e3b2df4363 Add cache to carthage requirements. 2020-06-15 09:05:56 -04:00
tobias c25bbf4671 Fix source path in Package.swift 2020-06-14 20:14:13 +02:00
tobias c0e7c31844 Add Package.swift 2020-06-14 20:12:31 +02:00
Elvis e43ba2b58f Move example project 2020-06-13 21:26:18 -05:00
E L V I S 6d92df2dad Delete .swift-version 2020-06-08 18:50:50 -05:00
E L V I S 5b85a492a6 Update README.md 2020-06-08 18:50:18 -05:00
Elvis 774947dea5 Update demo 2020-06-08 18:47:11 -05:00
Elvis 21d6b335fc Update sample project 2020-06-08 18:36:01 -05:00
Elvis b45f490bec Update project 2020-06-08 17:52:51 -05:00
E L V I S b37e139060 Merge pull request #246 from hyperoslo/update-swift-5
Update swift 5
2020-06-08 17:51:12 -05:00
Elvis 1e3636cebf Update all the thing 2020-06-08 17:50:09 -05:00
Elvis 54bb598dd8 Bump podspec 2020-06-07 01:42:26 -05:00
Khoa 1aa9643feb Merge pull request #218 from ndonald2/color-extension-fix
Change UIColor hex extension to internal visibility
2019-02-13 17:54:34 +01:00
Nick Donaldson 1bccfe2cc1 Change UIColor hex extension to internal visibility
Using public visibility means that developers are unable to
simultaneously use hypersolo/Hue along with Lightbox since
both modules contain a globally imported extension of the
same format - UIColor.init(hex: String)
2019-01-04 11:03:32 -07:00
Khoa Pham 1b16b2bb74 Update podspec 2018-09-27 10:55:35 +02:00
Khoa Pham 32c45514c8 Update demo 2018-09-27 10:51:16 +02:00
Khoa Pham e73f58ced5 Update to Swift 4 2018-09-27 10:47:47 +02:00
Khoa 54b73d3cc0 Merge pull request #206 from fassko/master
Swift 4.2 and Xcode 10
2018-09-27 10:39:35 +02:00
Kristaps Grinbergs 8fc34e8d12 Two issues need to fix for Swift 4.2 2018-09-26 10:18:38 +03:00
Kristaps Grinbergs 6af9321ea9 * Swift 4.2 and Xcode 10
* SwiftLint warnings and errors, added some short variable names in config
* Example project to Swift 4.2 and Xcode 10
* bump version
2018-09-23 13:25:03 +03:00
Khoa 1584281c41 Merge pull request #182 from t0a0/Image_preload_constant
Added possibility to set image preload value
2018-05-16 13:44:04 +02:00
Igor Fedotov 5ac3f8ae18 fixed typo 2018-02-13 19:45:21 +01:00
Igor Fedotov 5d93293649 upd range syntax for consistency 2018-02-13 19:42:53 +01:00
Igor Fedotov a4f113d066 updated lightbox controller to handle preload 2018-02-13 19:37:50 +01:00
Igor Fedotov 41436d8083 This unloads the image when the pageView is stubbed 2018-02-13 19:31:59 +01:00
Igor Fedotov 22785514bd Add variable to config, to allow preload 2018-02-13 18:58:09 +01:00
Igor Fedotov d8f6836c0f forgot to commit xcode files for the stub 2018-02-13 18:57:34 +01:00
Igor Fedotov 20ea9e3e1c Added private init method on LightboxImage to support the stub 2018-02-13 18:56:07 +01:00
Igor Fedotov 64dee3b6bc Added a subclass to stub the images, that do not need to be loaded 2018-02-13 18:55:31 +01:00
Igor Fedotov 911d0c5df8 Made PageView able to update with image 2018-02-13 18:52:33 +01:00
Igor Fedotov cc85786658 Fixed unnecessar call, that was making images to be fetched twice 2018-02-13 17:03:14 +01:00
Vadym Markov 3b695da3ee Merge pull request #181 from t0a0/Support_for_init_with_closure
Added support to init with closure
2018-02-12 23:14:26 +01:00
Igor Fedotov 5a73ca4c6b Added support to init with closure 2018-02-12 22:59:12 +01:00
Khoa Pham 90d31b75ca Bump to 2.1.2 2018-01-02 12:21:59 +01:00
Khoa 9d6d6e3798 Merge pull request #172 from hyperoslo/fix/page
Fix footer frame
2018-01-02 12:11:46 +01:00
Khoa Pham 81e13530aa Set size and origin 2018-01-02 11:45:41 +01:00
Khoa Pham f11af83808 Update dependencies in demo 2018-01-02 11:39:38 +01:00
Christoffer Winterkvist 162f6d29c3 Merge pull request #167 from vincentsaluzzo/master
Carthage compatibility
2017-12-09 20:32:28 +01:00
Vincent Saluzzo cb97450102 remove copy framework build phase which should make only on app building and not framework (nested framework aren't allowed by Apple) 2017-12-08 12:07:09 +01:00
Khoa 9de5f16735 Merge pull request #163 from rinat-enikeev/fix-footer-counter
Fix footer counter
2017-11-27 13:59:07 +01:00
Rinat Enikeev 418da11c82 fix footer counter
reason: you should take into account spacing while calculating current page
2017-11-27 17:45:30 +05:00
Khoa Pham 90fe59ffc6 Bump to 2.1.1 2017-11-21 14:24:34 +01:00
Khoa Pham 422b23b4c2 Update README.md 2017-11-21 10:41:26 +01:00
Khoa Pham 08a4c284f4 Merge pull request #156 from andreyrd/fix/no-window-bounds
Use view.bounds instead of UIApplicationDelegate.window.bounds
2017-11-20 21:59:07 +01:00
Khoa Pham b775f12fe5 Merge pull request #157 from hyperoslo/fix/truncating
Add test
2017-11-20 15:47:17 +01:00
Khoa Pham 9f75ddffdf Use just 1 test 2017-11-20 14:53:21 +01:00
Khoa Pham 225fac033a Remove fileprivate in order to test 2017-11-20 14:49:26 +01:00
Khoa Pham fe3229278d Add test 2017-11-20 14:48:57 +01:00
Khoa Pham de0d273258 Add quotes 2017-11-20 14:26:01 +01:00
Khoa Pham d1231f19ff Fix swiftlint warnings 2017-11-20 14:25:33 +01:00
Khoa Pham 20f927f338 Need to greater than startIndex 2017-11-20 14:22:40 +01:00
Andrey Radchishin 8144d96129 Use view.bounds instead of UIApplicationDelegate.window.bounds 2017-11-17 10:11:20 -08:00
45 changed files with 761 additions and 814 deletions
-1
View File
@@ -1 +0,0 @@
4.0
+3
View File
@@ -41,4 +41,7 @@ variable_name:
- id
- URL
- GlobalAPIKey
- i
- lb
- rb
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle)
+2 -2
View File
@@ -1,2 +1,2 @@
github "hyperoslo/Hue" ~> 3.0
github "hyperoslo/Imaginary" ~> 3.0
github "hyperoslo/Imaginary" ~> 5.0.0
github "hyperoslo/Cache" ~> 6.0.0
+2 -3
View File
@@ -1,3 +1,2 @@
github "hyperoslo/Cache" "4.1.2"
github "hyperoslo/Hue" "3.0.0"
github "hyperoslo/Imaginary" "3.0.2"
github "hyperoslo/Cache" "6.0.0"
github "hyperoslo/Imaginary" "5.0.0"
-44
View File
@@ -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,400 +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 */; };
B89E57B7A21C44D762123511 /* Pods_DemoLightbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE4E898FD95F4D90F624B067 /* Pods_DemoLightbox.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
064155DBC618EBACF5C257C6 /* Pods-DemoLightbox.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoLightbox.release.xcconfig"; path = "Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox.release.xcconfig"; sourceTree = "<group>"; };
29B4A4291C43A4320060ED52 /* DemoLightbox.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoLightbox.app; sourceTree = BUILT_PRODUCTS_DIR; };
29B4A42C1C43A4320060ED52 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
29B4A42E1C43A4320060ED52 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
29B4A4331C43A4320060ED52 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
29B4A4361C43A4320060ED52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
29B4A4381C43A4320060ED52 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6096248776155BE47C0A196A /* Pods-DemoLightbox.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoLightbox.debug.xcconfig"; path = "Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox.debug.xcconfig"; sourceTree = "<group>"; };
DAE713340DA5D2F2EF13EA8D /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
EE4E898FD95F4D90F624B067 /* Pods_DemoLightbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DemoLightbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
29B4A4261C43A4320060ED52 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B89E57B7A21C44D762123511 /* Pods_DemoLightbox.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0C8887567644E86396B8D885 /* Pods */ = {
isa = PBXGroup;
children = (
6096248776155BE47C0A196A /* Pods-DemoLightbox.debug.xcconfig */,
064155DBC618EBACF5C257C6 /* Pods-DemoLightbox.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
29B4A4201C43A4320060ED52 = {
isa = PBXGroup;
children = (
29B4A42B1C43A4320060ED52 /* DemoLightbox */,
29B4A42A1C43A4320060ED52 /* Products */,
B1B2B3DADEEC7FD14D4A9FF8 /* Frameworks */,
0C8887567644E86396B8D885 /* 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>";
};
B1B2B3DADEEC7FD14D4A9FF8 /* Frameworks */ = {
isa = PBXGroup;
children = (
DAE713340DA5D2F2EF13EA8D /* Pods.framework */,
EE4E898FD95F4D90F624B067 /* 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 = (
4DE126F6B5D0C8D6C0E7D848 /* [CP] Check Pods Manifest.lock */,
29B4A4251C43A4320060ED52 /* Sources */,
29B4A4261C43A4320060ED52 /* Frameworks */,
29B4A4271C43A4320060ED52 /* Resources */,
F162948C45248BBD677112BF /* [CP] Embed Pods Frameworks */,
D1AB0C213924D367899FA1A2 /* [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 = 0900;
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 */
4DE126F6B5D0C8D6C0E7D848 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-DemoLightbox-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
D1AB0C213924D367899FA1A2 /* [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;
};
F162948C45248BBD677112BF /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-DemoLightbox/Pods-DemoLightbox-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Cache/Cache.framework",
"${BUILT_PRODUCTS_DIR}/Hue/Hue.framework",
"${BUILT_PRODUCTS_DIR}/Imaginary/Imaginary.framework",
"${BUILT_PRODUCTS_DIR}/Lightbox/Lightbox.framework",
"${BUILT_PRODUCTS_DIR}/SwiftHash/SwiftHash.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cache.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Hue.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Imaginary.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lightbox.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftHash.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"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 = 4.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_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"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 = 4.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
29B4A43C1C43A4320060ED52 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 6096248776155BE47C0A196A /* 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)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
29B4A43D1C43A4320060ED52 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 064155DBC618EBACF5C257C6 /* 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)";
TARGETED_DEVICE_FAMILY = "1,2";
};
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
@objc 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: "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(
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)
}
}
-6
View File
@@ -1,6 +0,0 @@
platform :ios, '9.0'
target 'DemoLightbox' do
use_frameworks!
pod 'Lightbox', path: '../../'
end
-28
View File
@@ -1,28 +0,0 @@
PODS:
- Cache (4.0.2):
- SwiftHash (~> 2.0.0)
- Hue (3.0.0)
- Imaginary (3.0.0):
- Cache (~> 4.0)
- Lightbox (2.0.0):
- Hue (~> 3.0)
- Imaginary (~> 3.0)
- SwiftHash (2.0.0)
DEPENDENCIES:
- Lightbox (from `../../`)
EXTERNAL SOURCES:
Lightbox:
:path: ../../
SPEC CHECKSUMS:
Cache: 363b6899cee63c82ccbd291e64a6c202abc17a88
Hue: b8fe1e43eef13631331eebecb2198b68e2622f95
Imaginary: 2765d293d425cbed3b07fa11642554cbaebe913d
Lightbox: f7f1cc942d81e84d85095531208f5fe1bfd9c639
SwiftHash: d2e09b13495447178cdfb8e46e54a5c46f15f5a9
PODFILE CHECKSUM: 408ae3477507a1d4b7ff06ffb3f162eda443424f
COCOAPODS: 1.3.1
+3 -5
View File
@@ -1,20 +1,18 @@
Pod::Spec.new do |s|
s.name = "Lightbox"
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.1.0"
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, '9.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', '~> 3.0'
s.dependency 'Imaginary', '~> 3.0'
s.swift_version = '5.0'
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
end
+265 -56
View File
@@ -3,19 +3,26 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 52;
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, ); }; };
85CB007027B16C6900A47BB3 /* SDWebImage in Frameworks */ = {isa = PBXBuildFile; productRef = 85CB006F27B16C6900A47BB3 /* SDWebImage */; };
D22006741DFB4D9700E92898 /* Lightbox.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D22006731DFB4D9700E92898 /* Lightbox.bundle */; };
D2A58F5E1F7943A30064F14E /* Imaginary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2A58F5D1F7943A30064F14E /* Imaginary.framework */; };
D2258CC4215CD035005A9A1C /* Color+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2258CC3215CD035005A9A1C /* Color+Extensions.swift */; };
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 */; };
@@ -24,9 +31,40 @@
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 = (
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>"; };
D2A58F5D1F7943A30064F14E /* Imaginary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Imaginary.framework; path = Carthage/Build/iOS/Imaginary.framework; sourceTree = "<group>"; };
D2258CC3215CD035005A9A1C /* Color+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extensions.swift"; 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; };
@@ -35,7 +73,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>"; };
@@ -45,18 +82,37 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
44E6A6442495BFAB00543CF0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
44E6A6652495C0EB00543CF0 /* Lightbox.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D523B0A51C43AA2A001AD1EC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D2A58F5E1F7943A30064F14E /* Imaginary.framework in Frameworks */,
D54DFCC21C5AAAF100ADEA0E /* Hue.framework in Frameworks */,
85CB007027B16C6900A47BB3 /* SDWebImage 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 = (
@@ -68,7 +124,6 @@
D2A58F5C1F7943A30064F14E /* Frameworks */ = {
isa = PBXGroup;
children = (
D2A58F5D1F7943A30064F14E /* Imaginary.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -77,18 +132,21 @@
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>";
@@ -109,6 +167,7 @@
D523B0B61C43AA8A001AD1EC /* LightboxConfig.swift */,
D523B0B71C43AA8A001AD1EC /* LightboxController.swift */,
D5026B3B1C5BF3FD003BC1A3 /* LightboxImage.swift */,
166E3BA820333E04006799C1 /* LightboxImageStub.swift */,
D2D71BBB1D54DA77006AB907 /* AssetManager.swift */,
);
path = Source;
@@ -132,6 +191,7 @@
D573A2F41C5B5CA4006053DD /* LightboxTransition.swift */,
D573A2F21C5B5C7B006053DD /* LayoutConfigurable.swift */,
D573A2F61C5B5E55006053DD /* UIView+Gradient.swift */,
D2258CC3215CD035005A9A1C /* Color+Extensions.swift */,
);
path = Library;
sourceTree = "<group>";
@@ -149,6 +209,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" */;
@@ -157,14 +236,15 @@
D523B0A51C43AA2A001AD1EC /* Frameworks */,
D523B0A61C43AA2A001AD1EC /* Headers */,
D523B0A71C43AA2A001AD1EC /* Resources */,
D54DFCC41C5AAAF600ADEA0E /* Copy frameworks with Carthage */,
5CF8A88D1F50B4EA00C28475 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = "Lightbox-iOS";
packageProductDependencies = (
85CB006F27B16C6900A47BB3 /* SDWebImage */,
);
productName = Lightbox;
productReference = D523B0A91C43AA2A001AD1EC /* Lightbox.framework */;
productType = "com.apple.product-type.framework";
@@ -175,33 +255,52 @@
D523B0A01C43AA2A001AD1EC /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastSwiftUpdateCheck = 1150;
LastUpgradeCheck = 1320;
ORGANIZATIONNAME = "Hyper Interaktiv AS";
TargetAttributes = {
44E6A6462495BFAB00543CF0 = {
CreatedOnToolsVersion = 11.5;
ProvisioningStyle = Automatic;
};
D523B0A81C43AA2A001AD1EC = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0900;
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;
packageReferences = (
85CB006E27B16C6900A47BB3 /* XCRemoteSwiftPackageReference "SDWebImage" */,
);
productRefGroup = D523B0AA1C43AA2A001AD1EC /* Products */;
projectDirPath = "";
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;
@@ -212,40 +311,16 @@
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
5CF8A88D1F50B4EA00C28475 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
};
D54DFCC41C5AAAF600ADEA0E /* Copy frameworks with Carthage */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(SRCROOT)/Carthage/Build/iOS/Hue.framework",
"$(SRCROOT)/Carthage/Build/iOS/Imaginary.framework",
"$(SRCROOT)/Carthage/Build/iOS/Cache.framework",
);
name = "Copy frameworks with Carthage";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/usr/local/bin/carthage copy-frameworks";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
44E6A6432495BFAB00543CF0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
44E6A65C2495BFD400543CF0 /* ViewController.swift in Sources */,
44E6A64A2495BFAB00543CF0 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D523B0A41C43AA2A001AD1EC /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -261,17 +336,101 @@
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 = 12.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 = 12.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;
@@ -280,14 +439,17 @@
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;
@@ -313,12 +475,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -329,6 +491,7 @@
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;
@@ -337,14 +500,17 @@
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;
@@ -364,11 +530,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
@@ -390,11 +557,18 @@
);
INFOPLIST_FILE = Lightbox/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.Lightbox;
PRODUCT_NAME = Lightbox;
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
@@ -412,17 +586,33 @@
);
INFOPLIST_FILE = Lightbox/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.Lightbox;
PRODUCT_NAME = Lightbox;
SKIP_INSTALL = YES;
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 = (
@@ -442,6 +632,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
85CB006E27B16C6900A47BB3 /* XCRemoteSwiftPackageReference "SDWebImage" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SDWebImage/SDWebImage.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
85CB006F27B16C6900A47BB3 /* SDWebImage */ = {
isa = XCSwiftPackageProductDependency;
package = 85CB006E27B16C6900A47BB3 /* XCRemoteSwiftPackageReference "SDWebImage" */;
productName = SDWebImage;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = D523B0A01C43AA2A001AD1EC /* Project object */;
}
@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:Lightbox.xcodeproj">
location = "self:">
</FileRef>
</Workspace>
@@ -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 = "0900"
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,18 +26,35 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
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"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -53,8 +70,6 @@
ReferencedContainer = "container:Lightbox.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
+20
View File
@@ -0,0 +1,20 @@
// swift-tools-version:5.1
import PackageDescription
let package = Package(
name: "Lightbox",
products: [
.library(
name: "Lightbox",
targets: ["Lightbox"]),
],
dependencies: [],
targets: [
.target(
name: "Lightbox",
dependencies: [],
path: "Source"
)
],
swiftLanguageVersions: [.v5]
)
+1 -1
View File
@@ -110,7 +110,7 @@ extension ViewController: LightboxControllerDismissalDelegate: class {
### Image loading
By default images are loaded using [Imagary](https://github.com/hyperoslo/Imaginary) for reliable loading and caching. But it's easy to change this behavior using **LightboxConfig**
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 = {
+27
View File
@@ -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)
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
protocol LayoutConfigurable: class {
protocol LayoutConfigurable: AnyObject {
@MainActor
func configureLayout()
}
+7 -7
View File
@@ -96,11 +96,11 @@ class LightboxTransition: UIPercentDrivenInteractiveTransition {
extension LightboxTransition: UIViewControllerAnimatedTransitioning {
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
func transitionDuration(using transitionContext: (any UIViewControllerContextTransitioning)?) -> TimeInterval {
return 0.25
}
func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
func animateTransition(using transitionContext: any UIViewControllerContextTransitioning) {
let container = transitionContext.containerView
guard let fromView = transitionContext.view(forKey: UITransitionContextViewKey.from),
@@ -133,23 +133,23 @@ extension LightboxTransition: UIViewControllerAnimatedTransitioning {
extension LightboxTransition: UIViewControllerTransitioningDelegate {
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
func animationController(forDismissed dismissed: UIViewController) -> (any UIViewControllerAnimatedTransitioning)? {
dismissing = true
return self
}
func animationController(forPresented presented: UIViewController,
presenting: UIViewController,
source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
source: UIViewController) -> (any UIViewControllerAnimatedTransitioning)? {
dismissing = false
return self
}
func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
func interactionControllerForDismissal(using animator: any UIViewControllerAnimatedTransitioning) -> (any UIViewControllerInteractiveTransitioning)? {
return interactive ? self : nil
}
func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
func interactionControllerForPresentation(using animator: any UIViewControllerAnimatedTransitioning) -> (any UIViewControllerInteractiveTransitioning)? {
return interactive ? self : nil
}
}
@@ -163,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
}
}
+15 -20
View File
@@ -1,14 +1,15 @@
import UIKit
import Hue
import AVKit
import AVFoundation
import Imaginary
public class LightboxConfig {
/// Whether to show status bar while Lightbox is presented
public static var hideStatusBar = true
public static var imageBackgroundColor = UIColor.black
/// Provide a closure to handle selected video
@MainActor
public static var handleVideo: (_ from: UIViewController, _ videoURL: URL) -> Void = { from, videoURL in
let videoController = AVPlayerViewController()
videoController.player = AVPlayer(url: videoURL)
@@ -18,31 +19,25 @@ public 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)
}
})
}
/// How to load image onto SDAnimatedImageView
public static var loadImage: ((UIImageView, URL, ((UIImage?) -> Void)?) -> Void)?
/// Indicator is used to show while image is being fetched
@MainActor
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: [NSAttributedStringKey: Any] = [
public static var textAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 12),
.foregroundColor: UIColor(hex: "899AB8"),
.paragraphStyle: {
@@ -59,7 +54,7 @@ public class LightboxConfig {
public static var text = NSLocalizedString("Close", comment: "")
public static var image: UIImage?
public static var textAttributes: [NSAttributedStringKey: Any] = [
public static var textAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.boldSystemFont(ofSize: 16),
.foregroundColor: UIColor.white,
.paragraphStyle: {
@@ -76,7 +71,7 @@ public class LightboxConfig {
public static var text = NSLocalizedString("Delete", comment: "")
public static var image: UIImage?
public static var textAttributes: [NSAttributedStringKey: Any] = [
public static var textAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.boldSystemFont(ofSize: 16),
.foregroundColor: UIColor(hex: "FA2F5B"),
.paragraphStyle: {
@@ -93,7 +88,7 @@ public class LightboxConfig {
public static var ellipsisText = NSLocalizedString("Show more", comment: "")
public static var ellipsisColor = UIColor(hex: "899AB9")
public static var textAttributes: [NSAttributedStringKey: Any] = [
public static var textAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 12),
.foregroundColor: UIColor(hex: "DBDBDB")
]
+101 -36
View File
@@ -1,21 +1,32 @@
import UIKit
import Hue
public protocol LightboxControllerPageDelegate: class {
public protocol LightboxControllerPageDelegate: AnyObject {
@MainActor
func lightboxController(_ controller: LightboxController, didMoveToPage page: Int)
}
public protocol LightboxControllerDismissalDelegate: class {
public protocol LightboxControllerDismissalDelegate: AnyObject {
@MainActor
func lightboxControllerWillDismiss(_ controller: LightboxController)
}
public protocol LightboxControllerTouchDelegate: class {
public protocol LightboxControllerTouchDelegate: AnyObject {
@MainActor
func lightboxController(_ controller: LightboxController, didTouch image: LightboxImage, at index: Int)
}
public protocol LightboxControllerTapDelegate: AnyObject {
@MainActor
func lightboxController(_ controller: LightboxController, didTap image: LightboxImage, at index: Int)
@MainActor
func lightboxController(_ controller: LightboxController, didDoubleTap image: LightboxImage, at index: Int)
}
public protocol LightboxControllerDeleteDelegate: AnyObject {
@MainActor
func lightboxController(_ controller: LightboxController, willDeleteAt index: Int)
}
open class LightboxController: UIViewController {
// MARK: - Internal views
@@ -25,7 +36,7 @@ open class LightboxController: UIViewController {
scrollView.isPagingEnabled = false
scrollView.delegate = self
scrollView.showsHorizontalScrollIndicator = false
scrollView.decelerationRate = UIScrollViewDecelerationRateFast
scrollView.decelerationRate = UIScrollView.DecelerationRate.fast
return scrollView
}()
@@ -71,7 +82,7 @@ open class LightboxController: UIViewController {
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.alpha = 0
@@ -91,6 +102,8 @@ open class LightboxController: UIViewController {
seen = true
}
reconfigurePagesForPreload()
pageDelegate?.lightboxController(self, didMoveToPage: currentPage)
if let image = pageViews[currentPage].imageView.image, dynamicBackground {
@@ -121,7 +134,7 @@ open class LightboxController: UIViewController {
open var spacing: CGFloat = 20 {
didSet {
configureLayout()
configureLayout(view.bounds.size)
}
}
@@ -130,13 +143,16 @@ 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 weak var pageDelegate: (any LightboxControllerPageDelegate)?
open weak var dismissalDelegate: (any LightboxControllerDismissalDelegate)?
open weak var imageTouchDelegate: (any LightboxControllerTouchDelegate)?
open weak var imageTapDelegate: (any LightboxControllerTapDelegate)?
open weak var imageDeleteDelegate: (any LightboxControllerDeleteDelegate)?
open internal(set) var presented = false
open fileprivate(set) var seen = false
@@ -144,7 +160,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,9 +180,13 @@ 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
view.backgroundColor = LightboxConfig.imageBackgroundColor
transitionManager.lightboxController = self
transitionManager.scrollView = scrollView
transitioningDelegate = transitionManager
@@ -175,36 +195,35 @@ open class LightboxController: UIViewController {
overlayView.addGestureRecognizer(overlayTapGestureRecognizer)
configurePages(initialImages)
currentPage = initialPage
goTo(currentPage, animated: false)
}
open override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if !presented {
presented = true
configureLayout()
}
goTo(initialPage, animated: false)
}
open override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
scrollView.frame = view.bounds
footerView.frame = CGRect(
x: 0,
y: view.bounds.height - footerView.frame.height,
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
)
if !presented {
presented = true
configureLayout(view.bounds.size)
}
}
open override var prefersStatusBarHidden: Bool {
@@ -213,7 +232,7 @@ open class LightboxController: UIViewController {
// MARK: - Rotation
override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
override open func viewWillTransition(to size: CGSize, with coordinator: any UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
coordinator.animate(alongsideTransition: { _ in
@@ -227,15 +246,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
@@ -271,7 +309,7 @@ open class LightboxController: UIViewController {
// MARK: - Layout
open func configureLayout(_ size: CGSize = UIApplication.shared.delegate?.window??.bounds.size ?? .zero) {
open func configureLayout(_ size: CGSize) {
scrollView.frame.size = size
scrollView.contentSize = CGSize(
width: size.width * CGFloat(numberOfPages) + spacing * CGFloat(numberOfPages - 1),
@@ -296,7 +334,7 @@ open class LightboxController: UIViewController {
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) {
@@ -310,6 +348,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
@@ -335,7 +389,7 @@ extension LightboxController: UIScrollViewDelegate {
}
targetContentOffset.pointee.x = x
currentPage = Int(x / view.bounds.width)
currentPage = Int(x / pageWidth)
}
}
@@ -373,6 +427,14 @@ extension LightboxController: PageViewDelegate {
let visible = (headerView.alpha == 1.0)
toggleControls(pageView: pageView, visible: !visible)
}
func pageViewDidTap(_ pageView: PageView) {
imageTapDelegate?.lightboxController(self, didTap: images[currentPage], at: currentPage)
}
func pageViewDidDoubleTap(_ pageView: PageView) {
imageTapDelegate?.lightboxController(self, didDoubleTap: images[currentPage], at: currentPage)
}
}
// MARK: - HeaderViewDelegate
@@ -382,6 +444,8 @@ extension LightboxController: HeaderViewDelegate {
func headerView(_ headerView: HeaderView, didPressDeleteButton deleteButton: UIButton) {
deleteButton.isEnabled = false
imageDeleteDelegate?.lightboxController(self, willDeleteAt: currentPage)
guard numberOfPages != 1 else {
pageViews.removeAll()
self.headerView(headerView, didPressCloseButton: headerView.closeButton)
@@ -397,10 +461,11 @@ extension LightboxController: HeaderViewDelegate {
currentPage -= 1
}
self.initialImages.remove(at: prevIndex)
self.pageViews.remove(at: prevIndex).removeFromSuperview()
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
self.configureLayout()
self.configureLayout(self.view.bounds.size)
self.currentPage = Int(self.scrollView.contentOffset.x / self.view.bounds.width)
deleteButton.isEnabled = true
}
+26 -2
View File
@@ -1,15 +1,19 @@
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
@@ -22,12 +26,32 @@ open class LightboxImage {
self.videoURL = videoURL
}
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, completion)
guard let loadImage = LightboxConfig.loadImage else {
print("Lightbox: To use `imageURL`, you must use `LightboxConfig.loadImage`.")
imageView.image = nil
completion?(nil)
return
}
loadImage(imageView, imageURL, completion)
} else if let imageClosure = imageClosure {
let img = imageClosure()
imageView.image = img
completion?(img)
} else {
imageView.image = nil
completion?(nil)
}
}
}
+10
View File
@@ -0,0 +1,10 @@
import UIKit
internal class LightboxImageStub: LightboxImage {
// MARK: - Initialization
init () {
super.init()
}
}
+4 -4
View File
@@ -1,7 +1,7 @@
import UIKit
public protocol FooterViewDelegate: class {
public protocol FooterViewDelegate: AnyObject {
@MainActor
func footerView(_ footerView: FooterView, didExpand expanded: Bool)
}
@@ -34,8 +34,8 @@ open class FooterView: UIView {
return view
}()
let gradientColors = [UIColor(hex: "040404").alpha(0.1), UIColor(hex: "040404")]
open weak var delegate: FooterViewDelegate?
let gradientColors = [UIColor(hex: "040404").withAlphaComponent(0.1), UIColor(hex: "040404")]
open weak var delegate: (any FooterViewDelegate)?
// MARK: - Initializers
+8 -6
View File
@@ -1,7 +1,9 @@
import UIKit
protocol HeaderViewDelegate: class {
protocol HeaderViewDelegate: AnyObject {
@MainActor
func headerView(_ headerView: HeaderView, didPressDeleteButton deleteButton: UIButton)
@MainActor
func headerView(_ headerView: HeaderView, didPressCloseButton closeButton: UIButton)
}
@@ -13,7 +15,7 @@ open class HeaderView: UIView {
let button = UIButton(type: .system)
button.setAttributedTitle(title, for: UIControlState())
button.setAttributedTitle(title, for: UIControl.State())
if let size = LightboxConfig.CloseButton.size {
button.frame.size = size
@@ -25,7 +27,7 @@ open class HeaderView: UIView {
for: .touchUpInside)
if let image = LightboxConfig.CloseButton.image {
button.setBackgroundImage(image, for: UIControlState())
button.setBackgroundImage(image, for: UIControl.State())
}
button.isHidden = !LightboxConfig.CloseButton.enabled
@@ -52,7 +54,7 @@ open class HeaderView: UIView {
for: .touchUpInside)
if let image = LightboxConfig.DeleteButton.image {
button.setBackgroundImage(image, for: UIControlState())
button.setBackgroundImage(image, for: UIControl.State())
}
button.isHidden = !LightboxConfig.DeleteButton.enabled
@@ -60,7 +62,7 @@ open class HeaderView: UIView {
return button
}()
weak var delegate: HeaderViewDelegate?
weak var delegate: (any HeaderViewDelegate)?
// MARK: - Initializers
@@ -104,7 +106,7 @@ extension HeaderView: LayoutConfigurable {
x: bounds.width - closeButton.frame.width - 17,
y: topPadding
)
deleteButton.frame.origin = CGPoint(
x: 17,
y: topPadding
+13 -8
View File
@@ -1,7 +1,7 @@
import UIKit
public protocol InfoLabelDelegate: class {
public protocol InfoLabelDelegate: AnyObject {
@MainActor
func infoLabel(_ infoLabel: InfoLabel, didExpand expanded: Bool)
}
@@ -20,7 +20,7 @@ open class InfoLabel: UILabel {
return "... \(LightboxConfig.InfoLabel.ellipsisText)"
}
open weak var delegate: InfoLabelDelegate?
open weak var delegate: (any InfoLabelDelegate)?
fileprivate var shortText = ""
var fullText: String {
@@ -41,7 +41,7 @@ open class InfoLabel: UILabel {
}
}
fileprivate var truncatedText: String {
var truncatedText: String {
var truncatedText = fullText
guard numberOfLines(fullText) > numberOfVisibleLines else {
@@ -60,8 +60,13 @@ open class InfoLabel: UILabel {
// Remove characters ahead of ellipsis until the text is the right number of lines
while numberOfLines(truncatedText) > numberOfVisibleLines {
truncatedTextCursor = truncatedText.index(before: truncatedTextCursor)
truncatedText.remove(at: truncatedTextCursor)
// To avoid "Cannot decrement before startIndex"
guard truncatedTextCursor > truncatedText.startIndex else {
break
}
truncatedTextCursor = truncatedText.index(before: truncatedTextCursor)
truncatedText.remove(at: truncatedTextCursor)
}
return truncatedText
@@ -124,12 +129,12 @@ open class InfoLabel: UILabel {
return string.boundingRect(
with: CGSize(width: bounds.size.width, height: CGFloat.greatestFiniteMagnitude),
options: [.usesLineFragmentOrigin, .usesFontLeading],
attributes: [NSAttributedStringKey.font: font],
attributes: [NSAttributedString.Key.font: font!],
context: nil).height
}
fileprivate func numberOfLines(_ string: String) -> Int {
let lineHeight = "A".size(withAttributes: [NSAttributedStringKey.font: font]).height
let lineHeight = "A".size(withAttributes: [NSAttributedString.Key.font: font!]).height
let totalHeight = heightForString(string)
return Int(totalHeight / lineHeight)
+1 -1
View File
@@ -13,7 +13,7 @@ class LoadingIndicator: UIView {
alpha = 0
indicator = UIActivityIndicatorView()
indicator.activityIndicatorViewStyle = .whiteLarge
indicator.style = .whiteLarge
indicator.startAnimating()
addSubview(indicator)
+60 -22
View File
@@ -1,12 +1,18 @@
import UIKit
protocol PageViewDelegate: class {
protocol PageViewDelegate: AnyObject {
@MainActor
func pageViewDidZoom(_ pageView: PageView)
@MainActor
func remoteImageDidLoad(_ image: UIImage?, imageView: UIImageView)
@MainActor
func pageView(_ pageView: PageView, didTouchPlayButton videoURL: URL)
@MainActor
func pageViewDidTouch(_ pageView: PageView)
}
@MainActor
func pageViewDidTap(_ pageView: PageView)
@MainActor
func pageViewDidDoubleTap(_ pageView: PageView)}
class PageView: UIScrollView {
@@ -22,8 +28,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
@@ -37,7 +55,7 @@ class PageView: UIScrollView {
var image: LightboxImage
var contentFrame = CGRect.zero
weak var pageViewDelegate: PageViewDelegate?
weak var pageViewDelegate: (any PageViewDelegate)?
var hasZoomed: Bool {
return zoomScale != 1.0
@@ -51,20 +69,7 @@ class PageView: UIScrollView {
configure()
loadingIndicator.alpha = 1
self.image.addImageTo(imageView) { [weak self] image in
guard let strongSelf = self else {
return
}
strongSelf.isUserInteractionEnabled = true
strongSelf.configureImageView()
strongSelf.pageViewDelegate?.remoteImageDidLoad(image, imageView: strongSelf.imageView)
UIView.animate(withDuration: 0.4) {
strongSelf.loadingIndicator.alpha = 0
}
}
fetchImage()
}
required init?(coder aDecoder: NSCoder) {
@@ -76,9 +81,7 @@ class PageView: UIScrollView {
func configure() {
addSubview(imageView)
if image.videoURL != nil {
addSubview(playButton)
}
updatePlayButton()
addSubview(loadingIndicator)
@@ -100,6 +103,39 @@ 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
@objc func scrollViewDoubleTapped(_ recognizer: UITapGestureRecognizer) {
@@ -116,10 +152,12 @@ class PageView: UIScrollView {
let rectToZoomTo = CGRect(x: x, y: y, width: width, height: height)
zoom(to: rectToZoomTo, animated: true)
pageViewDelegate?.pageViewDidDoubleTap(self)
}
@objc func viewTapped(_ recognizer: UITapGestureRecognizer) {
pageViewDelegate?.pageViewDidTouch(self)
pageViewDelegate?.pageViewDidTap(self)
}
// MARK: - Layout
+18
View File
@@ -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
}
}
+6
View File
@@ -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>
+67
View File
@@ -0,0 +1,67 @@
import UIKit
import Lightbox
import SDWebImage
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"
LightboxConfig.preload = 2
LightboxConfig.loadImage = { imageView, url, completion in
imageView.sd_setImage(with: url) { image, _, _ , _ in
completion?(image)
}
}
}
// MARK: - Action methods
@objc func showLightbox() {
let images = [
LightboxImage(imageURL: URL(string: "https://media.giphy.com/media/Ku65904QQe4yez448B/giphy.gif")!),
LightboxImage(imageURL: URL(string: "https://media.giphy.com/media/lQDLwWUMPaAHvh8pAG/giphy.gif")!),
LightboxImage(imageURL: URL(string: "https://media.giphy.com/media/ontKwPWJxARsuKaKqJ/giphy.gif")!),
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."
),
LightboxImage(imageURL: URL(string: "https://c.tenor.com/kccsHXtdDn0AAAAC/alcohol-wine.gif")!)
]
let controller = LightboxController(images: images)
controller.dynamicBackground = true
present(controller, animated: true, completion: nil)
}
}