Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

How do I integrate the stories collection as a part of my viewcontroller (with storyboard) file? #132

Open
ghost opened this issue Jan 5, 2022 · 4 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jan 5, 2022

Dear Ranjith,

I was very impressed with your project Instagram Stories which you published here on github.
I am working on an app which includes a user profile and one of the user profile features will be stories like on instagram, exactly as you build it yourself :)

I am a new developer and still work with a Storyboard on my project.
How do I integrate the stories collection as a part of my viewcontroller file?

I tried so many ways(!!) to work around with your project but failed every time. I am desperate now :/
stories

Please see the attached print screen which will demonstrate what I am looking to achieve.

Best Regards,
Ido

@ranmyfriend
Copy link
Member

Hi @TheSlider32

Thanks for creating an issue :)

Actually, we have created IGHomeController for this root setup. And this controller has collection view only, What am saying here is you can 1)reuse this view controller for yourself, or create one container view add to try to 2)add this IGHomeController as child-view controller to your own VC.
If you are still now able to achieve it, and which way you are following it. please feel free to reply back to this comment step by step. We will help you to fix it.

@ghost
Copy link
Author

ghost commented Jan 6, 2022

finally !!
Thank you very much it works !!

@ghost ghost closed this as completed Jan 6, 2022
@ghost ghost reopened this Jan 6, 2022
@ghost
Copy link
Author

ghost commented Jan 6, 2022

When I reuse IGHomeController inside container view the clear cache button doesn't appear. But when I started your project alone it does shows the clear cache button.
How can I activate the clear cache button inside the container view?

Best Regards,
Ido.

@ranmyfriend
Copy link
Member

ranmyfriend commented Jan 6, 2022

Hi @TheSlider32
We have added clear cache button in the NavigationItem of IGHomeController.

check the following code

override var navigationItem: UINavigationItem {
        let navigationItem = UINavigationItem()
        navigationItem.titleView = UIImageView(image: UIImage(named: "icInstaLogo"))
        if isClearCacheEnabled {
            navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Clear Cache", style: .done, target: self, action: #selector(clearImageCache))
            navigationItem.rightBarButtonItem?.tintColor = UIColor(red: 203.0/255, green: 69.0/255, blue: 168.0/255, alpha: 1.0)
        }
        navigationItem.rightBarButtonItem?.tintColor = UIColor(red: 203.0/255, green: 69.0/255, blue: 168.0/255, alpha: 1.0)
        return navigationItem
    }

Try:

Create one subview in your container view and try to add the custom button and give the functionality.
and hook up the button action to your parent func clearImageCache or move this into your child itself. however you want do your customisation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants