StackOverFlowに同じ質問がありました
UIImageView - How to get the file name of the image assigned?
Swift
1extension UIImageView {
2 func getFileName() -> String? {
3 return self.image?.accessibilityIdentifier
4 }
5}
6
Swift
1 imageView.image = UIImage(named:"hoge.png")
2 imageView.image?.accessibilityIdentifier = "hoge.png"
3 print(imageView.getFileName()!) // hoge.png
4
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/03/18 15:44