Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.










📦










class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableView.relo...




class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableView....




👃
class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableView.relo...
class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableView.relo...


💢😡
☺










class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableVie...






class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableVie...
class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableView.relo...
class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableView.relo...
class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableView.relo...










💡




😄




🙌
🤔
😡👊💢






































protocol TimelineTableVCOutput: class {
func showEmptyView()
func hideEmptyView()
func showTimeline(time...
class TimelineTableViewController: UITableViewController {
@IBOutlet weak var emptyView: UIView!
// Presenter
private var ...


class TimelineTableViewController: UITableViewController {
@IBOutlet weak var emptyView: UIView!
// Presenter
private va...




class TimelineTableViewController: UITableViewController {
@IBOutlet weak var emptyView: UIView!
// Presenter
private ...
extension TimelineViewController: TimelineTableVCOutput {
func showEmptyView() {
emptyView.isHidden = false
}
func hideEmp...
class TimelinePresenter {
private weak var timelineTableVCOutput: TimelineTableVCOutput!
private var timelineUseCase = Tim...
class TimelinePresenter {
private weak var timelineTableVCOutput: TimelineTableVCOutput!
private var timelineUseCase = Tim...


















protocol TimelineTableVCOutput: class {
func showEmptyView()
func hideEmptyView()
func showAdView()
func hid...
class TimelineTableViewController: UITableViewController {
@IBOutlet weak var emptyView: UIView!
@IBOutlet weak var adView...












extension TimelineTableViewController: TimelineTableVCOutput {
func showEmptyView() {
emptyView.isHidden = fal...
class TimelinePresenter {
private weak var timelineTableVCOutput: TimelineTableVCOutput!
private var timelineUseCase = Tim...






class TimelineTableViewController: UITableViewController {
private var timeline: Timeline? = nil {
didSet {
tableVie...








class TimelineTableViewController: UITableViewController {
@IBOutlet weak var emptyView: UIView!
@IBOutlet weak va...
extension TimelineTableViewController: TimelineTableVCOutput {
func showEmptyView() {
emptyView.isHidden = false
}
func hi...




class TimelinePresenter {
private weak var timelineTableVCOutput: TimelineTableVCOutput!
private var timelineUseCase =...


👋
























VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
Upcoming SlideShare
Loading in …5
×

VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法

24,480 views

Published on

iosオールスターズ2で登壇した内容です。

Published in: Technology

VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法

  1. 1. 
 
 
 
 

  2. 2. 📦
  3. 3. 
 
 

  4. 4.
  5. 5.
  6. 6. class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! override func viewDidLoad() { super.viewDidLoad() TwitterManager.getTimeline() { [weak self] timeline in self?.timeline = timeline self?.showEmptyViewIfNeeded(timeline) } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } } 
 

  7. 7. 
 
 class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! override func viewDidLoad() { super.viewDidLoad() TwitterManager.getTimeline() { [weak self] timeline in self?.timeline = timeline self?.showEmptyViewIfNeeded(timeline) } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } }
  8. 8.
  9. 9. 
 👃
  10. 10. class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! override func viewDidLoad() { super.viewDidLoad() TwitterManager.getTimeline() { [weak self] timeline in self?.timeline = timeline self?.showEmptyViewIfNeeded(timeline) } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } } 

  11. 11. class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! override func viewDidLoad() { super.viewDidLoad() TwitterManager.getTimeline() { [weak self] timeline in self?.timeline = timeline self?.showEmptyViewIfNeeded(timeline) } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } }
  12. 12. 
 💢😡
  13. 13.
  14. 14.
  15. 15.
  16. 16. 
 
 
 class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! override func viewDidLoad() { super.viewDidLoad() TwitterManager.getTimeline() { [weak self] timeline in self?.timeline = timeline self?.showEmptyViewIfNeeded(timeline) self?.showAdViewIfNeeded(timeline) } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } private func showAdViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems >= 1 && timeline?.numberOfItems <= 3 { adView.isHidden = false } else { adView.isHidden = true } } }
  17. 17. 
 
 
 class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! @IBOutlet weak var loginView: LoginView! private var isLogined = false override func viewDidLoad() { super.viewDidLoad() LoginManager.login() { [weak self] isSucceed in if isSucceed { self?.isLogined = true TwitterManager.getTimeline() { [weak self] timeline in self?.timeline = timeline self?.showEmptyViewIfNeeded(timeline) self?.showAdViewIfNeeded(timeline) } } else { self?.isLogined = false } self?.showLoginViewIfNeeded() } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } private func showAdViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems >= 1 && timeline?.numberOfItems <= 3 { adView.isHidden = false } else { adView.isHidden = true } } private func showLoginViewIfNeeded() { if isLogined { loginView.isHidden = true } else { loginView.isHidden = false } } }
  18. 18. class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! @IBOutlet weak var loginView: LoginView! private var isLogined = false override func viewDidLoad() { super.viewDidLoad() LoginManager.login() { [weak self] isSucceed in guard let `self` = self else { return } if isSucceed { TwitterManager.getTimeline() { [weak self] timeline in guard let `self` = self else { return } self.timeline = timeline self.showEmptyViewIfNeeded(timeline) self.showAdViewIfNeeded(timeline) self.showLoginViewIfNeeded() } } } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } private func showAdViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems >= 1 && timeline?.numberOfItems <= 3 { adView.isHidden = false } else { adView.isHidden = true } } private func showLoginViewIfNeeded() { if isLogined { loginView.isHidden = true } else { loginView.isHidden = false } } private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! @IBOutlet weak var loginView: LoginView! private var isLogined = false override func viewDidLoad() { super.viewDidLoad() } }
  19. 19. class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! @IBOutlet weak var loginView: LoginView! private var isLogined = false override func viewDidLoad() { super.viewDidLoad() LoginManager.login() { [weak self] isSucceed in guard let `self` = self else { return } if isSucceed { TwitterManager.getTimeline() { [weak self] timeline in guard let `self` = self else { return } self.timeline = timeline self.showEmptyViewIfNeeded(timeline) self.showAdViewIfNeeded(timeline) self.showLoginViewIfNeeded() } } } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } private func showAdViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems >= 1 && timeline?.numberOfItems <= 3 { adView.isHidden = false } else { adView.isHidden = true } } private func showLoginViewIfNeeded() { if isLogined { loginView.isHidden = true } else { loginView.isHidden = false } } private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! @IBOutlet weak var loginView: LoginView! private var isLogined = false override func viewDidLoad() { super.viewDidLoad() LoginManager.login() { [weak self] isSucceed in guard let `self` = self else { return } if isSucceed { TwitterManager.getTimeline() { [weak self] timeline in guard let `self` = self else { return } self.timeline = timeline self.showEmptyViewIfNeeded(timeline) self.showAdViewIfNeeded(timeline) self.showLoginViewIfNeeded() } } } } }
  20. 20. class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! @IBOutlet weak var loginView: LoginView! private var isLogined = false override func viewDidLoad() { super.viewDidLoad() LoginManager.login() { [weak self] isSucceed in guard let `self` = self else { return } if isSucceed { TwitterManager.getTimeline() { [weak self] timeline in guard let `self` = self else { return } self.timeline = timeline self.showEmptyViewIfNeeded(timeline) self.showAdViewIfNeeded(timeline) self.showLoginViewIfNeeded() } } } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } private func showAdViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems >= 1 && timeline?.numberOfItems <= 3 { adView.isHidden = false } else { adView.isHidden = true } } private func showLoginViewIfNeeded() { if isLogined { loginView.isHidden = true } else { loginView.isHidden = false } } private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! @IBOutlet weak var loginView: LoginView! private var isLogined = false override func viewDidLoad() { super.viewDidLoad() LoginManager.login() { [weak self] isSucceed in guard let `self` = self else { return } if isSucceed { TwitterManager.getTimeline() { [weak self] timeline in guard let `self` = self else { return } self.timeline = timeline self.showEmptyViewIfNeeded(timeline) self.showAdViewIfNeeded(timeline) self.showLoginViewIfNeeded() } } } } override func viewDidLoad() { super.viewDidLoad() LoginManager.login() { [weak self] isSucceed in guard let `self` = self else { return } if isSucceed { TwitterManager.getTimeline() { [weak self] timeline in guard let `self` = self else { return } self.timeline = timeline self.showEmptyViewIfNeeded(timeline) self.showAdViewIfNeeded(timeline) self.showLoginViewIfNeeded() } } } } }
  21. 21. 
 
 
 

  22. 22. 
 💡
  23. 23.
  24. 24.
  25. 25. 😄
  26. 26. 
 

  27. 27. 🙌
  28. 28. 🤔
  29. 29. 😡👊💢
  30. 30.
  31. 31. 
 

  32. 32. 
 
 

  33. 33. 
 
 
 

  34. 34. 
 
 
 
 
 
 
 
 
 protocol TimelineTableVCOutput: class { func showEmptyView() func hideEmptyView() func showTimeline(timeline: Timeline) }
  35. 35. class TimelineTableViewController: UITableViewController { @IBOutlet weak var emptyView: UIView! // Presenter private var timelinePresenter: TimelinePresenter! fileprivate var timeline: Timeline? = nil { didSet { tableView.reloadData() } } override func viewDidLoad() { super.viewDidLoad() // Presenter timelinePresenter = TimelinePresenter(output: self) } @IBAction func tapGetTimelineButton(_ sender: Any) { // Presenter timelinePresenter?.getTimeline() } } 

  36. 36. 
 class TimelineTableViewController: UITableViewController { @IBOutlet weak var emptyView: UIView! // Presenter private var timelinePresenter: TimelinePresenter! fileprivate var timeline: Timeline? = nil { didSet { tableView.reloadData() } } override func viewDidLoad() { super.viewDidLoad() // Presenter timelinePresenter = TimelinePresenter(output: self) } @IBAction func tapGetTimelineButton(_ sender: Any) { // Presenter timelinePresenter?.getTimeline() } }
  37. 37. 
 
 class TimelineTableViewController: UITableViewController { @IBOutlet weak var emptyView: UIView! // Presenter private var timelinePresenter: TimelinePresenter! fileprivate var timeline: Timeline? = nil { didSet { tableView.reloadData() } } override func viewDidLoad() { super.viewDidLoad() // Presenter timelinePresenter = TimelinePresenter(output: self) } @IBAction func tapGetTimelineButton(_ sender: Any) { // Presenter timelinePresenter?.getTimeline() } }
  38. 38. extension TimelineViewController: TimelineTableVCOutput { func showEmptyView() { emptyView.isHidden = false } func hideEmptyView() { emptyView.isHidden = true } func showTimeline(timeline: Timeline) { self.timeline = timeline } }
  39. 39. class TimelinePresenter { private weak var timelineTableVCOutput: TimelineTableVCOutput! private var timelineUseCase = TimelineUseCase() init(output timelineTableVCOutput: TimelineTableVCOutput) { self.timelineTableVCOutput = timelineTableVCOutput } func getTimeline() { timelineUseCase.getTimeline() { [weak self] result in switch result { case .failure: self?.timelineViewControllerDelegate.showEmptyView() case .success(let timeline): self?.timelineViewControllerDelegate.hideEmptyView() self?.timelineViewControllerDelegate.showTimeline(timeline: timeline) } } } }
  40. 40. class TimelinePresenter { private weak var timelineTableVCOutput: TimelineTableVCOutput! private var timelineUseCase = TimelineUseCase() init(output timelineTableVCOutput: TimelineTableVCOutput) { self.timelineTableVCOutput = timelineTableVCOutput } func getTimeline() { timelineUseCase.getTimeline() { [weak self] result in switch result { case .failure: self?.timelineTableVCOutput.showEmptyView() case .success(let timeline): self?.timelineTableVCOutput.hideEmptyView() self?.timelineTableVCOutput.showTimeline(timeline: timeline) } } } }
  41. 41. 
 

  42. 42. 
 
 
 
 
 
 
 protocol TimelineTableVCOutput: class { func showEmptyView() func hideEmptyView() func showAdView() func hideAdView() func showTimeline(timeline: Timeline) }
  43. 43. class TimelineTableViewController: UITableViewController { @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! // Presenter private var timelinePresenter: TimelinePresenter! fileprivate var timeline: Timeline? = nil { didSet { tableView.reloadData() } } override func viewDidLoad() { super.viewDidLoad() // Presenter timelinePresenter = TimelinePresenter(output: self) } @IBAction func tapGetTimelineButton(_ sender: Any) { // Presenter timelinePresenter?.getTimeline() } } 
 
 
 
 

  44. 44. 
 
 
 
 
 
 extension TimelineTableViewController: TimelineTableVCOutput { func showEmptyView() { emptyView.isHidden = false } func hideEmptyView() { emptyView.isHidden = true } func showAdView() { adView.isHidden = false } func hideAdView() { adView.isHidden = true } func showTimeline(timeline: Timeline) { self.timeline = timeline } }
  45. 45. class TimelinePresenter { private weak var timelineTableVCOutput: TimelineTableVCOutput! private var timelineUseCase = TimelineUseCase() init(output timelineTableVCOutput: TimelineTableVCOutput) { self.timelineTableVCOutput = timelineTableVCOutput } func getTimeline() { timelineUseCase.getTimeline() { [weak self] result in switch result { case .failure: self?.timelineTableVCOutput.showEmptyView() self?.timelineTableVCOutput.hideAdView() case .success(let timeline): self?.timelineTableVCOutput.hideEmptyView() self?.timelineTableVCOutput.showTimeline(timeline: timeline) self?.showAdViewIfNeeded(timeline: timeline) } } } private func showAdViewIfNeeded(timeline: Timeline) { if timeline?.numberOfItems >= 1 && timeline?.numberOfItems <= 3 { timelineTableVCOutput.showAdView() } else { timelineTableVCOutput.hideAdView() } } } 
 
 
 
 

  46. 46. 
 
 
 class TimelineTableViewController: UITableViewController { private var timeline: Timeline? = nil { didSet { tableView.reloadData() } } @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! override func viewDidLoad() { super.viewDidLoad() TwitterManager.getTimeline() { [weak self] timeline in self?.timeline = timeline self?.showEmptyViewIfNeeded(timeline) self?.showAdViewIfNeeded(timeline) } } private func showEmptyViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems == 0 { emptyView.isHidden = false } else { emptyView.isHidden = true } } private func showAdViewIfNeeded(_ timeline: Timeline) { if timeline?.numberOfItems >= 1 && timeline?.numberOfItems <= 3 { adView.isHidden = false } else { adView.isHidden = true } } }
  47. 47. 
 
 
 
 class TimelineTableViewController: UITableViewController { @IBOutlet weak var emptyView: UIView! @IBOutlet weak var adView: AdView! // Presenter private var timelinePresenter: TimelinePresenter! fileprivate var timeline: Timeline? = nil { didSet { tableView.reloadData() } } override func viewDidLoad() { super.viewDidLoad() // Presenter timelinePresenter = TimelinePresenter(output: self) } @IBAction func tapGetTimelineButton(_ sender: Any) { // Presenter timelinePresenter?.getTimeline() } }
  48. 48. extension TimelineTableViewController: TimelineTableVCOutput { func showEmptyView() { emptyView.isHidden = false } func hideEmptyView() { emptyView.isHidden = true } func showAdView() { adView.isHidden = false } func hideAdView() { adView.isHidden = true } func showTimeline(timeline: Timeline) { self.timeline = timeline } }
  49. 49. 
 
 class TimelinePresenter { private weak var timelineTableVCOutput: TimelineTableVCOutput! private var timelineUseCase = TimelineUseCase() init(output timelineTableVCOutput: TimelineTableVCOutput) { self.timelineTableVCOutput = timelineTableVCOutput } func getTimeline() { timelineUseCase.getTimeline() { [weak self] result in switch result { case .failure: self?.timelineTableVCOutput.showEmptyView() self?.timelineTableVCOutput.hideAdView() case .success(let timeline): self?.timelineTableVCOutput.hideEmptyView() self?.timelineTableVCOutput.showTimeline(timeline: timeline) self?.showAdViewIfNeeded(timeline: timeline) } } } private func showAdViewIfNeeded(timeline: Timeline) { if timeline?.numberOfItems >= 1 && timeline?.numberOfItems <= 3 { timelineTableVCOutput.showAdView() } else { timelineTableVCOutput.hideAdView() } } }
  50. 50.
  51. 51. 👋
  52. 52. 
 
 
 

  53. 53.
  54. 54.
  55. 55. 
 
 
 

  56. 56. 
 


×