drawRect / Instagram_Stories

Inspired by Instagram Stories functionality. This source is similar to Instagram Stories, which is having both image and video support.
MIT License
415 stars 76 forks source link

crash when tap forward fast. #48

Closed nvish-deepakthakur closed 5 years ago

nvish-deepakthakur commented 5 years ago

[NSKeyValueObservance retain]: message sent to deallocated instance

boominadhaprakash commented 5 years ago

@nvish-deepakthakur Hi,

Thanks for posting the issue. We will look into it. Let you know once we fixed that issue.

boominadhaprakash commented 5 years ago

Hi @nvish-deepakthakur,

Just now I have finished testing on my iPhone 8. But I am not facing that kind of issue. If possible, can you explain little bit more, in which environment it is crashing?

nvish-deepakthakur commented 5 years ago

Hi@Boominadha Prakash

I am checking on iPhone 6 device & iPhone X simulator , when tap(very fast) on next video in story its crash. When I enable zombie then I get -[NSKeyValueObservance retain]: message sent to deallocated instance 0x600003265e00

nvish-deepakthakur commented 5 years ago

One more thing I need help for showing AVPlayers in full screen not from the save area please help me on this also

boominadhaprakash commented 5 years ago

Hi @nvish-deepakthakur, Thanks for your detailed description. We will look into it. For AVPlayer full screen, you need to change AVPlayer videogravity value from resizeAspect to resize. The property available on IGPlayerView.swift file.

nvish-deepakthakur commented 5 years ago

For AVplayer sorry you did not get my point not using resizeAspect I need to add collection view constraints form super view not from safe area , same for content view , scroll view . please check attachment Simulator Screen Shot - iPhone XS Max - 2019-04-03 at 16 30 55

Using

resizeAspect to resize black screen pls check

Simulator Screen Shot - iPhone X - 2019-04-03 at 16 34 25

boominadhaprakash commented 5 years ago

Hi @nvish-deepakthakur, I am unable to get your point. Can you please explain your requirements step by step?

boominadhaprakash commented 5 years ago

Have you modified any code? I can able to see top and bottom filled with some black color. By default, we wrote code like, it will take safe are constraints if iOS version more than 11.0, otherwise it will take superview's layout constraints only.

Screenshot 2019-04-03 at 4 59 02 PM Just try this code. Change view.width and view.height to self.view.frame.width and self.view.frame.height in IGStoryPreviewController.

nvish-deepakagarwal commented 5 years ago

Hi Boominadha,

Thanks for your quick response. For Crash - When we try to swipe/change "videos or story" in app very fast, then after sometime app get crashed. We checked this in instrument then got to know it's crashing with below error message: "[NSKeyValueObservance retain]: message sent to deallocated instance 0x600003265e00"

I am not able to find the actual problem in code for the same.

boominadhaprakash commented 5 years ago

Thank you. We will figure it out and fix that issue.

boominadhaprakash commented 5 years ago

Hi @nvish-deepakthakur @nvish-deepakagarwal,

Please download the source from this branch: Boomi/KeyObserverIssue and check whether it is crashing or not. I hope, I have fixed that issue. Please check and verify it. If you still face that issue let me know.

nvish-deepakagarwal commented 5 years ago

Hi @boominadhaprakash,

Thanks for your response and quick fix, It's working fine now.

Also, we have Changed "view.width and view.height" to "self.view.frame.width" and "self.view.frame.height" in IGStoryPreviewController.

By this above change CollectionView frame is fixed from superview, but other classes/control like scrollview and player view are still not fix from superview.

Also, I like to keep the "IGStoryPreviewHeaderView" header at the same position, but when we are changing frame in "IGStoryPreviewController". header view also goes up.

Can you please help to fix these also.

Thanks in advance for your quick response and help !!

boominadhaprakash commented 5 years ago

Hi @nvish-deepakagarwal , Thanks for your confirmation. Can you tell me, which device you are running that for getting UI issues. Have you disabled safeAreaLayout in Storyboard? How can I reproduce your issue at my side?

nvish-deepakagarwal commented 5 years ago

Hi @boominadhaprakash, We are running on iPhone X simulator. Have you disabled safeAreaLayout in Storyboard? - What do you mean here, I didn't see you are using storyboard in your example code, I am trying to run that only. Please confirm if I missed anything here.

Have you disabled safeAreaLayout in Storyboard? - I hope if you run your example code in iPhone X simulator, video/image is not playing in full view it's under safe area only, and when change code accordingly you suggest last time then top collection go to full screen but player and image view are still under safe area not goes to full screen.

boominadhaprakash commented 5 years ago

Hi @nvish-deepakagarwal,

I think, I haven't understood your issue properly. So, the issue is, in iPhone X, the Story Preview is not displaying as full screen. Right?

nvish-deepakagarwal commented 5 years ago

Yes

boominadhaprakash commented 5 years ago

If I fixed that, then it will give weird UI issues. Have you checked, how Instagram displaying their stories on iPhoneX? I think they will display with safe area only but they make top and bottom color as black. If possible, can you check and confirm that? I will also check my side.

boominadhaprakash commented 5 years ago

Is this fine for you? @nvish-deepakagarwal iPhoneX-Screenshot iPhoneX-Screenshot1

nvish-deepakagarwal commented 5 years ago

@boominadhaprakash - This looks Okay, but my requirement is to show video in full screen, Is that something we can do to fix here, Kindly suggest !

boominadhaprakash commented 5 years ago

See, I just changed the player videoGravity value to .resize. It is showing me full screen.

IMG_6007

nvish-deepakthakur commented 5 years ago

@boominadhaprakash Can you please send the screen shot of your screen not simulator as above screen shots?

boominadhaprakash commented 5 years ago

@nvish-deepakagarwal Please take the updated source from this branch Boomi/iPhonXSafeAreaIssue. Just change the videoGravity value to .resize in IGPlayerView.swift file and you will get to know.

boominadhaprakash commented 5 years ago

@boominadhaprakash Can you please send the screen shot of your screen not simulator as above screen shots?

That screenshot I have taken from my iPhone 8 only.

nvish-deepakthakur commented 5 years ago

@boominadhaprakash Using new branch , same issues is there please check screen shot in iPhone X

Screen Shot 2019-04-05 at 7 24 22 PM
boominadhaprakash commented 5 years ago

How that will come to full screen. We are having this barrier right.

Screenshot 2019-04-05 at 7 28 54 PM

Can you please just check how Instagram app is displaying? I think this is the standard way to display.

nvish-deepakthakur commented 5 years ago

@boominadhaprakash Yes this is the standard way but our required is to display it in full screen pls check screen shot.

Screen Shot 2019-04-05 at 7 31 24 PM
boominadhaprakash commented 5 years ago

@nvish-deepakagarwal oh okay. Thanks for sharing. Give me sometime. I will check and work on that.

boominadhaprakash commented 5 years ago

Is that the screenshot what you have shared is Instagram app?

nvish-deepakthakur commented 5 years ago

No its not from Instagram , its from my app in single video view , I just need to show instagram stories view for multiple video's with timeline in full view like single video.

boominadhaprakash commented 5 years ago

Oh okay, got it

nvish-deepakthakur commented 5 years ago

@boominadhaprakash I have made some change in nslayoutconstraint & its working fine now according to my requirement . Thanks @boominadhaprakash for your help & quick response

boominadhaprakash commented 5 years ago

@nvish-deepakthakur Glad to hear about that!!! Welcome :)