Skip to content

Commit

Permalink
chore: release version 4.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenceLove committed Jul 30, 2023
1 parent 21fb7d6 commit be658b3
Show file tree
Hide file tree
Showing 29 changed files with 283 additions and 101 deletions.
2 changes: 1 addition & 1 deletion HXPhotoPicker-Lite.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "HXPhotoPicker-Lite"
spec.version = "4.0.3"
spec.version = "4.0.4"
spec.summary = "Photo selector - Support LivePhoto, GIF selection"
spec.homepage = "https://github.com/SilenceLove/HXPhotoPicker"
spec.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
2 changes: 1 addition & 1 deletion HXPhotoPicker.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "HXPhotoPicker"
spec.version = "4.0.3"
spec.version = "4.0.4"
spec.summary = "照片/视频选择器 - 支持LivePhoto、GIF图片选择、自定义编辑照片/视频、3DTouch预览、浏览网络图片/网络视频 功能 - Imitation weibo photo/image picker - support for LivePhoto, GIF image selection, 3DTouch preview, browse the web image function"
spec.homepage = "https://github.com/SilenceLove/HXPhotoPicker"
spec.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
4 changes: 2 additions & 2 deletions HXPhotoPickerExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4.0.3;
MARKETING_VERSION = 4.0.4;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -2351,7 +2351,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4.0.3;
MARKETING_VERSION = 4.0.4;
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
Expand Down
44 changes: 22 additions & 22 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
PODS:
- HXPhotoPicker (4.0.3):
- HXPhotoPicker/Full (= 4.0.3)
- HXPhotoPicker/Camera (4.0.3):
- HXPhotoPicker/Camera/Lite (= 4.0.3)
- HXPhotoPicker/Camera/Location (= 4.0.3)
- HXPhotoPicker/Camera/Lite (4.0.3):
- HXPhotoPicker (4.0.4):
- HXPhotoPicker/Full (= 4.0.4)
- HXPhotoPicker/Camera (4.0.4):
- HXPhotoPicker/Camera/Lite (= 4.0.4)
- HXPhotoPicker/Camera/Location (= 4.0.4)
- HXPhotoPicker/Camera/Lite (4.0.4):
- HXPhotoPicker/Core
- HXPhotoPicker/Camera/Location (4.0.3):
- HXPhotoPicker/Camera/Location (4.0.4):
- HXPhotoPicker/Camera/Lite
- HXPhotoPicker/Core (4.0.3)
- HXPhotoPicker/Editor (4.0.3):
- HXPhotoPicker/Editor/KF (= 4.0.3)
- HXPhotoPicker/Editor/Lite (= 4.0.3)
- HXPhotoPicker/Editor/KF (4.0.3):
- HXPhotoPicker/Core (4.0.4)
- HXPhotoPicker/Editor (4.0.4):
- HXPhotoPicker/Editor/KF (= 4.0.4)
- HXPhotoPicker/Editor/Lite (= 4.0.4)
- HXPhotoPicker/Editor/KF (4.0.4):
- HXPhotoPicker/Editor/Lite
- HXPhotoPicker/EditorView/KF
- Kingfisher (~> 7.0)
- HXPhotoPicker/Editor/Lite (4.0.3):
- HXPhotoPicker/Editor/Lite (4.0.4):
- HXPhotoPicker/EditorView/Lite
- HXPhotoPicker/EditorView/KF (4.0.3):
- HXPhotoPicker/EditorView/KF (4.0.4):
- HXPhotoPicker/EditorView/Lite
- Kingfisher (~> 7.0)
- HXPhotoPicker/EditorView/Lite (4.0.3):
- HXPhotoPicker/EditorView/Lite (4.0.4):
- HXPhotoPicker/Core
- HXPhotoPicker/Full (4.0.3):
- HXPhotoPicker/Full (4.0.4):
- HXPhotoPicker/Camera
- HXPhotoPicker/Editor
- HXPhotoPicker/Picker
- HXPhotoPicker/Picker (4.0.3):
- HXPhotoPicker/Picker/KF (= 4.0.3)
- HXPhotoPicker/Picker/Lite (= 4.0.3)
- HXPhotoPicker/Picker/KF (4.0.3):
- HXPhotoPicker/Picker (4.0.4):
- HXPhotoPicker/Picker/KF (= 4.0.4)
- HXPhotoPicker/Picker/Lite (= 4.0.4)
- HXPhotoPicker/Picker/KF (4.0.4):
- HXPhotoPicker/Picker/Lite
- Kingfisher (~> 7.0)
- HXPhotoPicker/Picker/Lite (4.0.3):
- HXPhotoPicker/Picker/Lite (4.0.4):
- HXPhotoPicker/Core
- Kingfisher (7.8.0)

