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.


📦










🤔
override func viewDidLoad() {
super.viewDidLoad()
// HUD
MBProgressHUD.showAdded(to: view, animated: true)
Alamofire.req...
🤔
override func viewDidLoad() {
super.viewDidLoad()
metadataObjectTypesButton.isEnabled = false
sessionPresetsButton.isEna...
























































🤔
override func viewDidLoad() {
super.viewDidLoad()
// HUD
MBProgressHUD.showAdded(to: view, animated: true)
Alamofire.req...
🙆
class PiyoViewControllerImpl: UIViewController {

var piyoPresenter: PiyoPresenter!

@IBOutlet weak var piyoLabel: UILab...




















protocol StatsViewController: class {
func showProfile(_ profile: Profile)
func reloadTableView()
}
final class StatsViewControllerImpl: UIViewController {
var statsPresenter: StatsPresenter!
@IBOutlet weak var nicknameLab...
final class StatsViewControllerImpl: UIViewController {
var statsPresenter: StatsPresenter!
@IBOutlet weak var nicknameLab...


final class StatsViewControllerImpl: UIViewController {
var statsPresenter: StatsPresenter!
@IBOutlet weak var nicknameL...


protocol StatsPresenter: class {
var stats: Stats! { get }
func readyForDisplay(byMatsh match: Match, region: Region)
}
final class StatsPresenterImpl: StatsPresenter {
private let pubgTrackerDataStore = PubgTrackerDataStore()
private weak va...
final class StatsPresenterImpl: StatsPresenter {
private let pubgTrackerDataStore = PubgTrackerDataStore()
private weak va...
final class StatsPresenterImpl: StatsPresenter {
private let pubgTrackerDataStore = PubgTrackerDataStore()
private weak va...


final class StatsViewControllerImpl: UIViewController {
var statsPresenter: StatsPresenter!
@IBOutlet weak var nicknameL...


































節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
Upcoming SlideShare
Loading in …5
×

節子、それViewControllerやない...、FatViewControllerや...。

16,134 views

Published on

iOSDC 2017 前夜祭の資料 #iosdc

Published in: Technology
  • Be the first to comment

節子、それViewControllerやない...、FatViewControllerや...。

  1. 1. 

  2. 2. 📦
  3. 3.
  4. 4. 
 
 

  5. 5.
  6. 6. 🤔 override func viewDidLoad() { super.viewDidLoad() // HUD MBProgressHUD.showAdded(to: view, animated: true) Alamofire.request("https://hogefuga.com/piyo").responseJSON { [weak self] response in guard response.error == nil else { return } guard let data = response.data else { return } guard let piyo = String(data: data, encoding: .utf8) else { return } guard let weakSelf = self else { return } // UI weakSelf.piyoLabel.text = piyo DispatchQueue.main.async { [weak self] in guard let s = self else { return } MBProgressHUD.hideAllHUDs(for: s.view, animated: true) } } }
  7. 7. 🤔 override func viewDidLoad() { super.viewDidLoad() metadataObjectTypesButton.isEnabled = false sessionPresetsButton.isEnabled = false cameraButton.isEnabled = false zoomSlider.isEnabled = false previewView.addGestureRecognizer(openBarcodeURLGestureRecognizer) previewView.session = session switch AVCaptureDevice.authorizationStatus(forMediaType: .video) { case .authorized: break case .notDetermined: sessionQueue.suspend() AVCaptureDevice.requestAccess(forMediaType: .video, completionHandler: { granted in if !granted { self.setupResult = .notAuthorized } self.sessionQueue.resume() }) default: setupResult = .notAuthorized } sessionQueue.async { self.configureSession() } }
  8. 8. 
 

  9. 9.
  10. 10. 
 
 

  11. 11. 
 
 
 
 
 

  12. 12.
  13. 13.
  14. 14. 
 
 
 
 
 
 

  15. 15. 
 
 
 

  16. 16.
  17. 17.
  18. 18.
  19. 19. 🤔 override func viewDidLoad() { super.viewDidLoad() // HUD MBProgressHUD.showAdded(to: view, animated: true) Alamofire.request("https://hogefuga.com/piyo").responseJSON { [weak self] response in guard response.error == nil else { return } guard let data = response.data else { return } guard let piyo = String(data: data, encoding: .utf8) else { return } guard let weakSelf = self else { return } // UI weakSelf.piyoLabel.text = piyo DispatchQueue.main.async { [weak self] in guard let s = self else { return } MBProgressHUD.hideAllHUDs(for: s.view, animated: true) } } }
  20. 20. 🙆 class PiyoViewControllerImpl: UIViewController {
 var piyoPresenter: PiyoPresenter!
 @IBOutlet weak var piyoLabel: UILabel!
 override func viewDidLoad() { super.viewDidLoad() piyoPresenter.readyForDisplay() } }
 
 extension PiyoViewControllerImpl: PiyoViewController { func showProgress() { MBProgressHUD.showAdded(to: view, animated: true) } func hideProgress() { DispatchQueue.main.async { [weak self] in guard let weakSelf = self else { return } MBProgressHUD.hideAllHUDs(for: weakSelf.view, animated: true) } } func showPiyo(piyo: String) { piyoLabel.text = piyo } }
  21. 21.
  22. 22. 
 
 
 
 
 
 
 
 
 protocol StatsViewController: class { func showProfile(_ profile: Profile) func reloadTableView() }
  23. 23. final class StatsViewControllerImpl: UIViewController { var statsPresenter: StatsPresenter! @IBOutlet weak var nicknameLabel: UILabel! @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() statsPresenter.readyForDisplay(byMatch: .solo, region: .asia) } } extension StatsViewControllerImpl: StatsViewController { func showProfile(_ profile: Profile) { DispatchQueue.main.async { [weak self] in guard let weakSelf = self else { return } weakSelf.nicknameLabel.text = profile.playerName } } func reloadTableView() { tableView.reloadData() } }
  24. 24. final class StatsViewControllerImpl: UIViewController { var statsPresenter: StatsPresenter! @IBOutlet weak var nicknameLabel: UILabel! @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() statsPresenter.readyForDisplay(byMatch: .solo, region: .asia) } } extension StatsViewControllerImpl: StatsViewController { func showProfile(_ profile: Profile) { DispatchQueue.main.async { [weak self] in guard let weakSelf = self else { return } weakSelf.nicknameLabel.text = profile.playerName } } func reloadTableView() { tableView.reloadData() } }
  25. 25. 
 final class StatsViewControllerImpl: UIViewController { var statsPresenter: StatsPresenter! @IBOutlet weak var nicknameLabel: UILabel! @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() statsPresenter.readyForDisplay(byMatch: .solo, region: .asia) } } extension StatsViewControllerImpl: StatsViewController { func showProfile(_ profile: Profile) { DispatchQueue.main.async { [weak self] in guard let weakSelf = self else { return } weakSelf.nicknameLabel.text = profile.playerName } } func reloadTableView() { tableView.reloadData() } }
  26. 26. 
 protocol StatsPresenter: class { var stats: Stats! { get } func readyForDisplay(byMatsh match: Match, region: Region) }
  27. 27. final class StatsPresenterImpl: StatsPresenter { private let pubgTrackerDataStore = PubgTrackerDataStore() private weak var statsViewController: StatsViewController! private var nickname: String! var stats: Stats! init(statsViewController: StatsViewController, nickname: String) { self.statsViewController = statsViewController self.nickname = nickname } func readyForDisplay(byMatsh match: Match, region: Region) { pubgTrackerDataStore.fetchPubgTracker(byNickname: nickname) { [weak self] stats in guard let weakSelf = self else { return } weakSelf.stats = stats weakSelf.statsViewController.reloadTableView() weakSelf.statsViewController.showProfile(profile) } } }
  28. 28. final class StatsPresenterImpl: StatsPresenter { private let pubgTrackerDataStore = PubgTrackerDataStore() private weak var statsViewController: StatsViewController! private var nickname: String! var stats: Stats! init(statsViewController: StatsViewController, nickname: String) { self.statsViewController = statsViewController self.nickname = nickname } func readyForDisplay(byMatsh match: Match, region: Region) { pubgTrackerDataStore.fetchPubgTracker(byNickname: nickname) { [weak self] stats in guard let weakSelf = self else { return } weakSelf.stats = stats weakSelf.statsViewController.reloadTableView() weakSelf.statsViewController.showProfile(profile) } } }
  29. 29. final class StatsPresenterImpl: StatsPresenter { private let pubgTrackerDataStore = PubgTrackerDataStore() private weak var statsViewController: StatsViewController! private var nickname: String! var stats: Stats! init(statsViewController: StatsViewController, nickname: String) { self.statsViewController = statsViewController self.nickname = nickname } func readyForDisplay(byMatsh match: Match, region: Region) { pubgTrackerDataStore.fetchPubgTracker(byNickname: nickname) { [weak self] stats in guard let weakSelf = self else { return } weakSelf.stats = stats weakSelf.statsViewController.reloadTableView() weakSelf.statsViewController.showProfile(profile) } } }
  30. 30. 
 final class StatsViewControllerImpl: UIViewController { var statsPresenter: StatsPresenter! @IBOutlet weak var nicknameLabel: UILabel! @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() statsPresenter.readyForDisplay(byMatch: .solo, region: .asia) } } extension StatsViewControllerImpl: StatsViewController { func showProfile(_ profile: Profile) { DispatchQueue.main.async { [weak self] in guard let weakSelf = self else { return } weakSelf.nicknameLabel.text = profile.playerName } } func reloadTableView() { tableView.reloadData() } } 

  31. 31. 
 
 
 

  32. 32. 
 
 

  33. 33.
  34. 34. 
 
 
 
 
 
 

  35. 35. 
 


×