update FeedCellLayout for URLLayout

This commit is contained in:
nixzhu
2016-01-15 10:58:26 +08:00
parent aa7adde972
commit 67369d73e4
3 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -2968,7 +2968,7 @@ struct DiscoveredFeed: Hashable {
let description: String
let thumbnailImageURLString: String
static func URLInfo(json: JSONDictionary) -> URLInfo? {
static func fromJSONDictionary(json: JSONDictionary) -> URLInfo? {
guard let
URLString = json["url"] as? String,
URL = NSURL(string: URLString),
@@ -1076,6 +1076,10 @@ extension FeedsViewController: UITableViewDataSource, UITableViewDelegate {
cell.configureWithFeed(feed, layoutCache: layoutCache, needShowSkill: needShowSkill)
case .URL:
cell.configureWithFeed(feed, layoutCache: layoutCache, needShowSkill: needShowSkill)
case .Image:
let tapMediaAction: FeedTapMediaAction = { [weak self] transitionView, image, attachments, index in
+14
View File
@@ -111,6 +111,11 @@ struct FeedCellLayout {
}
var locationLayout: LocationLayout?
struct URLLayout {
let URLContainerViewFrame: CGRect
}
var _URLLayout: URLLayout?
// MARK: - Init
init(height: CGFloat, basicLayout: BasicLayout) {
@@ -217,6 +222,15 @@ struct FeedCellLayout {
case .Text:
break
case .URL:
let height: CGFloat = leftBottomLabelFrame.origin.y - beginY - 15
let URLContainerViewFrame = CGRect(x: 65, y: beginY, width: screenWidth - 65 - 60, height: height)
let _URLLayout = FeedCellLayout.URLLayout(URLContainerViewFrame: URLContainerViewFrame)
self._URLLayout = _URLLayout
case .Image: