Swiftで開始時とHome選択時にWeb表示

HomeView.swift
HomeViewのonAppearでhttps://www.apple.com/jp/をセットしたstartActivityを追加
struct HomeView: View {
    var body: some View {
        Text("Hello, World!")
    }
}

struct HomeView_Previews: PreviewProvider {
    static var previews: some View {
        HomeView()
    }
}
struct HomeView: View {
    var body: some View {
        Text("Home")
        .onAppear(){
            if let url = URL(string: "https://www.apple.com/jp/") {
                UIApplication.shared.open(url)
            }
        }
    }
}

struct HomeView_Previews: PreviewProvider {
    static var previews: some View {
        HomeView()
    }
}
[Product]-[Run]実行
開始時にWebを表示。
左上のTabApplicationで戻って、Notificationsを選択して、Homeを選択時にWebを表示。