Giter Site home page Giter Site logo

100-days-of-swiftui-by-nazar's Introduction

Solutions to Paul Hudson's "100 days of SwiftUI" projects and challenges by Nazar

This is a file that contains all of my 100 Days Of SwiftUI projects which include all challenges and extras

Project 10 Instafilter

An app that lets the user import photos from their library, then modify them using various image effects.

###Learn

  • How to respond to state changes using the onChange() modifier in SwiftUI, enabling dynamic updates and reactions to specific changes within your views.
  • How to present multiple options to users using confirmationDialog(), offering a user-friendly way to handle complex interactions and decision-making in SwiftUI.
  • How to integrate Core Image with SwiftUI to apply filters and manipulate images, combining the power of image processing with SwiftUI’s declarative syntax.
  • How to display empty states using ContentUnavailableView, providing a clear and visually appealing way to inform users when there is no content to display.
  • How to load photos from the user’s photo library in SwiftUI, utilizing PhotosPicker to allow users to import images into your app seamlessly.
  • How to let users share content from your app using ShareLink, simplifying the process of integrating sharing capabilities within your SwiftUI applications.
  • How to prompt users to leave an App Store review, enhancing your app’s visibility and reputation by integrating native review requests.
  • How to build a basic UI in SwiftUI, laying the foundation for more complex interfaces and user interactions.
  • How to import an image into SwiftUI using PhotosPicker, providing users with a simple and intuitive way to select images from their photo library.
  • How to perform basic image filtering using Core Image, applying visual effects to images within your SwiftUI app.
  • How to customize filters using confirmationDialog() in SwiftUI, allowing users to select and apply different image filters in a user-friendly way.
  • How to share an image using ShareLink, making it easy for users to distribute content from your app to other platforms or people.

Check out the Instafilter Repository here🚀!

Project 9 MyFriends

Image description

MyFriends is your all-in-one social networking app designed to keep you in touch with the people who matter most. Whether you’re sharing moments, chatting with friends, or discovering new connections, MyFriends offers a seamless and engaging experience.

###Learn

  • How to use the Codable protocol to easily encode and decode JSON data into Swift types, reducing boilerplate code and improving code clarity.
  • How to utilize keyDecodingStrategy in JSONDecoder to automatically convert JSON property names from snake_case to camelCase, allowing for seamless integration between JSON data and Swift code conventions.
  • How to implement custom CodingKeys enums for mapping JSON property names to Swift property names, providing flexibility when JSON structure differs from your Swift model.
  • How to write custom encoding and decoding methods to handle complex scenarios like type conversion and provide default values, allowing for precise control over the serialization process.
  • How to use URLSession to fetch JSON data from the internet, making network requests to retrieve and utilize external data sources in your app.
  • How to parse JSON data into Swift models using Codable, enabling structured and type-safe handling of data within your application.
  • How to build a dynamic UI using NavigationStack and List in SwiftUI to present data fetched from the internet, facilitating an interactive and user-friendly experience.
  • How to create a detail view for displaying more information about a selected user, utilizing SwiftUI’s navigation capabilities to drill down into specific data.
  • How to manage data downloads efficiently by checking and ensuring that the data is only fetched once, optimizing performance and resource usage.
  • How to use dateDecodingStrategy.iso8601 to automatically decode ISO-8601 formatted date strings into Date objects, simplifying date handling in JSON data.
  • The importance of simplifying code and focusing on essential features, enhancing maintainability and ensuring your app is robust and functional for core use cases.

Check out the MyFriends Repository here🚀!

Project 8 Bookworm

Image description

An app to track which books you’ve read and what you thought of them.

###Learn

  • How to create a custom component with @Binding to allow for dynamic and interactive UI elements that can react to changes in the data model.
  • How to accept multi-line text input using TextEditor for capturing and managing detailed user input, such as book reviews or notes.
  • An introduction to SwiftData and SwiftUI for building robust data-driven applications that leverage Swift’s modern data handling capabilities.
  • How to create and manage books using SwiftData to effectively store, retrieve, and manipulate book information in the app’s data model.
  • How to add a custom star rating component to visually represent user ratings, enhancing the user experience with intuitive feedback mechanisms.
  • How to build a list using @Query to dynamically display a collection of book entries, leveraging SwiftUI’s powerful data-binding capabilities.
  • How to show detailed book information by navigating to individual book detail views, providing users with a comprehensive understanding of their tracked books.
  • How to sort SwiftData queries using SortDescriptor to organize book data in a meaningful order, improving data presentation and user navigation.
  • How to delete entries from a SwiftData query to manage and maintain the integrity of the app’s data store effectively.
  • How to use an alert to pop a NavigationLink programmatically to control navigation flow and enhance user interaction within the app’s UI.

