Created
June 3, 2018 12:38
-
-
Save mitnick78/4fea3c2ae0d4a92d6ca073b339247a7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class MonumentCollectionCell: UICollectionViewCell { | |
@IBOutlet weak var monumentViewCell: UIView! | |
@IBOutlet weak var cover: UIImageView! | |
var monument: MonumentSlider! | |
var mapView: MapViewController! | |
func setup(monument: MonumentSlider){ | |
self.monument = monument | |
monumentViewCell.layer.shadowColor = UIColor.black.cgColor | |
monumentViewCell.layer.shadowOpacity = 0.5 | |
monumentViewCell.layer.shadowOffset = CGSize.zero | |
monumentViewCell.layer.cornerRadius = 10 | |
cover.contentMode = .scaleAspectFill | |
cover.layer.cornerRadius = 5 | |
cover.clipsToBounds = true | |
cover.isUserInteractionEnabled = true | |
let id = Int(monument.id) | |
cover.tag = id! | |
let tap = UITapGestureRecognizer(target: self, action: #selector(tappedMe)) | |
cover.addGestureRecognizer(tap) | |
ImageDownloader.getImage.imageSince(monument.cover, imageView: cover) | |
} | |
@objc | |
func tappedMe(sender: UITapGestureRecognizer){ | |
print(sender.view?.tag ?? 0) | |
mapView.toControllerView(id: (sender.view?.tag)!) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment