Notice
Recent Posts
Recent Comments
Link
투케이2K
260. (ios/swift) Gifu 라이브러리 사용해 gif 이미지 애니메이션 재생 실시 본문
[개발 환경 설정]
개발 툴 : XCODE
개발 언어 : SWIFT

[SPM 사용해 라이브러리 설치 방법]



[프로젝트 내 설정 사항]



[소스 코드]
// MARK: - [테스트 함수 정의]
func testMain() {
print("")
print("===============================")
print("[ViewController >> testMain() :: 테스트 함수 수행]")
print("===============================")
print("")
/*
-------------------------------
[요약 설명]
-------------------------------
1. 라이브러리 설치 주소 : https://github.com/kaishin/Gifu.git
-------------------------------
2. 라이브러리 사용 import : import Gifu
-------------------------------
3. 참고 사이트 : https://github.com/kaishin/Gifu
-------------------------------
*/
// [gif 이미지 동작 수행 실시 : gifufigure.gif]
DispatchQueue.main.async {
// [애니메이션 준비 상태 확인]
self.gifImage.prepareForAnimation(withGIFNamed: "gifufigure") {
print("")
print("===============================")
print("[ViewController >> testMain() :: gifufigure GIF 파일 애니메이션 준비 완료]")
print("===============================")
print("")
}
// [애니메이션 동작 수행]
self.gifImage.animate(withGIFNamed: "gifufigure", animationBlock: { })
}
}
[결과 출력]

반응형
'IOS' 카테고리의 다른 글
Comments