Check out the Bookworm Repository here🚀!

Project 7 Cupcake Corner

Image description

App for ordering cupcakes.

###Learn

  • How to use SwiftUI’s List to dynamically display a collection of data items, enhancing the user interface with interactive elements.
  • How to leverage @State and @Binding properties in SwiftUI to manage and share state between views, allowing for responsive UI updates.
  • How to implement data fetching using URLSession to perform network requests and handle asynchronous data loading within the app.
  • How to parse JSON data into Swift structs using Codable, enabling easy data manipulation and display.
  • How to utilize SwiftUI’s NavigationStack to allow users to navigate between views with a back button, improving app usability.
  • How to use Alert to display error messages or confirmations to the user, enhancing the app’s user interaction flow.
  • How to apply custom styles and modifiers to SwiftUI views for a consistent and visually appealing design across the app.
  • How to implement error handling mechanisms to gracefully manage and present network or data errors to the user.

Check out the Cupcake Corner Repository here🚀!

Challenge Project 5 HabitHub

Image description

Habit-tracking app, for folks who want to keep track of how much they do certain things. That might be learning a language, practicing an instrument, exercising, etc.

###Learn

  • How to use a class with the @Observable macro to manage and track changes in a list of activities, enabling real-time updates in the UI.
  • How to use sheet() to present modal views, such as a form for adding new activities, and NavigationLink for navigating to detail screens.
  • How to conform data structures to the Identifiable and Equatable protocols, simplifying list management and enabling comparison of activities.
  • How to work with UserDefaults to persist data locally, ensuring that user activities and completion counts are saved and reloaded across app launches.
  • How to implement a simple form using SwiftUI’s Form, TextField, and Button components to add new activities with a title and description.
  • How to build a detail screen that displays an activity’s information and allows users to increment its completion count, updating the data model.
  • How to use Codable to serialize and deserialize activity data, making it easy to save to and load from UserDefaults.
  • How to use firstIndex(of:) to locate and update specific items within an array, facilitating the modification of activity data when the user interacts with the app.

Check out the HabitHub Repository here🚀!

Project 6 - Moonshot

Image description

An app that lets users learn about the missions and astronauts that formed NASA’s Apollo space program.

###Learn

  • How to use ScrollView to work with scrolling data, enabling the display of content larger than the available screen space.
  • How to push new views onto the stack using NavigationLink, allowing for navigation between different parts of the app.
  • How to work with hierarchical Codable data, making it easier to manage complex data structures.
  • How to lay out views in a scrolling grid, providing a flexible way to present items in a grid format.
  • How to load a specific kind of Codable data, ensuring precise data handling.
  • How to use generics to load any kind of Codable data, increasing the versatility of data loading functions.
  • How to format our mission view, creating a polished and user-friendly interface.
  • How to show mission details with ScrollView and containerRelativeFrame(), enhancing the presentation of detailed information.
  • How to merge Codable structs, simplifying data management and integration.

Check out the Moonshot Repository here🚀!

Project 5 - iExpense

Image description

iExpense is an expense tracker that separates personal costs from business costs.

###Learn

  • How to use UserDefaults to store and retrieve user preferences and app settings.
  • How to conform to the Codable protocol for encoding and decoding data, making it easier to save complex objects.
  • How to present modals and sheets using sheet(), providing a way to display temporary content over the current view.
  • How to delete items from a list using the onDelete() modifier, enhancing the app’s interactivity.
  • How to use the @Observable attribute to create observable objects that SwiftUI views can subscribe to, enabling reactive programming.
  • How to create forms with text fields and pickers in SwiftUI, streamlining the process of user input.
  • How to use Swift Data, sorting and filtering

Check out the iExpense Repository here🚀!

Challenge Project 4 - Project Multiply Mastery

Image description

Welcome to Multiply Mastery, the ultimate edutainment app designed to make learning multiplication tables fun and engaging for kids! With vibrant graphics and playful animations, children can practice their multiplication skills while having a blast.

