-
Notifications
You must be signed in to change notification settings - Fork 0
/
DetailTableViewCell.swift
68 lines (39 loc) · 1.39 KB
/
DetailTableViewCell.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// DetailTableViewCell.swift
// IGApiApp
//
// Created by 陳秉軒 on 2022/5/2.
//
import UIKit
import AVFoundation
import AVKit
class DetailTableViewCell: UITableViewCell {
@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var postImage: UIImageView!
@IBOutlet weak var userNameLabel: UILabel!
@IBOutlet weak var likeButton: UIButton!
@IBOutlet weak var videoViewCountLabel: UILabel!
@IBOutlet weak var postCaptionLabel: UILabel!
@IBOutlet weak var postCommentLabel: UILabel!
@IBOutlet weak var timeLamel: UILabel!
var likeButtonStatus: Bool = false
@IBAction func like(_ sender: UIButton) {
likeButtonStatus = !likeButtonStatus
if likeButtonStatus {
likeButton.setImage(UIImage(named: "iconRedLove"), for: UIControl.State.normal)
}
else {
likeButton.setImage(UIImage(named: "iconLove"), for: UIControl.State.normal)
}
}
var player = AVPlayer()
var playerLayer = AVPlayerLayer()
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}