Answers for "swift add animated icon"

0

swift add animated icon

func createImageArray(total: Int, imagePrefix: String) -> [UIImage] {
    var imageArray:[UIImage] = []
    for imageCount in 1..<total {
        let imageName = "\(imagePrefix).\(imageCount)"
        let image = UIImage(named: imageName)!

        imageArray.append(image)
    }

    return imageArray
}

func animate(imageView: UIImageView, images: [UIImage]) {
    imageView.animationImages = images
    imageView.animationDuration = 0.7
    imageView.animationRepeatCount = 1
    imageView.startAnimating()
}
Posted by: Guest on May-24-2021

Code answers related to "Swift"

Browse Popular Code Answers by Language