Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2
5.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: swift
osx_image: xcode10
osx_image: xcode10.2

before_script: pod repo update
script: travis_wait pod lib lint --allow-warnings
Expand Down
13 changes: 11 additions & 2 deletions AXPhotoViewer.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AXPhotoViewer"
s.version = "1.6.1"
s.version = "1.7.1"
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
s.summary = "An iOS/tvOS photo gallery viewer, useful for viewing a large number of photos."
s.homepage = "https://github.com/alexhillc/AXPhotoViewer"
Expand Down Expand Up @@ -29,31 +29,40 @@ Pod::Spec.new do |s|
end

s.subspec 'SDWebImage' do |ss|
ss.ios.deployment_target = '8.0'
ss.tvos.deployment_target = '9.0'
ss.dependency 'AXPhotoViewer/Core'
ss.dependency 'SDWebImage', '>= 4.0.0'
ss.source_files = 'Source/Integrations/SDWebImageIntegration.swift'
end

s.subspec 'PINRemoteImage' do |ps|
ps.ios.deployment_target = '8.0'
ps.tvos.deployment_target = '9.0'
ps.dependency 'AXPhotoViewer/Core'
ps.dependency 'PINRemoteImage', '~> 3.0.0-beta.9'
ps.source_files = 'Source/Integrations/PINRemoteImageIntegration.swift'
end

s.subspec 'AFNetworking' do |as|
as.ios.deployment_target = '8.0'
as.tvos.deployment_target = '9.0'
as.dependency 'AXPhotoViewer/Core'
as.dependency 'AFNetworking/NSURLSession', '>= 3.1.0'
as.source_files = 'Source/Integrations/AFNetworkingIntegration.swift'
end

s.subspec 'Kingfisher' do |ks|
ks.ios.deployment_target = '10.0'
ks.tvos.deployment_target = '10.0'
ks.dependency 'AXPhotoViewer/Core'
ks.dependency 'Kingfisher', '>= 3.10.0'
ks.source_files = 'Source/Integrations/KingfisherIntegration.swift'
end

s.subspec 'Nuke' do |nk|
nk.ios.deployment_target = '9.0'
nk.ios.deployment_target = '10.0'
nk.tvos.deployment_target = '10.0'
nk.dependency 'AXPhotoViewer/Core'
nk.dependency 'Nuke', '>= 7.0'
nk.source_files = 'Source/Integrations/NukeIntegration.swift'
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.7.1
- [**NEW**] Better RTL support on device locales that support RTL (further support will require a refactor using AutoLayout)
- [**FIXED**] KingfisherIntegration was out of date #55

# 1.7.0
- Requires Swift 5.0

# 1.6.1
- [**FIXED**] When captionView layout occurred more than once while animation was occurring, new captions would be applied mid animation

