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

How to display any stories #78

Closed legend1923 closed 4 years ago

legend1923 commented 4 years ago

Hi, I want to open fifth snap . I think first snap default . 1- A User adds 5 snaps. 2- B user see 4 snaps 3- B user click and see fifth snaps

I tried change this class -> IGStoryPreviewController.swift cell.willDisplayCellForZerothIndex(with: cell.story?.lastPlayedSnapIndex ?? 0) -> cell.willDisplayCellForZerothIndex(with: 4) But its not work for me . How to show any snap ?

ranmyfriend commented 4 years ago

Hi @legend1923

Sorry for the late reply. I will check and update you soon.

Thanks Ranjith

boominadhaprakash commented 4 years ago

Hi @legend1923

I think only changing willDisplayCellForZerothIndex is not sufficient. You have to change willDisplayCell also.

willDisplayCellForZerothIndex only for first story. If you want to change other stories snapindex means, you have to change willDiplayCell index value also in IGStoryPreviewController.

Also, we need to check when you directly gave value greater than zero, by that time snaps may not be created. If snaps already got created and if you provide value directly it will work. Because snaps will be created from 0th index. It will consider snaps frame also.

For example consider 320x480 iPhone dimension. first snap occupies 0 to 320 width, second snap occupies 320 to 640 and third snap takes 640 to 960. It is a sequential process. But when you try to give index 2 directly which expects snap at 640 to 960. But still 0 to 320 and 320 to 640 is not created yet. which will give some weird issue. This thing we need to test it first. Then only we can provide you the solution.

Mean while you can try the solution which I mentioned above and let us know if you face any problem after that.

Regards, Boominadha Prakash

boominadhaprakash commented 4 years ago

Hi @legend1923

We are awaiting for your reply. If problem still exists please convey your status. We will try to help you. If there is no problem, please close this issue.

Thanks, Boominadha Prakash

ranmyfriend commented 4 years ago

I am closing it for now. If anything updates come near future. Will open it