Gesture recognizer not fired

4 posts, 0 answers
  1. Alex
    Alex avatar
    10 posts
    Member since:
    Apr 2011

    Posted 07 Oct 2014 Link to this post

    Hi Telerik,

    I have downloaded the latest version of iOS UI and I am using it with Swift. I am handling various gesture recognizers and the following is an example for the left swipe:
        let leftSwipeGesture = UISwipeGestureRecognizer(target: self, action: Selector("handleLeftSwipe:"))
        leftSwipeGesture.direction = UISwipeGestureRecognizerDirection.Left
           
    It works fine. However, when I add a chart to the view controller, none of the gesture recognizers is triggering. Is this the expected behavior? If yes, are there workarounds? Here is how I add the chart to the view controller:
                TKChart chart = TKChart(frame: CGRectInset(self.view.bounds, 10, 10))
                self.view.addSubview(chart!)
                var items:NSMutableArray = []
                for x in 0...10 {
                    var y = 100.0 * sin(M_PI * CDouble(x) + 100.0)
                    items.addObject(TKChartDataPoint(x:CDouble(x + x * 3), y:y))
                }
                var series = TKChartSplineSeries(items:items)
                series.yAxis = TKChartNumericAxis(minimum:-100, andMaximum:100)
                var xAxis = TKChartNumericAxis(minimum:0, andMaximum:20)
                xAxis.majorTickInterval = 5
                series.xAxis = xAxis
                chart!.addSeries(series)

    Thanks.

    Alex
  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 08 Oct 2014 Link to this post

    Hi Alex,

    Thank you for your interest in our controls.

    Yes, this is the expected behavior. TKChart intercepts touch events in order to provide interactivity features like selection, pan and zoom. You can solve the issue by disabling chart interactivity. This can be done by setting the userInteractionEnabled property to false:

    chart.userInteractionEnabled = false

    Currently it is not possible to disable particular gestures in charts, this is logged as a feature request in our feedback portal and we will address the issue in a future release. Use the following link to track the issue status.

    Do not hesitate to contact us if you have further questions.

    Regards,
    Jack
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. Alex
    Alex avatar
    10 posts
    Member since:
    Apr 2011

    Posted 08 Oct 2014 in reply to Jack Link to this post

    Hi Jack,

    Thank you. I have tested that I can receive the swipe and pinch events.

    Alex
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 09 Oct 2014 Link to this post

    Hello Alex,

    Thank you for this update. I am glad to hear that this issue is solved now. Feel free to contact us if you have other questions.

    Regards,
    Jack
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner