Last active
August 7, 2018 00:40
-
-
Save marcosatanaka/d0385ee70c2762512f2d5957ab18496f 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 OnboardingCollectionViewCell: UICollectionViewCell { | |
static let reuseIdentifier = "OnboardingCell" | |
@IBOutlet weak var pageImage: UIImageView! | |
@IBOutlet weak var pageTitle: UILabel! | |
@IBOutlet weak var pageDescription: UILabel! | |
@IBOutlet weak var startButton: UIButton! | |
func fill(with data: OnboardingModel) { | |
// Se quiser imagem no background, descomentar as linhas abaixo | |
// e criar atributo backgroundImage no OnboardingModel | |
// let backgroundImage = UIImageView(image: UIImage(named: data.backgroundImage)) | |
// backgroundImage.contentMode = .scaleAspectFill | |
// backgroundView = backgroundImage | |
backgroundColor = data.backgroundColor | |
pageImage.image = UIImage(named: data.iconImage) | |
pageTitle.text = data.title | |
pageDescription.text = data.content | |
startButton.alpha = data.hideButton ? 0 : 1 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment