13
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Swift】import文を省略する

Posted at

はじめに

何度も同じimport文を書かなければいけない時に省略できる機能を知ったので記録しておきます。

実装

@_exported import SwiftUI

使い方

1ファイルに@_exportedでインポートすると同列以下でのファイルでは書かなくてよくなります
スクリーンショット 2023-08-18 19.52.37.png

ここではimport SwiftUIを書かなくても使用できる
スクリーンショット 2023-08-18 19.53.46.png

ここでも書かなくて良い
スクリーンショット 2023-08-18 19.54.58.png

おわり

これは便利ですね

13
12
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
13
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?