Expand All @@ -49,7 +49,7 @@ EXTERNAL SOURCES:
:path: "./"

SPEC CHECKSUMS:
HXPhotoPicker: 08306e6c09e4777205fb07320adf88c03a080682
HXPhotoPicker: 66b395a1248bed42cc4c3b0a89c40197fa11a99c
Kingfisher: 0656e1b064bfc1ca1cd04e033f617a86559696e9

PODFILE CHECKSUM: 576bacf77cf4ff94e5d1c0f663045b965805de0a
Expand Down
4 changes: 2 additions & 2 deletions Pods/Local Podspecs/HXPhotoPicker.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ extension PHAssetCollection: HXPickerCompatible {
}else if versionStr.count <= 2 {
versionStr.append("0")
}
let version = Int(versionStr) ?? 0
let version: Int
if let index = Int(versionStr) {
version = index
}else {
version = 0
}
if version >= 800 && version <= 802 {
return assetCollectionSubtype == .smartAlbumRecentlyAdded
}else {
Expand Down
7 changes: 6 additions & 1 deletion Sources/HXPhotoPicker/Core/Extension/Core+String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ public extension HXPickerWrapper where Base == String {

// array of bytes, little-endian representation
func arrayOfBytes<T>(_ value: T, length: Int? = nil) -> [UInt8] {
let totalBytes = length ?? (MemoryLayout<T>.size * 8)
let totalBytes: Int
if let length = length {
totalBytes = length
}else {
totalBytes = (MemoryLayout<T>.size * 8)
}

let valuePointer = UnsafeMutablePointer<T>.allocate(capacity: 1)
valuePointer.pointee = value
Expand Down
4 changes: 3 additions & 1 deletion Sources/HXPhotoPicker/Core/Extension/Core+UIDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ extension UIDevice {

class var safeAreaInsets: UIEdgeInsets {
if #available(iOS 11.0, *) {
return UIApplication._keyWindow?.safeAreaInsets ?? .zero
if let safeAreaInsets = UIApplication._keyWindow?.safeAreaInsets {
return safeAreaInsets
}
}
return .zero
}
Expand Down
18 changes: 15 additions & 3 deletions Sources/HXPhotoPicker/Core/Util/PhotoTools.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,22 @@ public struct PhotoTools {
separatedBy: CharacterSet.init(charactersIn: ":.")
)
if components.count >= 2 {
m = Int(components[0]) ?? 0
s = Int(components[1]) ?? 0
if let i = Int(components[0]) {
m = i
}else {
m = 0
}
if let i = Int(components[1]) {
s = i
}else {
s = 0
}
if components.count == 3 {
ms = Int(components[2]) ?? 0
if let i = Int(components[2]) {
ms = i
}else {
ms = 0
}
}
}else {
s = Int(INT_MAX)
Expand Down
23 changes: 18 additions & 5 deletions Sources/HXPhotoPicker/Core/View/GIFImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ class GIFImage {
func getFrame(index: Int) -> UIImage? {
guard index < frameTotalCount else { return nil }
// 取当前帧图片
let currentImage = self.frameImages[index] ?? self.image
let currentImage: UIImage?
if let image = self.frameImages[index] {
currentImage = image
}else {
currentImage = self.image
}
// 如果总帧数大于预加载数,需要加载后面未加载的帧图片
if frameTotalCount > GlobalSetting.prefetchNumber {
// 清除当前帧图片缓存数据,空出内存
Expand Down Expand Up @@ -242,9 +247,17 @@ class GIFImageView: UIImageView {
return
}
if let animatedImage = self.animatedImage {
guard self.currentFrameIndex < animatedImage.frameTotalCount else { return }
self.accumulator += min(1.0, displayLink!.duration)
var frameDuration = animatedImage.frameDurations[self.currentFrameIndex] ?? displayLink!.duration
guard let displayLink = displayLink,
self.currentFrameIndex < animatedImage.frameTotalCount else {
return
}
self.accumulator += min(1.0, displayLink.duration)
var frameDuration: TimeInterval
if let duration = animatedImage.frameDurations[self.currentFrameIndex] {
frameDuration = duration
}else {
frameDuration = displayLink.duration
}
while self.accumulator >= frameDuration {
self.accumulator -= frameDuration
self.currentFrameIndex += 1
Expand All @@ -256,7 +269,7 @@ class GIFImageView: UIImageView {
}
self.layer.setNeedsDisplay()
if let newFrameDuration = animatedImage.frameDurations[self.currentFrameIndex] {
frameDuration = min(displayLink!.duration, newFrameDuration)
frameDuration = min(displayLink.duration, newFrameDuration)
}
}
} else {
Expand Down
10 changes: 8 additions & 2 deletions Sources/HXPhotoPicker/Core/View/ProgressHUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,14 @@ final class ProgressHUD: UIView {
}
override func layoutSubviews() {
super.layoutSubviews()
if !frame.equalTo(superview?.bounds ?? frame) {
frame = superview?.bounds ?? frame
let superRect: CGRect
if let superBounds = superview?.bounds {
superRect = superBounds
}else {
superRect = frame
}
if !frame.equalTo(superRect) {
frame = superRect
updateFrame()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class EditorRatioToolView: UIView {
collectionView.contentInset = .init(top: 12, left: 0, bottom: UIDevice.bottomMargin + 12, right: 0)
}
if isFirst {
if selectedIndex >= 0 {
if selectedIndex >= 0 && !ratios.isEmpty {
DispatchQueue.main.async {
let scrollPosition: UICollectionView.ScrollPosition
if UIDevice.isPortrait {
Expand Down
13 changes: 11 additions & 2 deletions Sources/HXPhotoPicker/Picker/Controller/AlbumViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ public class AlbumViewController: BaseViewController {
if AssetManager.authorizationStatusIsLimited() {
promptLb.width = view.width
}
var titleWidth = titleLabel.text?.width(ofFont: titleLabel.font, maxHeight: 30) ?? 0
var titleWidth: CGFloat = 0
if let labelWidth = titleLabel.text?.width(ofFont: titleLabel.font, maxHeight: 30) {
titleWidth = labelWidth
}
if titleWidth > view.width * 0.6 {
titleWidth = view.width * 0.6
}
Expand All @@ -200,9 +203,15 @@ public class AlbumViewController: BaseViewController {
}
}
if orientationDidChange {
let indexPath: IndexPath
if let index_Path = beforeOrientationIndexPath {
indexPath = index_Path
}else {
indexPath = .init(row: 0, section: 0)
}
if !assetCollectionsArray.isEmpty {
tableView.scrollToRow(
at: beforeOrientationIndexPath ?? IndexPath.init(row: 0, section: 0),
at: indexPath,
at: .top, animated: false
)
}
Expand Down
Loading

0 comments on commit be658b3

Please sign in to comment.