-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat-swiftui-hint
- Loading branch information
Showing
67 changed files
with
1,534 additions
and
440 deletions.
There are no files selected for viewing
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
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
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
2 changes: 1 addition & 1 deletion
2
...UISample/Sources/CharcoalSwiftUISample/Media.xcassets/SnackbarDemo.imageset/Contents.json
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
Binary file added
BIN
+2.09 KB
...es/CharcoalSwiftUISample/Media.xcassets/SnackbarDemo.imageset/charcoal-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
2 changes: 1 addition & 1 deletion
2
...IKitSample/Sources/CharcoalUIKitSample/Media.xcassets/SnackbarDemo.imageset/Contents.json
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
Binary file added
BIN
+2.09 KB
...rces/CharcoalUIKitSample/Media.xcassets/SnackbarDemo.imageset/charcoal-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions
65
CharcoalUIKitSample/Sources/CharcoalUIKitSample/Views/Balloons/BalloonTableViewCell.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import UIKit | ||
|
||
class BalloonTableViewCell: UITableViewCell { | ||
static let identifier = "TooltipCell" | ||
|
||
let titleLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = UIFont.systemFont(ofSize: 16, weight: .medium) | ||
label.textColor = UIColor.black | ||
label.translatesAutoresizingMaskIntoConstraints = false | ||
return label | ||
}() | ||
|
||
let leadingImageView: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.contentMode = .scaleAspectFit | ||
imageView.translatesAutoresizingMaskIntoConstraints = false | ||
return imageView | ||
}() | ||
|
||
let accessoryImageView: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.contentMode = .scaleAspectFit | ||
imageView.translatesAutoresizingMaskIntoConstraints = false | ||
return imageView | ||
}() | ||
|
||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
|
||
contentView.addSubview(titleLabel) | ||
contentView.addSubview(leadingImageView) | ||
contentView.addSubview(accessoryImageView) | ||
|
||
NSLayoutConstraint.activate([ | ||
leadingImageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 10), | ||
leadingImageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor) | ||
]) | ||
|
||
NSLayoutConstraint.activate([ | ||
titleLabel.leadingAnchor.constraint(equalTo: leadingImageView.trailingAnchor, constant: 10), | ||
titleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor) | ||
]) | ||
|
||
NSLayoutConstraint.activate([ | ||
accessoryImageView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -10), | ||
accessoryImageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor) | ||
]) | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func layoutSubviews() { | ||
super.layoutSubviews() | ||
} | ||
|
||
override func prepareForReuse() { | ||
super.prepareForReuse() | ||
titleLabel.text = nil | ||
leadingImageView.image = nil | ||
} | ||
} |
Oops, something went wrong.