Skip to main content

Posts

Showing posts from August, 2018

Pull-To-Refresh in UITableView in Swift 4

Pull-To-Refresh UIRefreshControl providing the refreshing  control on ScrollView, TableView and CollectionView. this tutorial we are study how to use UIRefreshControl over the tableview. UIRefreshControl is use over tableView whenever the webservice data display and reload on tableview. Full Code of UIRefreshControl + UITableView: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 import UIKit class ViewController : UIViewController , UITableViewDelegate , UITableViewDataSource { @IBOutlet var refreshtable : UITableView ! var refreshControl = UIRefreshControl () let data : [ String ] = [ "Apple" , "HP" , "Accer" ] override func viewDidLoad () { super . viewDidLoad () // Refresh control add in tableview. refreshControl . attributedTitle = NSAttributedString ( string : "Pull to refresh"...

How to load GIF image in Swift 3 ?

 Load GIF Image Hi, It’s very simple to set P NG  or J PG  image in  imageView . You can directly set using image name or image  URL . In this tutorial provide How to load GIF image in  UIImageView  in Swift.   Step 1 :  We are already c reate  fil e name as iOSDevCenters+GIF.swift in  which create an e xtension  of  UIImage  for load GIF images . Download the demo project and use below method to load GIF.   Step 2 :   T he  iOSDevCenters+GIF.swift file have thre e method s. You can load GIF image of its  name,  or  Converting GIF imag e to Data or Als o load  GIF fro m URL. Step 3 :  Load GIF image  of Name : 1 2 3 4 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 ...