     private var bottomSeparatorView: UIView?
     private var indicatorLayer: CAShapeLayer?
     private var selectedLayer: CAShapeLayer?
+    
+    private var isRTL: Bool {
+        if #available(iOS 9.0, *) {
+            return UIView.userInterfaceLayoutDirection(for: semanticContentAttribute) == .rightToLeft
+        } else {
+            return UIApplication.shared.userInterfaceLayoutDirection == .rightToLeft
+        }
+    }
+    private var isFlipped = false
     
     // MARK: - Lifecycle
     


extension Segmentio.Points {
    
    init(item: Segmentio.ItemInSuperview, atIndex index: Int, allItemsCellWidth: [CGFloat], pointY: CGFloat, position: SegmentioPosition, style: SegmentioStyle, isRTL: Bool) {
        let cellWidth = item.cellFrameInSuperview.width
        var startX = item.startX
        var endX = item.endX

            return segmentWidth(for: IndexPath(item: index, section: 0))
        }
        
        let isCommonBehaviour = (isFlipped && isRTL) || (!isFlipped && !isRTL)
        
        if let indicatorLayer = indicatorLayer, let options = segmentioOptions.indicatorOptions {
            let item = itemInSuperview(ratio: options.ratio)
