Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOSエンジニアが悩んだUpボタンについて / 2017 potatotips 45 Up Button

M"e
November 28, 2017

iOSエンジニアが悩んだUpボタンについて / 2017 potatotips 45 Up Button

M"e

November 28, 2017
Tweet

More Decks by M"e

Other Decks in Programming

Transcript

  1. © 2017 VASILY,Inc.
    J04ΞϓϦΤϯδχΞ͕೰Μͩ
    "OESPJEͷ6QϘλϯ
    QPUBUPUJQT
    ͑ΜͲ͏

    View full-size slide

  2. © 2017 VASILY,Inc.
    ࣗݾ঺հ
    ⾣͑ΜͲ͏
    ⾣7"4*-: *OD
    ⾣J04ΞϓϦΤϯδχΞ
    ⾣"OESPJEΞϓϦΤϯδχΞݟश͍
    ⾣ؒҧͬͯͨΒڭ͍͑ͯͩ͘͞

    View full-size slide

  3. © 2017 VASILY,Inc.
    Ҏ্ͷϑΝογϣϯ&$αΠτ͔Βͷ΂ສ఺Λ௒͑Δ঎඼Λܝࡌ
    ݄ؒສਓҎ্͕ར༻͢Δ೔ຊ࠷େڃͷϑΝογϣϯαΠτ

    View full-size slide

  4. © 2017 VASILY,Inc.
    ೥݄;0;0508/΍8&"3ΛӡӦ͢Δ
    ελʔττΡσΠάϧʔϓʹࢀը ࢠձࣾԽ

    View full-size slide

  5. © 2017 VASILY,Inc.
    "OESPJEͷ6QϘλϯʹ͍ͭͯ

    View full-size slide

  6. © 2017 VASILY,Inc.
    J04
    ⾣/BWJHBUJPO#BSͷ#BDLϘλϯ
    ⾣ΤοδεϫΠϓ

    View full-size slide

  7. © 2017 VASILY,Inc.
    J04
    ⾣/BWJHBUJPO#BSͷ#BDLϘλϯ
    ⾣ΤοδεϫΠϓ
    ⾣ͲͪΒ΋લͷը໘ʹ໭Δ

    View full-size slide

  8. © 2017 VASILY,Inc.
    "OESPJE
    ⾣#BDLϘλϯ
    ⾣6QϘλϯ

    View full-size slide

  9. © 2017 VASILY,Inc.
    "OESPJE
    ⾣#BDLϘλϯ
    ⾣6QϘλϯ
    #BDLϘλϯ
    6QϘλϯ

    View full-size slide

  10. © 2017 VASILY,Inc.
    "OESPJE
    ⾣#BDLϘλϯ
    ⾣લͷը໘ʹ໭Δ
    ⾣6QϘλϯ
    ⾣֊૚తͳը໘ભҠ
    #BDLϘλϯ
    6QϘλϯ

    View full-size slide

  11. © 2017 VASILY,Inc.
    6QϘλϯͷ֊૚తͳը໘ભҠͱ͸ʁ

    View full-size slide

  12. © 2017 VASILY,Inc.
    6QϘλϯͷ֊૚తͳը໘ભҠͱ͸ʁ
    ⾣ྫ
    1MBZ4UPSF

    ϗʔϜ ΞϓϦৄࡉ ΞϓϦৄࡉ

    View full-size slide

  13. © 2017 VASILY,Inc.
    6QϘλϯͷ֊૚తͳը໘ભҠͱ͸ʁ
    ⾣ྫ
    1MBZ4UPSF

    ϗʔϜ ΞϓϦৄࡉ ΞϓϦৄࡉ

    View full-size slide

  14. © 2017 VASILY,Inc.
    6QϘλϯͷ֊૚తͳը໘ભҠͱ͸ʁ
    ⾣ྫ
    1MBZ4UPSF

    ϗʔϜ ΞϓϦৄࡉ ΞϓϦৄࡉ
    Ϧετ

    View full-size slide

  15. © 2017 VASILY,Inc.
    6QϘλϯͷ֊૚తͳը໘ભҠͱ͸ʁ
    ⾣ྫ
    1MBZ4UPSF

    ϗʔϜ ΞϓϦৄࡉ ΞϓϦৄࡉ
    Ϧετ

    View full-size slide

  16. © 2017 VASILY,Inc.
    6QϘλϯͷ࣮૷ʹ͍ͭͯ

    View full-size slide

  17. © 2017 VASILY,Inc.
    6QϘλϯͷ࣮૷ʹ͍ͭͯ
    ⾣"OESPJE%FWFMPQFSʹ࣮૷ํ๏͕͋Δ
    ⾣IUUQTEFWFMPQFSBOESPJEDPNUSBJOJOHJNQMFNFOUJOHOBWJHBUJPO
    BODFTUSBMIUNM

    View full-size slide

  18. © 2017 VASILY,Inc.
    6QϘλϯͷ࣮૷ʹ͍ͭͯ
    ⾣ϚχϑΣετϑΝΠϧʹ1BSFOU"DUJWJUZΛࢦఆ
    ⾣HFU1BSFOU"DUJWJUZ*OUFOUͰ1BSFOU"DUJWJUZΛ
    औಘ

    View full-size slide

  19. © 2017 VASILY,Inc.
    6QϘλϯͷ࣮૷ʹ͍ͭͯ
    ⾣ϚχϑΣετϑΝΠϧʹ1BSFOU"DUJWJUZΛࢦఆ
    ⾣HFU1BSFOU"DUJWJUZ*OUFOUͰ1BSFOU"DUJWJUZΛ
    औಘ
    ໭Δը໘͕੩తɾɾɾʂ

    View full-size slide

  20. © 2017 VASILY,Inc.
    6QϘλϯͷ࣮૷ʹ͍ͭͯ
    ໭Δը໘Λಈతʹ͢Δʹ͸ʁ

    View full-size slide

  21. © 2017 VASILY,Inc.
    6QϘλϯͷ࣮૷ʹ͍ͭͯ
    ໭Δը໘Λಈతʹ͢Δʹ͸ʁ
    ⾣໭Γ͍ͨը໘ͷ*OUFOUΛੜ੒͢Δ
    ⾣OBWJHBUF6Q5PΛ࢖༻
    ⾣'-"(@"$5*7*5:@$-&"3@501Λઃఆ

    View full-size slide

  22. © 2017 VASILY,Inc.
    class ChildActivity : AppCompatActivity(), ItemDetailEventHandler {
    private lateinit var fromActivity: FromActivity
    private const val FROM_ACTIVITY = "from_activity"
    enum class FromActivity {
    HOME,
    SEARCH_RESULT,
    ɾɾɾ
    }
    override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    fromActivity = intent.getSerializableExtra(FROM_ACTIVITY) as FromActivity
    }
    override fun onOptionsItemSelected(item: MenuItem?): Boolean {
    when (item?.itemId) {
    android.R.id.home -> {
    val intent = createIntent(fromActivity)
    intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
    navigateUpTo(intent)
    return true
    }
    else -> return false
    }
    }
    private fun createIntent(fromActivity: FromActivity): Intent {
    return when (fromActivity) {
    FromActivity.HOME -> Intent(this, HomeActivity::class.java)
    FromActivity.SEARCH_RESULT -> Intent(this, SearchItemResultActivity::class.java)
    ɾɾɾ
    }
    }
    }

    View full-size slide

  23. © 2017 VASILY,Inc.
    ·ͱΊ

    View full-size slide

  24. © 2017 VASILY,Inc.
    ·ͱΊ
    ⾣6QϘλϯ͸"OESPJEͷφϏήʔγϣϯ
    ⾣6QϘλϯ͸֊૚తͳը໘ભҠΛ͢Δ
    ⾣ಈతͳը໘ભҠΛ͢Δ৔߹͸ࣗલͰ*OUFOUΛ࡞੒
    ͯ͠OBWJHBUF6Q5P
    ⾣'-"(@"$5*7*5:@$-&"3@501͸๨Εͣʹ

    View full-size slide