Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better look of app on macOS #99

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Examples/BlocksApp/BlocksApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = net.mickf.BlocksAppTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -586,7 +586,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = net.mickf.BlocksAppTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
4 changes: 2 additions & 2 deletions Examples/BlocksApp/BlocksApp/BlocksApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ struct BlocksApp: App {
var body: some Scene {
WindowGroup {
ContentView(model: WatchState())
}.onChange(of: scenePhase) { newPhase in
switch newPhase {
}.onChange(of: scenePhase) {
switch scenePhase {
case .active:
logger.info("Active")
case .background:
Expand Down
35 changes: 22 additions & 13 deletions Examples/BlocksApp/BlocksApp/Features/SlugifyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@ import OSLog
import SwiftUI

struct SlugifyView: View {
private let logger = Logger(subsystem: "net.mickf.BlocksDemoApp", category: "Slugify")

@State private var input: String = ""
@State private var slug: String = "".slugify()

private let pasteboard = Pasteboard()

var body: some View {
Form {
TextField(text: $input, prompt: Text("Input to Slugify")) {
Text("Input")
}.disableAutocorrection(true)
#if os(macOS)
LabeledContent {
Section(header: Text("Creating a slug")) {
TextField(text: $input, prompt: Text("Input to Slugify")) {
Text("Input")
}.disableAutocorrection(true)
#if os(macOS)
LabeledContent {
if slug.isEmpty {
Text("empty")
.foregroundColor(Color.gray)
} else {
Text(slug)
}
} label: {
Text("Slug")
}
#else
Text(slug)
} label: {
Text("Slug")
}
#else
Text(slug)
#endif
Button("Copy") {
pasteboard.copy(text: slug)
#endif
Button("Copy") {
pasteboard.copy(text: slug)
}
}
}
.onChange(of: input) { _, newValue in
Expand Down
Loading