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

iOS 13 issue when image is set to button in viewDidLayoutSubviews #106

Open
YuriSolodkin opened this issue Jul 17, 2019 · 1 comment
Open

Comments

@YuriSolodkin
Copy link

The problem only appears in iOS 13, it works fine in iOS 12.
When an image is created via FontAwesomeKit and then assigned to a UIButton, it creates another call to viewDidLayoutSubviews which results in an infinite loop and finally an app crash.

The following example illustrates the problem:

class ViewController: UIViewController {

    @IBOutlet weak var button: UIButton!

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
    
        let fakImage = FAKFontAwesome.addressBookOIcon(withSize: 30)
        let image = fakImage?.image(with: CGSize(width: 30, height: 30))
    
        // This works fine
        // button.setImage(UIImage.add, for: .normal)
    
        // But this fails
        button.setImage(image, for: .normal)
    }
}

System images or images loaded from files are working fine.

@jkaunert
Copy link

I also am now experiencing this exact issue. Xcode 11.3.1, macOS 10.15.2

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

No branches or pull requests

2 participants