From the course: Blockchain Programming in iOS Using Swift

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Returning the blockchain

Returning the blockchain

- [Instructor] Okay, so in the last lecture we set up our blockchain controller as well as a blockchain service, and now we need to use our blockchain controller to return us the blockchain. But the first question is: How do we even get access to the blockchain? Remember, we were typing a lot of code in Xcode playgrounds. So I have added all of that code, which basically presents a transaction, the block, as well as a blockchain, into Models.swift file. So this is all the code that we have already been done. I just literally copy/pasted it over here. All right, so now we can go ahead and work on how will we return the blockchain. And returning the blockchain is a duty for BlockchainService, so let's go ahead and first of all, create a property for the blockchain. Private (set) var blockchain, which will be off-pipe blockchain. All right, now what we're gonna do is inside the initialization matter, and so inside the init matter, we are going to assign or, basically create a blockchain,…

Contents