Expand Down
14 changes: 6 additions & 8 deletions Example/iOS/AXPhotoViewerExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@
TargetAttributes = {
FA8359D51EC01BD500B256C2 = {
CreatedOnToolsVersion = 8.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = FA8359D11EC01BD500B256C2 /* Build configuration list for PBXProject "AXPhotoViewerExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -164,7 +164,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-AXPhotoViewerExample/Pods-AXPhotoViewerExample-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-AXPhotoViewerExample/Pods-AXPhotoViewerExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AXPhotoViewer/AXPhotoViewer.framework",
"${BUILT_PRODUCTS_DIR}/AXStateButton/AXStateButton.framework",
"${BUILT_PRODUCTS_DIR}/DRPLoadingSpinner/DRPLoadingSpinner.framework",
Expand All @@ -187,7 +187,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AXPhotoViewerExample/Pods-AXPhotoViewerExample-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AXPhotoViewerExample/Pods-AXPhotoViewerExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FAF414F9A9C922FCB012523A /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -358,8 +358,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.bawkbawk.AXPhotoViewerExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -373,8 +372,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.bawkbawk.AXPhotoViewerExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Example/iOS/AXPhotoViewerExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = TableViewController()
self.window?.makeKeyAndVisible()
Expand Down
16 changes: 4 additions & 12 deletions Example/iOS/AXPhotoViewerExample/TableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ class TableViewController: UITableViewController, AXPhotosViewControllerDelegate
}

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: ReuseIdentifier) else {
return UITableViewCell()
}
guard let cell = tableView.dequeueReusableCell(withIdentifier: ReuseIdentifier) else { return UITableViewCell() }

// sample project worst practices top kek
if cell.contentView.viewWithTag(666) == nil {
Expand All @@ -143,9 +141,7 @@ class TableViewController: UITableViewController, AXPhotosViewControllerDelegate
}

override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
guard let imageView = cell.contentView.viewWithTag(666) as? FLAnimatedImageView else {
return
}
guard let imageView = cell.contentView.viewWithTag(666) as? FLAnimatedImageView else { return }

self.cancelLoad(at: indexPath, for: imageView)
self.loadContent(at: indexPath, into: imageView)
Expand All @@ -156,14 +152,10 @@ class TableViewController: UITableViewController, AXPhotosViewControllerDelegate
let imageView = cell?.contentView.viewWithTag(666) as? FLAnimatedImageView

let transitionInfo = AXTransitionInfo(interactiveDismissalEnabled: true, startingView: imageView) { [weak self] (photo, index) -> UIImageView? in
guard let `self` = self else {
return nil
}
guard let `self` = self else { return nil }

let indexPath = IndexPath(row: index, section: 0)
guard let cell = self.tableView.cellForRow(at: indexPath) else {
return nil
}
guard let cell = self.tableView.cellForRow(at: indexPath) else { return nil }

// adjusting the reference view attached to our transition info to allow for contextual animation
return cell.contentView.viewWithTag(666) as? FLAnimatedImageView
Expand Down
8 changes: 4 additions & 4 deletions Example/iOS/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- AXPhotoViewer/Core (1.5.0):
- AXPhotoViewer/Core (1.7.0):
- AXStateButton (>= 1.1.3)
- FLAnimatedImage (>= 1.0.0)
- FLAnimatedImage-tvOS (>= 1.0.16)
- AXPhotoViewer/PINRemoteImage (1.5.0):
- AXPhotoViewer/PINRemoteImage (1.7.0):
- AXPhotoViewer/Core
- PINRemoteImage (~> 3.0.0-beta.9)
- AXStateButton (1.1.4)
Expand Down Expand Up @@ -53,7 +53,7 @@ EXTERNAL SOURCES:
:path: "../../AXPhotoViewer.podspec"

SPEC CHECKSUMS:
AXPhotoViewer: b21480ab848dea4d13b14a232b2d2fe378937577
AXPhotoViewer: 530af2fdd8eca4336f509c4c3463826b3f12a4c2
AXStateButton: 6c515a433e37551505046429b5be04c12daa8c07
DRPLoadingSpinner: 725e530bf4ebe2cc351b1fbc94d24fe8ac3300fd
FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
Expand All @@ -64,4 +64,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 6f4a81711307afc468e5f3e553aeb2549b5e1280

COCOAPODS: 1.5.3
COCOAPODS: 1.6.1
5 changes: 3 additions & 2 deletions Example/tvOS/AXPhotoViewerExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
TargetAttributes = {
FA983C20205B1374006C2399 = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -330,7 +331,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.boop.AXPhotoViewerExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
};
name = Debug;
Expand All @@ -347,7 +348,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.boop.AXPhotoViewerExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
};
name = Release;
Expand Down
3 changes: 1 addition & 2 deletions Example/tvOS/AXPhotoViewerExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
let cacheSizeMemory = 1024 * 1024 * 200
let cacheSizeDisk = 1024 * 1024 * 200
let sharedCache = URLCache(memoryCapacity: cacheSizeMemory, diskCapacity: cacheSizeDisk, diskPath: nil)
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This project is unmaintained.
## Alex passed away in an accident in late 2019. His love of iOS development will always be remembered.

# AXPhotoViewer [![Build Status](https://travis-ci.org/alexhillc/AXPhotoViewer.svg?branch=master)](https://travis-ci.org/alexhillc/AXPhotoViewer)

<p align="center">
Expand Down
4 changes: 1 addition & 3 deletions Source/Classes/Models/AXTransitionInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@

if let endingView = endingView {
self.resolveEndingViewClosure = { [weak self] (photo, index) in
guard let `self` = self else {
return
}
guard let `self` = self else { return }

if let endingView = endingView(photo, index) {
guard endingView.bounds != .zero else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ class AXPhotosDismissalAnimator: AXPhotosTransitionAnimator, UIViewControllerInt

var offscreenImageViewCenter: CGPoint?
let scaleAnimations = { [weak self] () in
guard let `self` = self else {
return
}
guard let `self` = self else { return }

if self.canPerformContextualDismissal() {
let endingView = self.transitionInfo.endingView!
Expand All @@ -173,9 +171,7 @@ class AXPhotosDismissalAnimator: AXPhotosTransitionAnimator, UIViewControllerInt
}

let scaleCompletion = { [weak self] (_ finished: Bool) in
guard let `self` = self else {
return
}
guard let `self` = self else { return }

self.delegate?.transitionAnimator(self, didCompleteDismissalWith: imageViewContainer.imageView)

Expand Down Expand Up @@ -414,10 +410,8 @@ class AXPhotosDismissalAnimator: AXPhotosTransitionAnimator, UIViewControllerInt

let overlayView = photosViewController.overlayView
let animations = { [weak self] () in
guard let `self` = self else {
return
}

guard let `self` = self else { return }

imageView.center.y = self.imageViewInitialCenter.y
overlayView.topStackContainer.frame.origin.y = self.topStackContainerInitialOriginY
overlayView.bottomStackContainer.frame.origin.y = self.bottomStackContainerInitialOriginY
Expand All @@ -426,9 +420,7 @@ class AXPhotosDismissalAnimator: AXPhotosTransitionAnimator, UIViewControllerInt
}

let completion = { [weak self] (_ finished: Bool) in
guard let `self` = self else {
return
}
guard let `self` = self else { return }

if self.canPerformContextualDismissal() {
guard let referenceView = self.transitionInfo.endingView else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ class AXPhotosPresentationAnimator: AXPhotosTransitionAnimator {
}

let scaleCompletion = { [weak self] (_ finished: Bool) in
guard let `self` = self else {
return
}
guard let `self` = self else { return }

self.delegate?.transitionAnimator(self, didCompletePresentationWith: startingViewContainer.imageView)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ class AXPhotosTransitionController: NSObject, UIViewControllerTransitioningDeleg
return nil
}

guard let photo = photosViewController.dataSource.photo(at: photosViewController.currentPhotoIndex) else {
return nil
}
guard let photo = photosViewController.dataSource.photo(at: photosViewController.currentPhotoIndex) else { return nil }

// resolve transitionInfo's endingView
self.transitionInfo.resolveEndingViewClosure?(photo, photosViewController.currentPhotoIndex)
Expand Down
10 changes: 2 additions & 8 deletions Source/Classes/View Controllers/AXPhotoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ import FLAnimatedImage_tvOS
resetImageView()
let error = photo.ax_error ?? NSError()
self.loadingView?.showError(error, retryHandler: { [weak self] in
guard let `self` = self else {
return
}

guard let `self` = self else { return }
self.delegate?.photoViewController(self, retryDownloadFor: photo)
self.loadingView?.removeError()
self.loadingView?.startLoading(initialProgress: photo.ax_progress)
Expand Down Expand Up @@ -173,10 +170,7 @@ import FLAnimatedImage_tvOS
self.zoomingImageView.imageView.ax_syncFrames(with: referenceView)
} else if let error = userInfo[AXPhotosViewControllerNotification.ErrorKey] as? Error {
self.loadingView?.showError(error, retryHandler: { [weak self] in
guard let `self` = self, let photo = self.photo else {
return
}

guard let `self` = self, let photo = self.photo else { return }
self.delegate?.photoViewController(self, retryDownloadFor: photo)
self.loadingView?.removeError()
self.loadingView?.startLoading(initialProgress: photo.ax_progress)
Expand Down
Loading