This is a simple SwiftUI app that fetches and displays a user's GitHub profile information. It connects to the GitHub API to get data like the user's avatar, bio, follower count, and account creation date, presenting it in a clean and modern user interface.
- Dynamic Data Fetching: Fetches real-time user data from the GitHub API.
- Asynchronous Image Loading: Uses
AsyncImageto load the profile avatar efficiently. - Clean UI: Presents the profile information in a straightforward and easy-to-read layout using SwiftUI.
- Asynchronous Programming with
async/await: I usedasyncandawaitto handle network requests, making the code more readable and preventing UI freezes. - Error Handling: Implemented robust error handling with
try/catchand a customenumfor various network-related issues (invalid URL, invalid response, invalid data). - JSON Decoding: I learned how to decode JSON data from the API response into a custom Swift
structusingCodableand akeyDecodingStrategy. - SwiftUI Layouts: I used
VStackandHStackto arrange UI elements effectively and create a responsive design. - State Management: I managed the app's state with the
@Stateproperty wrapper to update the UI when new data is received.