<commit_before>//
//  LLRainbowDragPop.swift
//  Pods
//
//  Created by Danis on 15/11/25.
//
//

class RainbowDragPop: UIPercentDrivenInteractiveTransition {
    
    var interacting = false
    weak var navigationController:UINavigationController! {
        didSet {
            let panGesture = UIPanGestureRecognizer(target: self, action: #selector(RainbowDragPop.handlePan(_:)))
            
            navigationController?.view.addGestureRecognizer(panGesture)
        }
    }
    weak var popAnimator:RainbowPopAnimator!
    
    override var completionSpeed: CGFloat {
        get {
            return max(CGFloat(0.5), 1 - self.percentComplete)
        } set {
            self.completionSpeed = newValue
        }
    }
    
    
    func handlePan(_ panGesture:UIPanGestureRecognizer) {
        let offset = panGesture.translation(in: panGesture.view)
        let velocity = panGesture.velocity(in: panGesture.view)
        
        switch panGesture.state {
        case .began:
            if !self.popAnimator.animating {
                interacting = true
                if velocity.x > 0 && self.navigationController.viewControllers.count > 0 {
                    navigationController.popViewController(animated: true)
                }
            }
        case .changed:
            if interacting {
                var progress = offset.x / panGesture.view!.bounds.width
                progress = max(progress,0)
                
                self.update(progress)
            }
        case .ended:
            if interacting {
                if panGesture.velocity(in: panGesture.view!).x > 0 {
                    self.finish()
                }else {
                    self.cancel()
                }
                interacting = false
            }
        case .cancelled:
            if interacting {
                self.cancel()
                interacting = false
            }
        default:
            break
        }
    }
    
}
<commit_msg>[CHANGE] use of UIScreenEdgePanGestureRecognizer instead of UIPanGestureRecognizer for drag pop gesture<commit_after>//
//  LLRainbowDragPop.swift
//  Pods
//
//  Created by Danis on 15/11/25.
//
//

class RainbowDragPop: UIPercentDrivenInteractiveTransition {
    
    var interacting = false
    weak var navigationController:UINavigationController! {
        didSet {
            let panGesture   = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(RainbowDragPop.handlePan(_:)))
            panGesture.edges = UIRectEdge.left
            navigationController?.view.addGestureRecognizer(panGesture)
        }
    }
    weak var popAnimator:RainbowPopAnimator!
    
    override var completionSpeed: CGFloat {
        get {
            return max(CGFloat(0.5), 1 - self.percentComplete)
        } set {
            self.completionSpeed = newValue
        }
    }
    
    
    func handlePan(_ panGesture:UIScreenEdgePanGestureRecognizer) {
        let offset = panGesture.translation(in: panGesture.view)
        let velocity = panGesture.velocity(in: panGesture.view)
        
        switch panGesture.state {
        case .began:
            if !self.popAnimator.animating {
                interacting = true
                if velocity.x > 0 && self.navigationController.viewControllers.count > 0 {
                    navigationController.popViewController(animated: true)
                }
            }
        case .changed:
            if interacting {
                var progress = offset.x / panGesture.view!.bounds.width
                progress = max(progress,0)
                
                self.update(progress)
            }
        case .ended:
            if interacting {
                if panGesture.velocity(in: panGesture.view!).x > 0 {
                    self.finish()
                }else {
                    self.cancel()
                }
                interacting = false
            }
        case .cancelled:
            if interacting {
                self.cancel()
                interacting = false
            }
        default:
            break
        }
    }
    
}

{'fraction_non_alphanumeric': 0.07876878332525449, 'fraction_numerical': 0.006301502666020358, 'mean_word_length': 1.481659651232712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6255528', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1073, 'n_words': 210}