wantedly / ios_night

Let's talk about iOS development -- iOS Night 📱🌙 You might apply to this meetup from
https://www.wantedly.com/companies/wantedly/projects
18 stars 0 forks source link

2019/06/27 19:30~20:30 #64

Closed ngtk closed 4 years ago

ngtk commented 4 years ago

Why

Where

Pearl Jam (Subject to change)

5F, MG Shirokanedai Building (Wantedly, Inc. Tokyo HQ)

Who

You are working for Wantedly? Sure, you can join anytime. If not, you need to contact us first. Or, you can "want to visit" the meetup, which you can find in www.wantedly.com/companies/wantedly/projects.

What

You write topics like below contents and we talk about these on the meetup. Every participant needs to write one topic at least.

Also, you can find new topics from the newsletters:

How

         ・・・

参加者は開催までに話したいことを少なくとも1トピックをコメントしましょう。 ネタ被りを避けるために、まずはタイトルだけでコメントすることを推奨します。 より多くの学びを得るためにどんな内容でもアウトプットを歓迎します!😊

cc/ @wantedly/ios

Edit this template

Previous issue

hiranodept commented 4 years ago

iOS 13では ModalView を閉じたときに ViewWillAppear が呼ばれなくなっている

らしいので、要注意。(自分ではまだ動作確認できていない汗) モーダルを開く際、.fullScreen で完全に画面を覆わない限りは呼ばれないっぽいですね https://twitter.com/koogawa/status/1164892755417415680?s=21

View Controller Presentation Changes in iOS 13

ref: https://medium.com/@hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e

ShotaKashihara commented 4 years ago

UITestでRxSwift のメモリリークを確認する手法

Guarantee Rx memory leaks absence https://medium.com/flawless-app-stories/guarantee-rx-memory-leaks-absence-3a90636ec49e

概要

以下のRxSwift を使ったコードでメモリリークしないことをUITest で保証したい

private let disposeBag = DisposeBag()
@IBOutlet private var button: UIButton!
@IBOutlet private var label: UILabel!

func viewDidLoad() {
    super.viewDidLoad*(
    button.rx.tap.subscribe(onNext: {
        self.label.text = "Hello world" // self がキャプチャされる
    })
    .disposed(by: disposeBag)
}
  1. RxSwift で RxSwift.Resources を使用可能にする https://github.com/ReactiveX/RxSwift/blob/master/Documentation/GettingStarted.md#enabling-debug-mode

  2. RxSwift.Resources.total を 上記コードの前後で比較して、キャプチャされている数を比較

    func testRxDoNotLeak() {
    // snapshot before
    let expectedTotal = Resources.total
    autoreleasepool {
        let viewController = ViewController()
        // trigger subscriptions placed in viewDidLoad
        _ = viewController.view
    }
    // snapshot after
    let actualTotal = Resources.total
    XCTAssertEqual(expectedTotal, actualTotal)
    }

Peopleやってみた

https://github.com/wantedly/yashima-ios/pull/6281