In my case on Xcode 13.1, this issue get fixed after applying File -> Packages -> Reset Package Caches enjoy!
Post
Replies
Boosts
Views
Activity
I made some changes to @OOPer class and it worked for me.
public class MyTag {
public let tag: UInt8
public let value: String
public init(tag: UInt8, value: String) {
self.tag = tag
assert(value.utf8.count < 256, "The length of `value` needs to be less than 256.")
self.value = value
}
public var length: UInt8 { UInt8(value.utf8.count) }
public var tlv: [UInt8] { return ([tag, length] + [UInt8](value.utf8)) }
}
Thank you @OOPer for your help!
I found an accepted answer here for the same issue in Objective-C but I only need to convert the returned data type NSData to a binary string in Swift.
Can you check this accepted answer?
[(https://stackoverflow.com/a/8950667/7262400)]
Thank you @Claude31 for your reply
The point is I am looking to implement a feature in Swift to simulate the same feature in a PHP library
and to do the job, I need an alternative Swift method to PHP pack() method