PagingKit icon indicating copy to clipboard operation
PagingKit copied to clipboard

Disable swipe for content view

Open shaikshabana opened this issue 6 years ago • 4 comments

Hi,

I have used this library and content inside is tableview with slider.

when scroll slider, content view also scrolling.

I want to disable scrolling on content view so that i can use slider.

Thanks

shaikshabana avatar Jul 15 '18 10:07 shaikshabana

Hi @shaikshabana :)

You mean you are using UISlider in your contents? I recommend that you set false to "delaysContentTouches" in UIScrollView.

https://developer.apple.com/documentation/uikit/uiscrollview/1619398-delayscontenttouches

    override func viewDidLoad() {
        super.viewDidLoad()
        // contentViewController is a PagingContentViewController's object.
        contentViewController.scrollView.delaysContentTouches = false
    }

PagingContentViewController uses UIScrollView object to scroll the contents. When "delaysContentToucnes" is false, controls in your contents take priority of scrolling.

If you have any trouble, feel free to ask.

kazuhiro4949 avatar Jul 17 '18 09:07 kazuhiro4949

Hi ,

Thank you for the inputs it helped me,

while using this framework i have got a bug

Let's take SimpleViewController , where we are having datasource and ContentTableViewController,

When i keep a break point, ContentTableViewController is getting called twice and one the tab of last element of menu,viewDidLoad is not getting called.

I have some data to be loaded in last menu item,with the above bug it couldn't achieve that.

Can you help me how to resolve this bug: Where for the first element viewDidLoad getting called twice and for last element viewDidLoad is not getting called.

shaikshabana avatar Aug 12 '18 14:08 shaikshabana

Hi, @shaikshabana

I'll check later.

kazuhiro4949 avatar Aug 16 '18 14:08 kazuhiro4949

Hi, @shaikshabana

SimpleViewController in the sample directory doesn't call viewDidLoad() of ContentTableViewController twice. Could you make a property to set index on ContentTableViewController and print it in viewDidLoad(). ( or debug like this: https://www.bignerdranch.com/blog/xcode-breakpoint-wizardry/ ) You can see when each view controller is loaded.

Because PagingContentViewController has an own lifecycle, it loads only two or three view controller at once. It doesn't load the next content until scrolling.

If you make SimpleViewController by yourself, could you show me the code? (on this issue or e-mail)

Thanks.

kazuhiro4949 avatar Aug 16 '18 15:08 kazuhiro4949