-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added SwiftUI Widgets file, what widgets are and how to create one #2123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JaseTheJap Awesome! I like how you did a dive into the template. This is a great base to iterate on.
I left a few comments. After you get the chance to look over and apply them, make sure to tag me so I can either approve or provide further input.
## What are SwiftUI Widgets? | ||
**SwiftUI Widgets** are interactive components that provide users with glanceable information or quick access to app functionality directly from the home screen of their device. They are mini-applications that can display dynamic content, such as weather updates, calendar events, or news headlines. SwiftUI widgets can be created using the WidgetKit framework and are highly customizable, allowing developers to design visually appealing and personalized experiences for users without requiring them to open the full app. | ||
|
||
## To create a widget using the Widget Extension template in Xcode, follow these steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## To create a widget using the Widget Extension template in Xcode, follow these steps: | |
## Xcode Widget Extension Template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is getting into the "tutorial realm" which we would like to differentiate Docs from. Rather than set-up, I think it would be more helpful to perhaps explain in this section how Xcode offers developers a template to use which "will generate the necessary files and folders for the widget extension, including a default SwiftUI widget view and a widget extension entry point."
You can also go into other info about this template as you've done here after the steps.
Changed from SwiftUI Widgets to 'Widgets' Co-authored-by: Christine Yang <72277593+yangc95@users.noreply.github.com>
Co-authored-by: Christine Yang <72277593+yangc95@users.noreply.github.com>
Co-authored-by: Christine Yang <72277593+yangc95@users.noreply.github.com>
Co-authored-by: Christine Yang <72277593+yangc95@users.noreply.github.com>
Co-authored-by: Christine Yang <72277593+yangc95@users.noreply.github.com>
@yangc95 I have made the suggested changes. Please let me know if everything is in order! Hope I have done it right. Have a good day! |
@JaseTheJap Thanks for taking in some suggestions! I think you may have glossed over some comments. Have another look and I can review this afterward. If you have any questions, please tag me along the comment thread. Thanks 🙂 |
@yangc95 Wondering if you can help me as I am still learning, I did make the changes locally and made another commit, am I doing something wrong? I used - 'git push origin swiftUIwidget' as that is the branch name I created to work on. I hope I make sense, please let me know. |
@JaseTheJap thanks for your patience on this! I think this resource will help you out: https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository To that I believe your command would work 👍 |
@JaseTheJap Just checking in, it's been a while. Do you still need assistance? |
Hi, Sorry for the delay. Had some unforeseen issues that needed my attention. I will get to this ASAP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JaseTheJap. I gave a suggestion on how to improve your entry. I hope it helps! 😊🙏🏽
In the generated widget view file (e.g., YourWidget.swift), you can modify the appearance and content of the widget by editing the body property. Add SwiftUI components, apply styles, and display dynamic data to create your desired widget UI. | ||
|
||
In the generated widget extension entry point file (e.g., YourWidgetExtension.swift), you'll find a struct conforming to Widget protocol. You can modify this struct to configure your widget's behavior, supported families, and timeline provider. | ||
|
||
After customizing the widget view and the widget extension, you can build and run your app to see the widget in the widget gallery. | ||
|
||
To add your widget to the home screen, long-press on the home screen, tap the "+" button, search for your app's name, and select your widget to add it to the desired location. | ||
|
||
Remember to adjust the code and configurations as per your project's requirements to create a fully functional and visually appealing SwiftUI widget. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Nitpick] Pronouns are not allowed to be used according to the style guide, so consider revising.
In the generated widget view file (e.g., YourWidget.swift), you can modify the appearance and content of the widget by editing the body property. Add SwiftUI components, apply styles, and display dynamic data to create your desired widget UI. | |
In the generated widget extension entry point file (e.g., YourWidgetExtension.swift), you'll find a struct conforming to Widget protocol. You can modify this struct to configure your widget's behavior, supported families, and timeline provider. | |
After customizing the widget view and the widget extension, you can build and run your app to see the widget in the widget gallery. | |
To add your widget to the home screen, long-press on the home screen, tap the "+" button, search for your app's name, and select your widget to add it to the desired location. | |
Remember to adjust the code and configurations as per your project's requirements to create a fully functional and visually appealing SwiftUI widget. | |
In the generated widget view file (e.g., YourWidget.swift), you can modify the appearance and content of the widget by editing the body property. Add SwiftUI components, apply styles, and display dynamic data to create your desired widget UI. | |
In the generated widget extension entry point file (e.g., YourWidgetExtension.swift), you'll find a struct conforming to Widget protocol. You can modify this struct to configure your widget's behavior, supported families, and timeline provider. | |
After customizing the widget view and the widget extension, you can build and run your app to see the widget in the widget gallery. | |
To add your widget to the home screen, long-press on the home screen, tap the "+" button, search for your app's name, and select your widget to add it to the desired location. | |
Remember to adjust the code and configurations as per your project's requirements to create a fully functional and visually appealing SwiftUI widget. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove pronouns here (I, we, you, etc.)
Hey @JaseTheJap, hope all is well. Just checking in on the progress of this PR. I can assist with making some direct changes if needed. Let me know if that's cool with you! |
@JaseTheJap I removed the portion with the tutorial steps but you also have the option to create a tutorial here: Codecademy/ugc#64 Let me know if you'd like to take this one! Otherwise, we'll continue with another review for this PR. |
👋 @JaseTheJap |
🍾 @JaseTheJap live link: https://www.codecademy.com/resources/docs/swiftui/widgets It looks as if you're anonymous. If you want to be credited, see My contribution is live but I’m not being shown as a contributor, why is this? |
My GitHub account is linked so I'm not sure @yang95 |
@CBID2 oh haha, I tagged you b/c you helped leave a review on this one |
Description
Topics covered are SwiftUI Widgets, I created a new file called widgets.md where I explain what they are and how to create them.
Type of Change
Checklist
main
branch.