iOS User Profile Posts
Fullstack Social iOS NodeJS REST
With each user now searchable in our iOS application, its time to fetch and render their user profile with a list of their posts. Doing so will require a new ProfileController class that fetches this information in JSON from the server. We'll fix the header and ability to follow in the next lesson.

Comments (2)
Bobur Pakhriev
3 years ago
Hi Brian, i faces some issues while compiling on Xcode, Swift Compiler Error Group Use of undeclared type 'UserPostCell' Type 'ProfileController' does not conform to protocol 'UICollectionViewDelegate' Type 'ProfileController' does not conform to inherited protocol 'UICollectionViewDelegate' Generic parameter 'T' could not be inferred Generic parameter 'T' could not be inferred Type 'ProfileController' does not conform to protocol 'UICollectionViewDelegate' Ambiguous reference to member 'collectionView(_:layout:sizeForItemAt:)'
Udin Rajkarnikar
3 years ago
hello, Brian. I just encountered this problem "typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Dictionary<String, Any> but found an array instead.", underlyingError: nil))". Any insights on how to fix this ?
Brian Voong
3 years ago
Udin Rajkarnikar
3 years ago
yes, I declared it as you did " struct User: Decodable { //var because huna ni sakcha na huna ni sakcha let id : String let fullName: String let emailAddress: String var isFollowing: Bool? var followers: [User]? var following: [User]? var post: [Post]? } but JSONDecoder is not decoding an array. I downloaded your file too and it seems to work fine when you were doing it but shows error in my project. Been stuck in this for hours.
Brian Voong
3 years ago
Udin Rajkarnikar
3 years ago
I found the error. JSON data was invalid. Anyways, thank you for the help.
HELP & SUPPORT