From dd516ee1142fe047f23338833fb5ff1300527c8e Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 28 Nov 2023 03:06:36 +0800 Subject: [PATCH] Add Link implementation --- .../OpenSwiftUI.docc/Views/Controls.md | 15 ++++ .../UIElements/Button/TODO/Button.swift | 8 +- .../Views/Controls/Link/Link.swift | 83 +++++++++++++++++++ .../Link/internal/LinkDestination.swift | 54 ++++++++++++ 4 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 Sources/OpenSwiftUI/OpenSwiftUI.docc/Views/Controls.md create mode 100644 Sources/OpenSwiftUI/Views/Controls/Link/Link.swift create mode 100644 Sources/OpenSwiftUI/Views/Controls/Link/internal/LinkDestination.swift diff --git a/Sources/OpenSwiftUI/OpenSwiftUI.docc/Views/Controls.md b/Sources/OpenSwiftUI/OpenSwiftUI.docc/Views/Controls.md new file mode 100644 index 0000000..4722752 --- /dev/null +++ b/Sources/OpenSwiftUI/OpenSwiftUI.docc/Views/Controls.md @@ -0,0 +1,15 @@ +# Controls and indicators + +Display values and get user selections. + +## Overview + +OpenSwiftUI provides controls that enable user interaction specific to each platform and context. For example, people can initiate events with buttons and links, or choose among a set of discrete values with different kinds of pickers. You can also display information to the user with indicators like progress views and gauges. + +Use these built-in controls and indicators when composing custom views, and style them to match the needs of your app’s user interface. For design guidance, see [All components](https://developer.apple.com/design/human-interface-guidelines/components) in the Human Interface Guidelines. + +## Topics + +### Linking to other content + +- ``Link`` diff --git a/Sources/OpenSwiftUI/UIElements/Button/TODO/Button.swift b/Sources/OpenSwiftUI/UIElements/Button/TODO/Button.swift index 4c1d476..b9b2d0f 100644 --- a/Sources/OpenSwiftUI/UIElements/Button/TODO/Button.swift +++ b/Sources/OpenSwiftUI/UIElements/Button/TODO/Button.swift @@ -6,4 +6,10 @@ // Lastest Version: iOS 15.5 // Status: Empty -public struct Button {} +public struct Button