UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let item = getTimelineItem(indexPath: indexPath) else { return UITableViewCell() } guard let cellInfo = getTimelineCellInfo(indexPath: indexPath) else { return UITableViewCell() } return getCell(tableView, indexPath: indexPath, item: item, cellInfo: cellInfo) } // Presenter func getTimelineCellInfo(_ item: TimelineItem) -> TimelineCellInfo? { switch item { case let (ٻobject) as (ٻobject): switch (ٻobject).status { case .accepted: return TimelineCellInfo(type: .accepted(ٻobject)) case .requested: return TimelineCellInfo(type: .requested(ٻobject)) case .rejected: return TimelineCellInfo(type: .rejected(ٻobject)) default: return nil } case let (ࢧ͍object) as (ࢧ͍object): if (݅1) { switch (ࢧ͍object).status { case .accepted: return TimelineCellInfo(type: .accepted(ࢧ͍object)) case .requested: return TimelineCellInfo(type: .requested(ࢧ͍object)) case .rejected: return TimelineCellInfo(type: .rejected(ࢧ͍object)) default: return nil } } else if (݅2) { guard let subject = .. else { return nil } guard let secondarySubject = .. else { return nil } return TimelineCellInfo(type: .(ࢧ͍objectλΠϓ1), subject: subject, secondarySubject: secondarySubject) } else { if (݅a) { if let subject = .., let secondarySubject = .. { return TimelineCellInfo(type: .(ࢧ͍objectλΠϓ1), subject: subject, secondarySubject: secondarySubject) } } else if (݅b) { if let .. { return TimelineCellInfo(type: .(ࢧ͍objectλΠϓ2), subject: subject) } } else if (݅c) { if let .. { return TimelineCellInfo(type: .(ࢧ͍objectλΠϓ2), subject: subject) } } } case _ as ..: return TimelineCellInfo(type: .fuga) VC Presenter ViewController΄ͱΜͲԿ͠ͳ͍ PresenterʹUIϩδοΫΛ·ͱΊͨͷͰςετॻ͖͍͢ 19