Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

iOS 26 will remove ALAssetsLibrary. When do you expect to provide a compatible version?

Đang mở
#1,356 3 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
ios, swift
Lĩnh vực
mobile-dev

Hướng nghiên cứu

Start by locating the PromiseKit code containing the UIImagePickerController promise and its ALAssetsLibrary usage. Research the iOS 26-compatible replacement and determine how the image-data path should preserve the existing promise behavior; done means the affected flow builds and works without ALAssetsLibrary on supported iOS versions.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

public func promise(_ vc: UIImagePickerController, animated: Bool = false, completion: (() -> Void)? = nil) -> Promise<NSData> {
    let proxy = UIImagePickerControllerProxy()
    vc.delegate = proxy

    present(vc, animated: animated, completion: completion)

    return proxy.promise.then(on: nil) { info -> Promise<NSData> in
    #if swift(>=4.2)
        let url = info[.referenceURL] as! URL
    #else
        let url = info[UIImagePickerControllerReferenceURL] as! URL
    #endif
        
        return Promise { seal in
            ALAssetsLibrary().asset(for: url, resultBlock: { asset in
                let N = Int(asset!.defaultRepresentation().size())
                let bytes = UnsafeMutablePointer<UInt8>.allocate(capacity: N)
                var error: NSError?
                asset!.defaultRepresentation().getBytes(bytes, fromOffset: 0, length: N, error: &error)

                if let error = error {
                    seal.reject(error)
                } else {
                    seal.fulfill(NSData(bytesNoCopy: bytes, length: N))
                }
            }, failureBlock: { seal.reject($0!) } )
        }
    }.ensure {
        self.dismiss(animated: animated, completion: nil)
    }
}

}

Ngôn ngữ chính
Swift
Star
14.2k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mxcl/PromiseKit

Tất cả issue của mxcl/PromiseKit

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.