Open clbemre opened 1 week ago
Hey @clbemre, thanks for this ticket!
I'm currently busy developing an update for our other library (NavigationView), but I'll be back here as soon as I finish that task (probably at the end of this week).
I hope it suits you, thanks again for your ticket and have a nice day, T.K.
Hello again @FulcrumOne, thank you for your interest.
Additionally, when there is a CameraPreview screen displayed, if I display an alert on the screen with MJCameraController().alert { }
, the CameraPreview closes. I want to maintain its state and prevent the preview screen from closing unless I close it myself. I get the same alert problem if I present it with .alert {}
in Camera Preview.
The alert appears on the preview screen, but this situation when the cancel button is pressed. So, disappeared preview screen.
I think this alert problem and the background/foreground problem of the application that I mentioned before are caused by the same problem.
Additionally, Iβm just curious, why do you use DispatchQueue.main.async { [self] in }
instead of DispatchQueue.main.async { [weak self] in }
?
Hello again @FulcrumOne, when will you fix these issues? or will?
Thank you.
hey @clbemre,
Sorry, had a lot of work related to our other libraries. In my calendar, work on this library is scheduled to start this Thursday
Apologies for the "communication issues" once again; I believe creating a Discord / Slack channel would help us stay better connected and updated on things related to libraries. I'll try to organize it this week π
Have a great day, Tomasz K.
Thank you @FulcrumOne , I will be waiting for your response. Thank you for your interest. ππ»
Have a nice day. Best Regards
Hello again, @FulcrumOne , have you started this issues solutions? I'm sorry for bothering you but its a little important for me :) Thank you again.
Hey, I'm starting this eveningπ Hope it will be ready by the weekend
This is great! Thank you :) Good luck :)
Hello, firstly this is a great framework.
I have a problem. When the application goes to the background and comes to the front again, the image or video preview closes and returns to the shooting screen, this is a problem, the second problem is that when I try to shoot again after this scenario, I get a crash.
Why doesn't the app continue where I left off when I put it in the background and then bring it back to the foreground?
var cameraView: UIView { cameraLayer.superview ?? .init() }
-> and i get a crash for take a picture after background/foregroung. Because I guess CameraInputView is being recreated.Thank you
hey @clbemre, just to confirm - you're telling that you experienced a crash when you backgrounded the app and then returned to the foreground, correct?
@clbemre, that second problem (with alert and crash I was able to reproduce, so I'll start from this one)
Hello again @FulcrumOne First of all, there are a few problems; after the first startup, it puts it in the background without doing anything, and when it comes back to the foreground, it crashes while trying to take a photo/video. Then, after showing an alert while on the preview screen, both the preview screen disappears and when I try to take a photo or video again, it crashes again, and sometimes it is because of the cameraView superView and sometimes it is because of the blurViews, but I think the problem is common, because as far as I understand, the camera manager is deinit/init and the swiftUI randomly appears on the screen. because of their renderings.
Additionally , independently of these, the snapshot and blurview you showed while flipping the camera are turned landscape.
Sorry for my english, sometimes i use translate :)
hey @clbemre,
No problem, English is not my native language either (it would be nice if we both spoke Polish π )
Could you please test the branch called 'patch-1.2.1', it should fix your problem with alert that causes the app to crash?
You should also add this method to your MCameraController - .equatable()
(it's a temporary solution)
Hey @FulcrumOne this temporary solution works. Thank you. πͺπ» (we can't speak Polish, I'm Turkish π) Are we going to continue with this temporary solution or are you continuing to work on resolving the issue at its base? As far as I can see, you are working on memory leaks in particular.
hey @clbemre, thanks for letting me know!
I want to spend some time today and check the library for problems with memory leaks, and then I will move on to fixing this issue with the background mode.
Hey @FulcrumOne , also we have a little problem :) when First launch MCameraController, the system want to permission. If I deny the system permission, the UI does not update and switch to the error view, the camera layer visible black view.
@clbemre I'll have to spend little more time on this task, as the problem is little bigger than I initially thought; there are several problems that I discovered today. I'll keep you in the loopπ
okey @FulcrumOne thank you for your response. I'll be wating for you. Good luck :)
Hey @clbemre,
So we have two potential solutions to our problem:
CameraManager
to the level above (i.e. the parent view in which MCameraController is implemented, managed by the developer). Additionally if we opt for this option, I would also like to move the functions from the Public+MCameraController
file lines 15 -> 43 to the CameraManager
initialiser.CameraManager
singleton; this will allow us to avoid major changes to the public API, however, there may be some issues when trying to port the library to iPadOS and macOS.Therefore, I think that, in the long term, a better solution will be to implement point 1. What do you think?
@clbemre,
The branch named patch-1.2.1-beta
contains fixes to the following problems:
Hello, firstly this is a great framework.
I have a problem. When the application goes to the background and comes to the front again, the image or video preview closes and returns to the shooting screen, this is a problem, the second problem is that when I try to shoot again after this scenario, I get a crash.
Why doesn't the app continue where I left off when I put it in the background and then bring it back to the foreground?
var cameraView: UIView { cameraLayer.superview ?? .init() }
-> and i get a crash for take a picture after background/foregroung. Because I guess CameraInputView is being recreated.Thank you
I cannot reproduce this problem unfortunately. However, there is a chance that this branch has already fixed the issue. If not, please let me know
@FulcrumOne Hello, Is the temporary solution not sufficient at the moment? Also I think long term solution is better.
patch-1.2.1-beta solutions is finished or will?
var cameraView: UIView { cameraLayer.superview ?? .init() }
-> It got resolved after applying the equatable() workaround.
Actually after I applying the equatable() all problems resolved. I guess just have a little memory leak, thats all.
Additionally , independently of these, the snapshot and blurview you showed while flipping the camera are turned landscape.
I'm working on this now. If you need a faster solution, I strongly recommend locking the rotation for the current screen (lockOrientation
method).
Additionally , independently of these, the snapshot and blurview you showed while flipping the camera are turned landscape.
I'm working on this now. If you need a faster solution, I strongly recommend locking the rotation for the current screen (
lockOrientation
method).
I noticed this about this problem. When I tested it on the iPhone X, it rotates, but when I tested it on the iPhone 11 Pro Max, it does not rotate. I also completely turned off the device rotation, it only works in portrait mode.
@FulcrumOne Hello, Is the temporary solution not sufficient at the moment? Also I think long term solution is better.
- patch-1.2.1-beta solutions is finished or will?
var cameraView: UIView { cameraLayer.superview ?? .init() }
-> It got resolved after applying the equatable() workaround.- Actually after I applying the equatable() all problems resolved. I guess just have a little memory leak, thats all.
This temporary solution was a bit unstable and caused other problems (the error screen was not displayed for example). I would therefore recommend using the patch-1.2.1-beta
branch π
@FulcrumOne Hello, Is the temporary solution not sufficient at the moment? Also I think long term solution is better.
- patch-1.2.1-beta solutions is finished or will?
var cameraView: UIView { cameraLayer.superview ?? .init() }
-> It got resolved after applying the equatable() workaround.- Actually after I applying the equatable() all problems resolved. I guess just have a little memory leak, thats all.
This temporary solution was a bit unstable and caused other problems (the error screen was not displayed for example). I would therefore recommend using the
patch-1.2.1-beta
branch π
Okey I will, thank you for your interest and for this great library :)
Thanks! If you have any further problems, let me knowπ
PS. Check out our other solutions too!
Hello, firstly this is a great framework.
I have a problem. When the application goes to the background and comes to the front again, the image or video preview closes and returns to the shooting screen, this is a problem, the second problem is that when I try to shoot again after this scenario, I get a crash.
Why doesn't the app continue where I left off when I put it in the background and then bring it back to the foreground?
var cameraView: UIView { cameraLayer.superview ?? .init() }
-> and i get a crash for take a picture after background/foregroung. Because I guess CameraInputView is being recreated.Thank you