SwiftUI 2.0: Use navigationBarItems() instead of toolbar() with ToolbarItem?

# SwiftUI 2.0：toolbar()とToolbarItemよりnavigationBarItems()のほうがセーフ？（[日本語](https://qiita.com/loic-meister-guild/items/739d8f3cd65fa6de900b)）

## My problem
Unfortunately SwiftUI does not expose navigation styling directly.

To customize my SwiftUI application navigation bar appearance, I used the trick of setting the navigation bar colors in the `init()` method using the [`UINavigationBar.appearance()`]() method ... 

Which is not the best way of [Customizing Your App’s Navigation Bar](https://developer.apple.com/documentation/uikit/uinavigationcontroller/customizing_your_app_s_navigation_bar) but what was the best way I found on the internet when I was looking for info. This also caused me some trouble when I tried to [style the `fileImporter`](https://qiita.com/loic-meister-guild/items/4d592e9a9fb304344950#styling) earlier!

```Swift:SwiftUI
structMyAppView: View {
    init() { // Color Settings
        UINavigationBar.appearance().tintColor = UIColor(named: "MyNavBarColor")
        // ...
    }
    //...
}
```
The trouble started when I used [`toolbar(content:)`](https://developer.apple.com/documentation/swiftui/view/toolbar(content:)-5w0tj) to customize my navigation bar:

```Swift:SwiftUI
    // ...
    .toolbar(content: {
        ToolbarItem(placement: .navigationBarLeading) {
            /// The screen title
            Text("My Title")
                .foregroundColor(Color("MyForegroundColor"))
                .font(.system(size: 30))
        }
        ToolbarItem(placement: .navigationBarTrailing) {
            Button(action: {
                showNewAchievementForm.toggle()
            }) {
                Image(systemName: showNewAchievementForm ? "multiply.circle.fill" : "plus.circle.fill")
                    .font(.system(size: 30, weight: .light))
                    .foregroundColor(Color("MyForegroundColor"))
            }
            .disabled(!canAddNewAchievement())
        }
    })
```
The `ToolbarItem` foreground color was ignored when `UINavigationBar.appearance().tintColor` was set in `init()`.
## My solution
One of the application screen used [`navigationBarItems(leading:trailing:)`](https://developer.apple.com/documentation/swiftui/view/navigationbaritems(leading:trailing:)) instead:

```Swift:SwiftUI
    // ...
    .navigationBarItems(
        leading:
            /// The screen title
            Text("My Title")
                .foregroundColor(Color("MyForegroundColor"))
                .font(.system(size: 30)),
        trailing:
            Button(action: {
                showNewAchievementForm.toggle()
            }) {
               Image(systemName: showNewAchievementForm ? "multiply.circle.fill" : "plus.circle.fill")
                   .font(.system(size: 30))
                   .foregroundColor(Color("MyForegroundColor"))
            }
            .disabled(!canAddNewAchievement())
    )
```
__But__ it is now deprecated in favor of [`toolbar(content:)`](https://developer.apple.com/documentation/swiftui/view/toolbar(content:)-5w0tj) with [`navigationBarLeading`](https://developer.apple.com/documentation/swiftui/toolbaritemplacement/navigationbarleading) or [`navigationBarTrailing`](https://developer.apple.com/documentation/swiftui/toolbaritemplacement/navigationbartrailing) placement!
## The Future
SwiftUI3.0 is just around the corner and customization will certainly improve.

Let's wait and see