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
416 stars 76 forks source link

Move seen stories back with gray tint #97

Closed codobuxsocial closed 4 years ago

codobuxsocial commented 4 years ago

Is your feature request related to a problem? Please describe. Requesting this as an enhancement not at all related to a problem.

Describe the solution you'd like I would like the seen stories to move at end like it is on other similar social app.

Describe alternatives you've considered I don't have an idea to do this so requesting here.

Additional context This library has been amazing, cheers to the devs behind it!

ranmyfriend commented 4 years ago

Hi @codobuxsocial

Am explaining you here, How you can achieve this requirement.

1)First of all, when user viewing snap you should make seen request to the backend. 2)So when you are reaching out the HomeController, you put up the first fresh request to load the stories rite, There you should add logic: if story.snaps.viewed count and story.snaps.count, then the story has completely viewed by the user. Then you can put this story into the last of the object. 3)If more than one story has already seen, then add one more logic here like, whichever is created first(based on Story.lastsnap.created) that should get inserted into the last.

codobuxsocial commented 4 years ago

Thanks i'll see how it goes, another question should I call seen request API for a story in didEndDisplayingCell inside IGStoryPreviewController right?

ranmyfriend commented 4 years ago

@codobuxsocial No don't do there, better you go ahead with didCompleteProgress method in the IGStoryPreviewCell. Simply add protocol method to indicate to IGStoryPreviewController, whenever each story has been viewed. Then simply go ahead with your API call.

Note: 1)You should call from didCompleteProgress method 2)didCompletePreview is completing all the snaps ie. The entire story has seen.

codobuxsocial commented 4 years ago

Okay thanks will try later!

codobuxsocial commented 4 years ago

Can you guide me how can i start the story from index where story is not seen yet?

boominadhaprakash commented 4 years ago

Hi @codobuxsocial

Please refer #98