LoginSignup
12
9

More than 5 years have passed since last update.

Swiftのコードから特定のUIViewを識別する

Last updated at Posted at 2016-06-24

Swiftのコード上から、特定のUIViewの識別子を取得する方法がすぐに見つからなかったので、まとめておきます。

Storyboard上のUIViewのIdentityのRestration IDを設定

スクリーンショット 2016-06-24 10.10.26.png

Swiftのコード上からUIView.restorationIdentifierで上記で設定した文字列を取得

ViewController.swift
view.restorationIdentifier() // Test

こんな感じです。

12
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
9