Skip to content

Commit 90eed82

Browse files
Merge pull request #3 from swiftcomponentsio/app
Add an alert to open the website
2 parents c04cfa7 + 8f8cefb commit 90eed82

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

App/SwiftComponentsApp/SwiftComponentsApp.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@
267267
"INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES;
268268
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault;
269269
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
270-
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
271-
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
270+
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
271+
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
272272
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
273273
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
274274
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
@@ -304,8 +304,8 @@
304304
"INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES;
305305
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault;
306306
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
307-
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
308-
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
307+
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
308+
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
309309
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
310310
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
311311
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";

App/SwiftComponentsApp/SwiftComponentsApp/Core/App.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
import SwiftUI
2+
import SwiftComponents
23

34
struct App: View {
45
var body: some View {
56
NavigationStack {
67
List {
8+
Section {
9+
Text("Discover more information about **SwiftComponents** on the website.")
10+
SUButton(
11+
model: .init {
12+
$0.title = "Open Website"
13+
$0.isFullWidth = true
14+
},
15+
action: {
16+
guard let url = URL(string: "https://swiftcomponents.io") else { return }
17+
UIApplication.shared.open(url)
18+
}
19+
)
20+
}
21+
722
Section("Components") {
823
NavigationLinkWithTitle("Button") {
924
ButtonPreview()

Sources/SwiftComponents/Button/SUButton.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public struct SUButton: View {
3232
// MARK: Body
3333

3434
public var body: some View {
35-
Button("", action: {})
3635
Text(self.model.title)
3736
.font(self.model.preferredFont.font)
3837
.lineLimit(1)

0 commit comments

Comments
 (0)