LoginSignup
3
6

More than 5 years have passed since last update.

プロジェクト内で利用しているuserDefinedRuntimeAttributeの一覧を出力するコマンド

Last updated at Posted at 2017-05-11

概要

Xcodeプロジェクト内で利用しているuserDefinedRuntimeAttributeの一覧を取得する方法です。

スクリーンショット 2017-05-11 23.04.31.png

コマンド

以下のコマンドをコピペしてターミナルで実行することで取得できます。

プロジェクトのディレクトリで実行
$ find . -name "*.xib" -o -name "*.storyboard" \
| xargs grep "<userDefinedRuntimeAttribute type" \
| grep "keyPath"  \
| sed -e "s/.*keyPath=\"//g" \
| sed -e "s/\".*>//g" \
| sort \
| uniq

実行結果(例)

userDefinedRuntimeAttributeの一覧がソートされ、出力されます。

borderColor
borderWidth
bottomBorderWidth
clipsToBounds
cornerRadius
〜略〜

コマンド解説

実行フォルダ配下の拡張子がxibもしくはstoryboardのファイルを検索
$ find . -name "*.xib" -o -name "*.storyboard" \
userDefinedRuntimeAttributeタグを含む行を抽出
| xargs grep "<userDefinedRuntimeAttribute type" \
keyPath属性を含む行を抽出
| grep "keyPath"  \
keyPath属性の値のみを置換で抽出
| sed -e "s/.*keyPath=\"//g" \
| sed -e "s/\".*>//g" \
属性値をソート
| sort \
重複した行を削除
| uniq
3
6
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
3
6