CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Daron Tancharoen.
An easy way to display multiple network images in a standard paging-scrollview style.
iOS 8.0+, Swift 3.0
Drag a new view to your storyboard or interface builder. Change its class to DTImageScrollView. In viewDidLoad()
, set the datasource
and placeholderImage
.
self.imageScrollView.datasource = self
self.imageScrollView.placeholderImage = UIImage(named: "placeholder")
Implement 2 datasource functions
func numberOfImages() -> Int {
return 3
}
func imageURL(index: Int) -> URL {
return NSURL(string: "http://www.boxzeed.com/wp-content/uploads/2015/09/1.1.3.jpg")!
}
Call show()
to reload & display images
self.imageScrollView.show()
See more detail in the demo project
You can directly access and modify the scrollview propeties - scrollView
pageControl
placeholderImage
For example,
self.photosScrollView.pageControl.currentPageIndicatorTintColor = Utility.MAIN_RED_COLOR
self.photosScrollView.pageControl.pageIndicatorTintColor = UIColor.whiteColor()
Daron Tancharoen
DTImageScrollView is licensed under the MIT License, please see the LICENSE file.