Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash suddenly on assertion! #6

Closed
Raviojha62 opened this issue Jan 4, 2017 · 5 comments
Closed

Crash suddenly on assertion! #6

Raviojha62 opened this issue Jan 4, 2017 · 5 comments
Labels

Comments

@Raviojha62
Copy link

I am using this slider on a player and its working fine . but some time its automatically become crash and i am getting the reason in the console that
assertion failed: Illegal interval: file /Users/sabakuch/Documents/Ravi/SlideMenu/Pods/HGCircularSlider/HGCircularSlider/Classes/CircularSliderHelper.swift, line 17

on line no 17 when i check
assert(min <= max, NSLocalizedString("Illegal interval", comment: ""))

screen shot 2017-01-04 at 5 00 29 pm

@HamzaGhazouani
Copy link
Owner

HamzaGhazouani commented Jan 5, 2017

Hey,
I can't reproduce the crash in the player in the example.
Could you please share how you configure the circular slider?
Thanks

@Raviojha62
Copy link
Author

Raviojha62 commented Jan 5, 2017

Hi Hamza,
Thanks for reply...
I am getting this problem when network is slow down and songs become change . i mean when slider again start from beginning .

I was configured it with cocoapods and the language is swift 3.0

Below is the few part of code in the class in which slider is being use.

  // update the slider position and the timer text

func updatePlayerUI(withCurrentTime currentTime: CGFloat) {
    circularSlider.endPointValue = currentTime
    var components = DateComponents()
    components.second = Int(currentTime)
    timeLbl.text = dateComponentsFormatter.string(from: components)
     }

func updateTimer() {
    var components = DateComponents()
    components.second = Int(circularSlider.endPointValue)
    timeLbl.text = dateComponentsFormatter.string(from: components)
}



func togglePlayer(_ sender: UIButton) {
    switch sender.tag {
    case 0:
        let currentTime = Float64(circularSlider.endPointValue)
        let newTime = CMTimeMakeWithSeconds(currentTime, 600)
        audioPlayer.seek(to: newTime, toleranceBefore: kCMTimeZero, toleranceAfter: kCMTimeZero)
        audioPlayer.play()
    default:
        audioPlayer.pause()
    }
}

@HamzaGhazouani
Copy link
Owner

I really can't reproduce the issue, but I think the problem is when you set the maximum value, sometimes is lower than the minimum value.
If you can share the code with issue in github I can look at it

@Raviojha62
Copy link
Author

Hi Hamza ,
You are right, the maximum value some time set 0.0 and minimum value was higher . thats why its being crash .
thanks for suggestion.

@HamzaGhazouani
Copy link
Owner

@Raviojha62 You are welcome :)

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

No branches or pull requests

2 participants