|
@@ -6,19 +6,19 @@ AltKit allows apps to communicate with AltServers on the same WiFi network and e
|
|
|
|
|
|
To use AltKit in your app, add the following to your `Package.swift` file's dependencies:
|
|
|
|
|
|
-```
|
|
|
+```swift
|
|
|
.package(url: "https://github.com/rileytestut/AltKit.git", .upToNextMajor(from: "0.0.1")),
|
|
|
```
|
|
|
|
|
|
Next, add the AltKit package as a dependency for your target:
|
|
|
|
|
|
-```
|
|
|
+```swift
|
|
|
.product(name: "AltKit", package: "AltKit"),
|
|
|
```
|
|
|
|
|
|
Finally, right-click on your app's `Info.plist`, select "Open As > Source Code", then add the following entries:
|
|
|
|
|
|
-```
|
|
|
+```xml
|
|
|
<key>NSBonjourServices</key>
|
|
|
<array>
|
|
|
<string>_altserver._tcp</string>
|
|
@@ -49,7 +49,7 @@ add_compile_options($<$<NOT:$<COMPILE_LANGUAGE:Swift>>:-fPIC>)
|
|
|
## Usage
|
|
|
|
|
|
### Swift
|
|
|
-```
|
|
|
+```swift
|
|
|
import AltKit
|
|
|
|
|
|
ServerManager.shared.startDiscovering()
|
|
@@ -75,7 +75,7 @@ ServerManager.shared.autoconnect { result in
|
|
|
```
|
|
|
|
|
|
### Objective-C
|
|
|
-```
|
|
|
+```objc
|
|
|
@import AltKit;
|
|
|
|
|
|
[[ALTServerManager sharedManager] startDiscovering];
|