• Stars
    star
    182
  • Rank 211,154 (Top 5 %)
  • Language
    Swift
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Load GIF image in UIImageView - Swift

#Swift tutorial blog : https://iosdevcenters.blogspot.com/

GIF-Swift

This tutorial have one Class name as iOSDevCenters+GIF.swift downlaod this file and adding the file in your project. after you can use as below code.

#Load GIF image Using Name

    let jeremyGif = UIImage.gifImageWithName("funny")
    let imageView = UIImageView(image: jeremyGif)
    imageView.frame = CGRect(x: 20.0, y: 50.0, width: self.view.frame.size.width - 40, height: 150.0)
    view.addSubview(imageView)

#Load GIF image Using Data

    let imageData = try? Data(contentsOf: Bundle.main.url(forResource: "play", withExtension: "gif")!)
    let advTimeGif = UIImage.gifImageWithData(imageData!)
    let imageView2 = UIImageView(image: advTimeGif)
    imageView2.frame = CGRect(x: 20.0, y: 220.0, width: self.view.frame.size.width - 40, height: 150.0)
    view.addSubview(imageView2)

#Load GIF image URL

    let gifURL : String = "http://www.gifbin.com/bin/4802swswsw04.gif"
    let imageURL = UIImage.gifImageWithURL(gifURL)
    let imageView3 = UIImageView(image: imageURL)
    imageView3.frame = CGRect(x: 20.0, y: 390.0, width: self.view.frame.size.width - 40, height: 150.0)
    view.addSubview(imageView3)

#OutPut

Swift GIF Image

for more referance tutorial of Swift : https://iosdevcenters.blogspot.com/

More Repositories

1

GIFIamgeView_Swift

To load GIF image in Swift.
Objective-C
21
star
2

ReturnKey-SwiftDemo

ReturnKey-Swift Demo to add key on NumberPad KeyBoard.
Swift
11
star
3

Custom-DatePicker

Custom DatePicker for all devices like iPhone4 , iPhone5 , iPhone6 , iPhone 6 Plus and All iPad and also compatiable for all IOS.
Objective-C
6
star
4

CoreDataDemo-Swift

Insert-Update-Delete and Fetch in CoreData in Swift.
Swift
5
star
5

PickerView-Swift3.0

PickerView with ToolBar in Swift 3.0.
Swift
5
star
6

textFiled_InputView

UIDatePicker with UIToolBar in UITextField using input view.
Swift
5
star
7

SoapAPIDemo

SoapAPIDemo Calling Soap API using AFNetworking - Swift 2.0 Xcode 7.2.
Objective-C
5
star
8

TwitterPost

Login with twitter and tweet , Raply on Tweet , Favorite on Tweet and Retweet.
Objective-C
3
star
9

iWatch

iWatch App in Swift.
Swift
3
star
10

PreViewInIOS

PreviewInIOS gives details of URL like Photo , Base URL , Description , and Title of URL. This information get Using api.embed.ly
Objective-C
3
star
11

FlipDemo

ViewController filp animation.
Swift
2
star
12

PinchGesture-Swift3

Pinch Gesture in Swift 3.0
Swift
2
star
13

NSURLRequest-Swift-Demo

NSURLRequest-Swift Calling web service.
Swift
2
star
14

AlertViewController_Demo

Simple, PlainText , Secure , Login Style - AlertController
Swift
2
star
15

Barcode-Scan

Barcode-Scan With Xcode 9 And iOS 11.
Swift
2
star
16

RotateGesture-Swift3

Rotate Gesture in Swift 3.0
Swift
1
star
17

RecordAndPlay

More Swift tutorials :
Swift
1
star
18

WebviewSample-

WebviewSample in Swift
Swift
1
star
19

MultipleColor-Label

To set multiple color string.
Swift
1
star