-
-
Notifications
You must be signed in to change notification settings - Fork 976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Swift Package Manager Support #625
Conversation
25bf236
to
3aadf13
Compare
Is this something ready to be merged. It would be really useful 👍 |
Well, works fine for me, including assets and xibs. They were the biggest pain ) |
@NikKovIos FYI :) |
@s4cha as soon as you did something with SPM, check this please. |
Hey guys, haven't taken a deep look but spm support was already done and working a while back on the |
@s4cha the |
Hi everyone, I just wanted to drop a message here to mention it would be great to have full SPM support in the releases. The reason for this is we are trying to ship a library that has Related to this PR: When using the The crash happens the moment the picker is presented with func imagePicker(_ ratio: String?) -> YPImagePicker {
var config = YPImagePickerConfiguration()
config.shouldSaveNewPicturesToAlbum = false
config.startOnScreen = YPPickerScreen.library
config.library.onlySquare = false
config.library.isSquareByDefault = false
if let ratio = ratio, let rectangleRatio = Double(ratio) {
config.showsCrop = .rectangle(ratio: rectangleRatio)
}
config.library.mediaType = YPlibraryMediaType.photo
return YPImagePicker(configuration: config)
}
....
let picker = imagePicker(message["ratio"])
picker.didFinishPicking { [unowned picker] items, _ in
if let photo = items.singlePhoto {
// Image selected now start uploading process
...
}
picker.dismiss(animated: true, completion: nil)
}
// This is where the app crashes
viewController.present(picker, animated: true, completion: nil) I hope this helps in any way possible. If you need any help testing things out let me know and I'll be happy to help if possible. |
I think that is better to support the cocoapods and spm simultaneously. But in that case we need to test this branch very well. As soon as I didn't work with spm yet, it should be @s4cha, but it seems, that he has not time for that right now. |
@fdoxyz dunno if you still have that issue, but that branch resolves, since the issue is connected with how xibs are stored in bundle and where they're trying to find a corresponding class (file-owner). |
There's a chance I'm doing something wrong, but I'm able to reproduce the problem in this example project I created: https://github.com/fdoxyz/YPImagePickerSPM I merged this PR into my fork and released with a The project above fails if I use that tag ( It also fails the same way if I use your branch But works just fine if I use the branch The error is always the same: Please let me know if I'm making a mistake somewhere @RomanTysiachnik, or I hope this helps debug the problem I'm facing. |
Implemented here https://github.com/Yummypets/YPImagePicker/releases/tag/5.0.0 |
Added Swift Package Manager Support
Description
Package.swift
withYPImagePicker
librarystatic var local: Bundle
to correctly use bundle for resources of package.xib
files.