Various tweaks

This commit is contained in:
Neil Alexander 2023-02-08 22:56:37 +00:00
parent 0245b6db5e
commit 9ce78d5007
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
9 changed files with 471 additions and 18 deletions

View file

@ -15,5 +15,5 @@ extension Notification.Name {
static let YggdrasilSelfUpdated = Notification.Name("YggdrasilSelfUpdated")
static let YggdrasilPeersUpdated = Notification.Name("YggdrasilPeersUpdated")
static let YggdrasilSettingsUpdated = Notification.Name("YggdrasilSettingsUpdated")
static let YggdrasilDHTUpdated = Notification.Name("YggdrasilPeersUpdated")
static let YggdrasilDHTUpdated = Notification.Name("YggdrasilDHTUpdated")
}

View file

@ -0,0 +1,20 @@
//
// Data.swift
// YggdrasilNetworkExtension
//
// Created by Neil on 15/11/2022.
//
import Foundation
extension Data {
/// This computed value is only needed because of [this](https://github.com/golang/go/issues/33745) issue in the
/// golang/go repository. It is a workaround until the problem is solved upstream.
///
/// The data object is converted into an array of bytes and than returned wrapped in an `NSMutableData` object. In
/// thas way Gomobile takes it as it is without copying. The Swift side remains responsible for garbage collection.
var mutable: Data {
var array = [UInt8](self)
return NSMutableData(bytes: &array, length: self.count) as Data
}
}

View file

@ -38,17 +38,16 @@
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UTExportedTypeDeclarations</key>
<array>