drawRect/Instagram_Stories

Seems image and Video(If Portrait) not displaying full screen

ramanocs1145 opened this issue ยท 3 comments

Describe the bug
I can able to see full frame for IGStoryPreViewView and UICollectionView when I change constraint like below,

        NSLayoutConstraint.activate([
            self.leftAnchor.constraint(equalTo: snapsCollectionView.leftAnchor),
            self.topAnchor.constraint(equalTo: snapsCollectionView.topAnchor),
            snapsCollectionView.rightAnchor.constraint(equalTo: self.rightAnchor),
            snapsCollectionView.bottomAnchor.constraint(equalTo: self.bottomAnchor)])

But Seems In IGStoryPreViewCell Y position having 39 instead of 0

To Reproduce
Make build on iPhone 11 Pro Max simulator or device.

Expected behavior
Should have full screen based on IGStoryPreViewView

Screenshots
HierarchyFullview
HierarchyForIGStoryPreViewCell

Desktop (please complete the following information):

Smartphone (please complete the following information):

  • Xcode: 11.5
  • Device: iPhone 11 Pro Max
  • iOS: 13.5
  • OS: 10.15.5
  • Version [e.g. 22]

Additional context
FYI: I have tested your source on iOS 13.5, so I have added cv.contentInsetAdjustmentBehavior = .never on IGStoryPreviewView collectionView, cause automaticallyAdjustsScrollViewInsets is depreciated in iOS 11 automaticallyAdjustsScrollViewInsets = false

In IGStoryPreviewController class I can't see any constraint related code for IGStoryPreviewView?
How get it frame on there?
AnimatedCollectionViewLayout manage and handle snapsCollectionView super view frame on IGStoryPreviewView class?

Kindly suggest me to make full screen and the above clarifications.

@ramanocs1145 We will check and update you :)

@ranmyfriend & @boominadhaprakash ,

It's fixed. I just return like return CGSize(width: _view.snapsCollectionView.frame.width, height: _view.snapsCollectionView.frame.height) even our required Deployment target from iOS 11.0 on sizeForItemAt from UICollectionViewDelegateFlowLayout at StoryPreViewViewController

Thanks for giving this wonderful library for to support Instagram Stories for custom implementation.

You are great. Thanks for your support.