Closed vBoykoGit closed 4 years ago
Hi @vBoykoGit
Thanks for raising the issue. I think we have addressed this issue already. Please refer the below link.
I have read this issue but still don't understand what property I must set to change start index
Hi @vBoykoGit.
Go to IGStoryPreviewController, willDisplayCell method, you can find the below code,
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
guard let cell = cell as? IGStoryPreviewCell else {
return
}
//Taking Previous(Visible) cell to store previous story
let visibleCells = collectionView.visibleCells.sortedArrayByPosition()
let visibleCell = visibleCells.first as? IGStoryPreviewCell
if let vCell = visibleCell {
vCell.story?.isCompletelyVisible = false
vCell.pauseSnapProgressors(with: (vCell.story?.lastPlayedSnapIndex)!)
story_copy = vCell.story
}
//Prepare the setup for first time story launch
if story_copy == nil {
cell.willDisplayCellForZerothIndex(with: cell.story?.lastPlayedSnapIndex ?? 0)
return
}
if indexPath.item == nStoryIndex {
let s = stories.stories[nStoryIndex+handPickedStoryIndex]
cell.willDisplayCell(with: s.lastPlayedSnapIndex)
}
}
In that, in the below line instead of cell.story?.lastPlayedSnapIndex in cell.willDisplayCellForZerothIndex(with: cell.story?.lastPlayedSnapIndex ?? 0), you can pass your own index like cell.willDisplayCellForZerothIndex(with: 2) or cell.willDisplayCellForZerothIndex(with: 3) like this.
if story_copy == nil {
cell.willDisplayCellForZerothIndex(with: cell.story?.lastPlayedSnapIndex ?? 0)
return
}
Let us know, if you are still unable to fix the issue.
Thanks for your answer. I have changed willDisplay method as following:
if story_copy == nil {
cell.willDisplayCellForZerothIndex(with: 1)
return
}
And now I'm getting this bug:
Hi @vBoykoGit
Can you please tell us, on what scenario you want to open like this?
I want to open each story separately like following:
So, when I press on the story IGStoryPreviewController
should show it.
Hi @vBoykoGit
If you are opening each story separately, once that story over, should it move to next story or it should dismiss?
It should move to the next story
Hi @vBoykoGit
I have implemented the functionality. Please refer the below issue, you will get some idea. Let us know if you have any doubt on that.
HI @vBoykoGit
Please check issue #98 as per my previous comment. If you have any doubts ask us. Even after apply that fix, if your issue not getting solved, please reopen this issue. I am closing it for now.
Duplicate of #98
I want to start IGStoryPreviewCell from specific start index, myStartIndex for example: