ivanvorobei / SPIndicator

Floating indicator, mimicrate to indicator which appear when silent mode switched. Can be present from top and bottom. Interactive with gesters.
https://opensource.ivanvorobei.io
MIT License
768 stars 48 forks source link

didn't present #3

Closed AMJ-7 closed 3 years ago

AMJ-7 commented 3 years ago

Describe the bug didn't present the indicatorView To Reproduce

import SPIndicator

class ViewController: UIViewController {

    let indicatorView = SPIndicatorView(title: "wow", message: "succ")

    override func viewDidLoad() {
        super.viewDidLoad()
        indicatorView.layout.iconSize = .init(width: 24, height: 24)
        indicatorView.layout.margins.top = 20
        indicatorView.dismissByDrag = true
        indicatorView.present()
    }

Smartphone (please complete the following information):

ivanvorobei commented 3 years ago

Hi there! You shouldn't present any controllers or views in viewDidLoad method, because controller not visible at this moment. Choose viewDidAppear for example.

AMJ-7 commented 3 years ago

No, didn't worked ?!!

ivanvorobei commented 3 years ago

Provide please code

AMJ-7 commented 3 years ago

Provide please code

import UIKit import SPIndicator

class ViewController: UIViewController {

let indicatorView = SPIndicatorView(title: "Complete", preset: .done)

override func viewDidLoad() {
    super.viewDidLoad()
    print("viewDidLoad")
}

override func viewDidAppear(_ animated: Bool) {
    indicatorView.present(duration: 1, haptic: .error) {
        print("viewDidAppear")
    }
}

}

ivanvorobei commented 3 years ago

You are right. Please, update to latest version. Fixed already.