mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-02-06 20:28:39 +01:00
39 lines
899 B
Swift
39 lines
899 B
Swift
//
|
|
// ReleaseNotesView.swift
|
|
// Xcodes
|
|
//
|
|
// Created by Duong Thai on 13/10/2023.
|
|
// Copyright © 2023 Robots and Pencils. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ReleaseNotesView: View {
|
|
let url: URL?
|
|
|
|
@SwiftUI.Environment(\.openURL) var openURL: OpenURLAction
|
|
|
|
var body: some View {
|
|
if let url = url {
|
|
Button(action: { openURL(url) }) {
|
|
Image(systemName: "link.circle.fill")
|
|
.font(.title)
|
|
}
|
|
.buttonStyle(.plain)
|
|
.contextMenu(menuItems: {
|
|
CopyReleaseNoteButton(url: url)
|
|
})
|
|
.help("ReleaseNotes.help")
|
|
} else {
|
|
EmptyView()
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
let url = URL(string: "https://developer.apple.com/documentation/xcode-release-notes/xcode-12_3-release-notes/")!
|
|
|
|
return ReleaseNotesView(url: url)
|
|
.padding()
|
|
}
|