Skip to content

Conversation

@pepone
Copy link
Member

@pepone pepone commented Jun 11, 2025

A SwiftUI greeter client application

This comment was marked as outdated.

@@ -0,0 +1,17 @@
# SwiftUI Greeter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the name SwiftUI-greeter inconsistent with the other names. What about a simpler GreeterUI?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about GreeterApp?

import Ice
import SwiftUI

class GreeterClient: ObservableObject {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to add some comments.

import Ice
import SwiftUI

@main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comments.

/// @return The greeting.
string greet(string name);
}
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing newline


import SwiftUI

struct ContentView: View {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comment

@@ -0,0 +1,2 @@
# Exclude per-user settings
project.xcworkspace/xcuserdata/ No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File should end in newline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we exclude this file so that it always picks up the latest nightly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to try if Xcode complains when it is missing.

}
}
#if os(macOS)
.formStyle(.grouped) // or .columns (macOS 14+)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only support macOS 15+, might as well use the new features.

Comment on lines 17 to 18
Text("Host:")
TextField("e.g. localhost", text: $host)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that we need the extra Text field. Maybe just TextField("Host:", ... and TextField("Name:",...

Suggested change
Text("Host:")
TextField("e.g. localhost", text: $host)
Text("Host:")
TextField("e.g. localhost", text: $host)

Copy link
Member Author

@pepone pepone Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that common on iOS, the TextField first argument only shows up when empty doesn't it? I added the label to make clear what the input is about, I'm fine dropping it...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to be honest.

@pepone pepone requested review from bernardnormier and Copilot June 12, 2025 15:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a SwiftUI-based greeter application that uses Ice to send greeting requests. The updates include new documentation in the README, implementation of core functionality in GreeterView, GreeterClient, and GreeterApp, along with necessary project configuration and asset updates.

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
swift/Ice/GreeterApp/README.md Added introductory documentation
swift/Ice/GreeterApp/GreeterView.swift Implemented the main UI view for user input and greeting display
swift/Ice/GreeterApp/GreeterClient.swift Added client functionalities to handle greeting requests via Ice
swift/Ice/GreeterApp/GreeterApp.swift Configured the main application entry point using environment injection
swift/Ice/GreeterApp/GreeterApp.entitlements Defined App Sandbox and network permissions
swift/Ice/GreeterApp/Greeter.ice Added Slice definition for the Greeter interface
swift/Ice/GreeterApp/Assets.xcassets/* Configured asset catalogs and app icon assets
swift/Ice/GreeterApp/.gitignore Added ignore configuration for personal settings
swift/Ice/GreeterApp/GreeterApp.xcodeproj/project.pbxproj Updated project configuration and build phases
Files not reviewed (1)
  • swift/Ice/GreeterApp/GreeterApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported
Comments suppressed due to low confidence (1)

swift/Ice/GreeterApp/GreeterClient.swift:16

  • Consider handling initialization failures more gracefully instead of using fatalError. A user-friendly error handling approach may improve application resiliency in production.
fatalError("Failed to initialize communicator: \(error)")

import Ice
import SwiftUI

/// Manages the Ice communicator and provides a method to send a greeting request to the Greeter service.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greet request

@pepone pepone merged commit f416caa into zeroc-ice:main Jun 14, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants