Skip to content

Commit

Permalink
Create a SwiftUI demo app, and consume Fluent via Swift Package (#2075)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischreiber authored Jul 25, 2024
1 parent 584aeed commit 1d6be3a
Show file tree
Hide file tree
Showing 28 changed files with 566 additions and 552 deletions.
395 changes: 395 additions & 0 deletions Demo/FluentUIDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions Demo/FluentUIDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"images" : [
{
"filename" : "FluentUIDemo_iOS.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"filename" : " Icon-16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : " Icon-16_2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : " Icon-32.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : " Icon-32_2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : " Icon-128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : " Icon-128_2x-1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : " Icon-128_2x.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : " Icon-256_2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : " Icon-512.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : " Icon-512_2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Demo/FluentUIDemo/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
42 changes: 42 additions & 0 deletions Demo/FluentUIDemo/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//

import SwiftUI
import FluentUI

struct ContentView: View {
#if os(macOS)
// Until we have a SwiftUI button on macOS, this will have to do.
private struct ButtonRepresentable: NSViewRepresentable {
func makeNSView(context: Context) -> some NSView {
return FluentUI.Button(title: "Hello, world!",
image: .init(systemSymbolName: "globe", accessibilityDescription: nil))
}

func updateNSView(_ nsView: NSViewType, context: Context) {
}
}
#endif

var body: some View {
VStack {
#if os(macOS)
ButtonRepresentable()
.fixedSize()
#else
Button(action: {}, label: {
HStack {
Image(systemName: "globe")
.imageScale(.large)
Text("Hello, world!")
}
})
.buttonStyle(FluentButtonStyle(style: .accent))
.controlSize(.extraLarge)
#endif
}
.padding()
}
}
10 changes: 10 additions & 0 deletions Demo/FluentUIDemo/FluentUIDemo.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>
15 changes: 15 additions & 0 deletions Demo/FluentUIDemo/FluentUIDemoApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//

import SwiftUI

@main
struct FluentUIDemoApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
10 changes: 0 additions & 10 deletions apple/FluentUI-All.xcworkspace/contents.xcworkspacedata

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1d6be3a

Please sign in to comment.