alan881 / aacarousel Goto Github PK
View Code? Open in Web Editor NEWEasy to create image slider in Swift
License: MIT License
Easy to create image slider in Swift
License: MIT License
Update to 4.2 please
I get angry here, I get an error like this.
fatal error: unexpectedly found nil while unwrapping an Optional value
The page indicator is not showing in ios 14.
Hi,
How to remove that black text area?
Thanks.
I am able to add imageView to view but after scrolling left or right background view shows first then image. I want only image.
so the first image in the array will never show up, except if I change to the page control 2 (index 1), and goes back to the page control 1 (index 0) then the image is eventually show up
here is the .gif file of my problem:
http://g.recordit.co/EdK3BzgCCj.gif
even if I use the image in the asset, the problem is still there
the pod I use
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'AATheCorousel' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for AATheCorousel
pod 'AACarousel'
pod 'Kingfisher', '~> 4.0'
end
and here is the code I use
import UIKit
import AACarousel
import Kingfisher
class ViewController: UIViewController, AACarouselDelegate {
@IBOutlet var corouselView: AACarousel!
var titleArray = [String]()
override func viewDidLoad() {
super.viewDidLoad()
let pathArray = ["http://www.conversion-uplift.co.uk/wp-content/uploads/2016/09/Lamborghini-Huracan-Image-672x372.jpg",
"https://ak.picdn.net/assets/cms/97e1dd3f8a3ecb81356fe754a1a113f31b6dbfd4-stock-photo-photo-of-a-common-kingfisher-alcedo-atthis-adult-male-perched-on-a-lichen-covered-branch-107647640.jpg",
"https://imgct2.aeplcdn.com/img/800x600/car-data/big/honda-amaze-image-12749.png",
"http://www.conversion-uplift.co.uk/wp-content/uploads/2016/09/Lamborghini-Huracan-Image-672x372.jpg",
"https://imgct2.aeplcdn.com/img/800x600/car-data/big/honda-amaze-image-12749.png"]
titleArray = ["picture 1","picture 2","picture 3","picture 4","picture 5"]
corouselView.delegate = self
corouselView.setCarouselData(paths: pathArray, describedTitle: titleArray, isAutoScroll: false, timer: 5.0, defaultImage: "defaultImage")
//optional methods
corouselView.setCarouselOpaque(layer: false, describedTitle: false, pageIndicator: false)
corouselView.setCarouselLayout(displayStyle: 0, pageIndicatorPositon: 2, pageIndicatorColor: nil, describedTitleColor: nil, layerColor: nil)
}
func didSelectCarouselView(_ view: AACarousel, _ index: Int) {
}
func callBackFirstDisplayView(_ imageView: UIImageView, _ url: [String], _ index: Int) {
}
func downloadImages(_ url: String, _ index: Int) {
//here is download images area
let imageView = UIImageView()
imageView.kf.setImage(with: URL(string: url)!, placeholder: nil, options: nil, progressBlock: nil) { (downloadImage, error, cache, url) in
self.corouselView.images[index] = downloadImage!
}
}
}
Hi Recently I was installing pod it. and am getting same error above it (undecleared AACarousel). i don't know how to install carthage and use it. please help me
I like the library and it is what I need for my app.
but can I use it for my iPhone application?
because from the pictures, it looks like it is for big size screens like the iPad
sorry for my newb question
I am getting this error while writing this line
imageView.kf.setImage(with: URL(string: url[index]), placeholder: UIImage.init(named: "defaultImage"), options: [.transition(.fade(1))], progressBlock: nil, completionHandler: nil)
Bug when no banner is on carousel
If you don't put any banner on carousel, but show it, when tap the project crash.
Line that crash:
//MARK:- UITapGestureRecognizer
@objc fileprivate func didSelectImageView() {
if let delegate = delegate {
if let method = delegate.didSelectCarouselView {
method(self, currentIndex) // <--- crash
return
}
}
}
I think that it is simple, can you fix it?
Thanks.
First of all, I want to give you many many thanks for this awesome, sweet plugin. But the problem is in first load the first image of the slider is not visible, it's showing a blank white area. I check the same issue, but that doesn't work for me. Can you help on this matter? Advance thanks for your help. I just use this simple piece of code.
`
let pathArray = ["slider1",
"slider2",
"slider3"
]
titleArray = ["picture 1","picture 2","picture 3"]
slider.delegate = self as? AACarouselDelegate
slider.setCarouselData(paths: pathArray, describedTitle: titleArray, isAutoScroll: true, timer: 10.0, defaultImage: "slider1")
//optional methods
slider.setCarouselOpaque(layer: true, describedTitle: false, pageIndicator: false)
slider.setCarouselLayout(displayStyle: 0, pageIndicatorPositon: 5, pageIndicatorColor: nil, describedTitleColor: nil, layerColor: nil)`
or one more question can I set the default select number 2 image of the slider?
Hi Alan,
I would note to your users that they should modify their plist to Allow Arbitrary Loads. I encountered an error where the completion handler was returning nil, since it could not get an image due to security settings.
https://stackoverflow.com/questions/32532020/nsurl-error-code-1022
Unable to Set height for title label
Also I am not able to set aspect fit to the image
Please add in readme how to handle local images?
Also, for various options, like position of indicator, and colors, please put in infographic to clearly show how to set options?
Hey, there I am using Xcode version 9.4.1. Whenever I try to build I get this error.
error: The following binaries use incompatible versions of Swift:
/Users/yugstart/Library/Developer/Xcode/DerivedData/Groupool-amsflkbggzuopgbegwbuvdefhrys/Build/Products/Debug-iphonesimulator/Groupool.app/Groupool
/Volumes/Yugstart-Work/Xcode/groupool_ios_dev/Groupool/AACarousel.framework/AACarousel
Please let me know the solution.
how to change background color i can't :(
Hi I want to add padding among page control dots. is that possible.
Hi,
I put a log on "downloadImages" and see that all 3 banner is loaded, but it still on first banner with blank background without image. The image only show when i change page and back.
How can i solve it? Banner need be showed on the current page when it is loaded without need change page.
Thanks.
Can anyone help me how to use this with XCode 9 swift 4
Cannot able to use the newly updated feature of kf "DownsamplingImageProcessor
"
Can u please push an update with updated Kingfisher
Thanks Cheers
Hi,
Very nice.
It have Carthage support?
Can you add it not?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.