Learn

  • How to pass data between views in SwiftUI to maintain state and share information across different parts of the app.
  • How to use Emitter Cells to create dynamic confetti animations, enhancing the app’s visual appeal and making learning celebrations more exciting.
  • How to utilize SwiftUI’s declarative syntax to build user interfaces that are both interactive and easy to understand.
  • How to implement customizable quizzes, allowing users to select ranges and question quantities for tailored practice sessions.
  • How to incorporate third-party assets, such as Kenney’s Animal Pack, to add fun themes and characters, making the app more attractive to children.
  • How to use SwiftUI modifiers, such as onAppear and onDisappear, to trigger actions when views enter or leave the screen.

Check out the Multiply Mastery Repository here🚀!

Project 4 - Word Scramble

Image description

The game show players a random eight-letter word, and ask them to make words out of it. For example, if the starter word is “alarming” they might spell “alarm”, “ring”, “main”, and so on.

Check out the Word Scramble Repository here🚀!

Learn

  • How to use List to display rows of data in a scrollable view.
  • How to use onAppear modifier to perform actions when a view appears on screen.
  • How to use Bundle to access the app’s resources such as images, sounds, or data files.
  • How to use fatalError() to terminate the app when an impossible condition occurs, and how to identify such conditions with experience.
  • How to use UITextChecker to check the spelling and grammar of a string, and how to suggest corrections.

1

Project 3 - BetterRest

Image description

BetterRest is an app that uses machine learning to help you optimize your sleep quality based on your wake-up time, desired sleep duration, and coffee consumption. By using regression analysis, it can predict the best time for you to go to bed and adjust to your personal preferences. BetterRest is a smart and simple way to improve your health and well-being. 😴

Check out the Better Rest Repository here🚀!

Learn

  • How to create and use forms and bindings in SwiftUI to collect user input and update the UI accordingly.
  • How to use various components such as DatePicker, Stepper, and Text to display and manipulate data in different formats.
  • How to add buttons to the navigation bar and use navigation links to navigate between views.
  • How to use Create ML and Core ML to train and use a machine learning model that can perform regression analysis on your data and make predictions.
  • How to use machine learning for various purposes and scenarios, while respecting the user’s privacy and security.

1

Challenge Project 2 - Project Rock, Paper, Scissors

Image description

A brain training game that challenges players to win or lose at rock, paper, scissors.

Check out Rock, Paper, Scissors Game Repository here🚀!

1

Project 2 - Guess The Flag

Image description

A guessing game that helps users learn some of the many flags of the world.

Check out the Guess The Flag Repository here🚀!

Learn

  • Stacks to arrange views
  • Colors and frames
  • Gradients in SwiftUI
  • Buttons and images
  • Showing alert messages
  • Stacking up buttons
  • Showing the player’s score with an alert

Challenge Project 3 - GuessTheFlag

  • Add an @State property to store the user’s score, modify it when they get an answer right or wrong, then display it in the alert and in the score label.
  • When someone chooses the wrong flag, tell them their mistake in your alert message – something like “Wrong! That’s the flag of France,” for example.
  • Make the game show only 8 questions, at which point they see a final alert judging their score and can restart the game.

1 2

Challenge Project 1 - SwiftScale

Image description

An app that handles unit conversions.

Check out the SwiftScale Repository here🚀!

Learn

  • Build forms and sections
  • Create navigation views and navigation bar titles
  • Create tabbar views with icons.
  • Store program state with the @State and @FocusState property wrappers
  • Sreate user interface controls like TextField and Picker
  • Create views in a loop using ForEach.
  • Hiding the keyboard

1 2

Project 1 - We Spit

Image description

This project is a check-sharing app that calculates how to split a check based on the number of people and how much tip you want to leave.

Check out the We Spit Repository here🚀!

Learn

  • Build forms and sections
  • Create navigation views and navigation bar titles
  • Store program state with the @State and @FocusState property wrappers
  • Sreate user interface controls like TextField and Picker
  • Create views in a loop using ForEach.

Challenge

  • Add a header to the third section, saying “Amount per person”
  • Add another section showing the total amount for the check – i.e., the original amount plus tip value, without dividing by the number of people.
  • Change the tip percentage picker to show a new screen rather than using a segmented control, and give it a wider range of options – everything from 0% to 100%. Tip: use the range 0..<101 for your range rather than a fixed array.

1 2

100-days-of-swiftui-by-nazar's People

Contributors

nazarzbs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.