Skip to content

Commit 16a4024

Browse files
authored
Fix package name in Java and Swift examples
Updated package name in Java example and Swift implementation references from 'org.swift.javakit' to 'org.swift.swiftjava'.
1 parent 7150c5c commit 16a4024

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SwiftJava/Documentation.docc/SwiftJava.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ if let url = myObject.as(URL.self) {
240240
SwiftJava supports implementing Java `native` methods in Swift using JNI with the `@JavaImplementation` macro. In Java, the method must be declared as `native`, e.g.,
241241

242242
```java
243-
package org.swift.javakit.example;
243+
package org.swift.swiftjava.example;
244244

245245
public class HelloSwift {
246246
static {
@@ -256,15 +256,15 @@ On the Swift side, the Java class needs to be exposed to Swift through `swift-ja
256256
```swift
257257
{
258258
"classes" : {
259-
"org.swift.javakit.example.HelloSwift" : "Hello",
259+
"org.swift.swiftjava.example.HelloSwift" : "Hello",
260260
}
261261
}
262262
```
263263

264264
Implementations of `native` methods are written in an extension of the Swift type that has been marked with `@JavaImplementation`. The methods themselves must be marked with `@JavaMethod`, indicating that they are available to Java as well. To help ensure that the Swift code implements all of the `native` methods with the right signatures, SwiftJava produces a protocol with the Swift type name suffixed by `NativeMethods`. Declare conformance to that protocol and implement its requirements, for example:
265265

266266
```swift
267-
@JavaImplementation("org.swift.javakit.HelloSwift")
267+
@JavaImplementation("org.swift.swiftjava.HelloSwift")
268268
extension Hello: HelloNativeMethods {
269269
@JavaMethod
270270
func reportStatistics(_ meaning: String, _ numbers: [Double]) -> String {

0 commit comments

Comments
 (0)