Building Netflix App in Swift 5 and UIKit - (Xcode 13, 2021) - Episode 3 - Table Header View
private let bookmarkButton: UIButton = {
let button = UIButton()
var config = UIButton.Configuration.filled()
let title = NSAttributedString(string: "내가 찜한 콘텐츠", attributes: [NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.font: UIFont.systemFont(ofSize: 10)])
config.attributedTitle = AttributedString(title)
config.image = UIImage(systemName: "plus")
config.imagePadding = 5
config.imagePlacement = .top
config.baseForegroundColor = .white
config.background.backgroundColor = .clear
button.configuration = config
return button
}()
private func addGradient() {
let gradientLayer = CAGradientLayer()
gradientLayer.colors = [
UIColor.clear.cgColor,
UIColor.systemBackground.cgColor
]
gradientLayer.frame = bounds
layer.addSublayer(gradientLayer)
}
넷플릭스 API는 공식적으로 제공하지 않기 때문에 가데이터를 사용하거나 비공식 API를 통해 데이터를 다운로드받아야 할 것 같다.