NoBuildableEntriesError: active scheme ~というエラーが出る場合
この記事の目次
NoBuildableEntriesError: active scheme ~というエラーが出る場合の対処法
NoBuildableEntriesError: active scheme does not build this file
Select a scheme that builds a target which contains the current file, or add this file to a target that is built by the current scheme.
というエラーが出る場合、Target Membershipにチェックが入っていない可能性があります。
確認方法は、まずプレビューを表示させたいファイルを選択してください。

次に右上のボタンを押してください。

すると、色々と出てくるので一番左のタブを選択してください。

一番左のタブを選択すると、Target Membershipという項目があります。

ここでチェックが入っているか確認することができます。
チェックが入っていない場合は、チェックを入れてみてください。

すると、エラーが消え、プレビューが表示されるようになるかと思います。