marcosgriselli / ViewAnimator

ViewAnimator brings your UI to life with just one line
MIT License
7.3k stars 488 forks source link

When/Where to use it? #52

Closed rawnly closed 5 years ago

rawnly commented 5 years ago

Hi! I'm pretty new in swift and I didn't exactly understood where to call the animation in an UITableView..

I want to reproduce something like this

    

I've tried calling it inside viewDidLoad but nothing happens, the same in viewWill/DidAppear..

That's my code:

   override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        self.hero.isEnabled = false
        self.navigationController?.hero.isEnabled = false

        tableView.reloadData()
        let cells = tableView.visibleCells(in: 0)
        let animation = AnimationType.from(direction: .bottom, offset: 30.0)

        UIView.animate(views: cells, animations: [animation])
    }
rawnly commented 5 years ago

Sorry, big mistake. Awesome lib!