Append String to NSData iOS swift

Solution:

If you want to append a string to already prepared NSData then follow the below steps to easily append.


    mutating func append(_ string: String) {
        if let data = string.data(using: .utf8) {
            append(data)
        }
    }

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift