Completed

Convert Swift to Objective C. 1hr work

Code:

class MyAssetResourceLoaderDelegate: NSObject, AVAssetResourceLoaderDelegate {

let certificateURL: URL

let licenseAcquisitionURL: URL

let contentId: String

init(certificateURL: URL, licenseAcquisitionURL: URL, contentId: String) {

[login to view URL] = certificateURL

[login to view URL] = licenseAcquisitionURL

[login to view URL] = contentId

}

public func resourceLoader(

_ resourceLoader: AVAssetResourceLoader,

shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest

) -> Bool {

print([login to view URL] ?? "no url")

// asdf

// We first check if a url is set in the manifest.

guard let url = [login to view URL] else {

print("?", #function, "Unable to read the url/host data.")

[login to view URL](with: NSError(domain: "[login to view URL]", code: -1, userInfo: nil))

return false

}

print("?", #function, url)

// When the url is correctly found we try to load the certificate date. Watch out! For this

// example the certificate resides inside the bundle. But it should be preferably fetched from

// the server.

guard let certificateData = try? Data(contentsOf: certificateURL) else {

[login to view URL](with: NSError(domain: "[login to view URL]", code: -2, userInfo: nil))

return false

}

// Request the Server Playback Context.

let usedContentId = [login to view URL] ?? "irdeto"

guard

let contentIdData = [login to view URL](using: [login to view URL]),

let spcData = try? [login to view URL](forApp: certificateData, contentIdentifier: contentIdData, options: nil),

let dataRequest = [login to view URL] else {

[login to view URL](with: NSError(domain: "[login to view URL]", code: -3, userInfo: nil))

print("?", #function, "Unable to read the SPC data.")

return false

}

// Request the Content Key Context from the Key Server Module.

let ckcURL = licenseAcquisitionURL

var request = URLRequest(url: ckcURL)

[login to view URL] = "POST"

[login to view URL] = spcData

let session = URLSession(configuration: [login to view URL])

let task = [login to view URL](with: request) { data, response, error in

if let data = data {

// The CKC is correctly returned and is now send to the `AVPlayer` instance so we

// can continue to play the stream.

[login to view URL](with: data)

[login to view URL]()

} else {

print("?", #function, "Unable to fetch the CKC.")

[login to view URL](with: NSError(domain: "[login to view URL]", code: -4, userInfo: nil))

}

}

[login to view URL]()

// asdf

return true

}

}

Skills: Objective C, Swift

See more: swift, objective c, ios, swift, Objective c, android, iOS , iPhone , swift, objective c, mobile phone, android, iphone, swift, objective-c, ios swift objective c, swift objective c, swift , objective c, convert objective c project to swift 3, convert objective c project to swift online, swift to objective c code converter online, convert objective c to swift 4, convert objective c to swift in xcode, swift objective c interoperability, socket.io-client-swift objective c, swift vs objective c code example, swift objective-c interoperability, convert objective c code to swift 5, convert swift code to objective-c, convert swift code to objective-c code online, is swift objective-c

About the Employer:
( 0 reviews ) Delft, Netherlands

Project ID: #29018816

Awarded to:

GuangJie

Hello I am good at both swift and objective c and I am sure I can finish this conversion in one hour Hope to work for you Thanks

€20 EUR in 1 day
(40 Reviews)
6.5

2 freelancers are bidding on average €20 for this job

maulikvora16694

Hello, I have 5+years of experience in iPhone Application Development. I want always clients satisfied with my work. I am working as a full-time freelancer. Thanks

€19 EUR in 7 days
(1 Review)
0.3