By Xmartlabs SRL.
ImageRow is a Eureka custom row that allows us to take or choose a picture.
import ImageRow
import Eureka
class ViewController: FormViewController {
override func viewDidLoad() {
super.viewDidLoad()
form +++ Section()
<<< ImageRow() { row in
row.title = "Image Row 1"
row.sourceTypes = [.PhotoLibrary, .SavedPhotosAlbum]
row.clearAction = .yes(style: UIAlertActionStyle.destructive)
}
+++
Section()
<<< ImageRow() {
$0.title = "Image Row 2"
$0.sourceTypes = .PhotoLibrary
$0.clearAction = .no
}
.cellUpdate { cell, row in
cell.accessoryView?.layer.cornerRadius = 17
cell.accessoryView?.frame = CGRect(x: 0, y: 0, width: 34, height: 34)
}
+++
Section()
<<< ImageRow() {
$0.title = "Image Row 3"
$0.sourceTypes = [.PhotoLibrary, .SavedPhotosAlbum]
$0.clearAction = .yes(style: .default)
}
}
}
NSPhotoLibraryUsageDescription key must be added to info.plist. For more information, take a look at apple documentation.
- iOS 8.0+
- Xcode 8.0+
- Eureka 2.0.*
- If you want to contribute please feel free to submit pull requests.
- If you have a feature request please open an issue.
- If you found a bug or need help please check older issues, FAQ before submitting an issue..
Before contribute check the CONTRIBUTING file for more info.
If you use ImageRow in your app We would love to hear about it! Drop us a line on twitter.
Follow these 3 steps to run Example project: Clone ImageRow repository, run carthage update
from project root folder, open ImageRow workspace and run the Example project.
You can also experiment and learn with the ImageRow Playground which is contained in ImageRow.workspace.
CocoaPods is a dependency manager for Cocoa projects.
To install ImageRow, simply add the following line to your Podfile:
pod 'ImageRow', '~> 2.0'
Carthage is a simple, decentralized dependency manager for Cocoa.
To install ImageRow, simply add the following line to your Cartfile:
github "EurekaCommunity/ImageRow" ~> 2.0
ImageRow has 2 properties to customize:
sourceTypes
which allows us to specify the source of the picture. It could be .PhotoLibrary, .Camera, .SavedPhotosAlbum, or any combination of the previous values sincesourceTypes
property type isImageRowSourceTypes
which conforms toOptionSet
.clearAction
let's us add a clear action sheet option and configure its style. Possible values are:.no
or.yes(style: UIAlertActionStyle)
. Notice that .yes value requires we pass aUIAlertActionStyle
style.
To localize the Actionsheet strings just add the keys "Take photo", "Photo Library", "Saved Photos", "Cancel", "Clear Photo"
to your Localizable.strings file
no content yet
This can be found in the CHANGELOG.md file.