Skip to content
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

Merged
merged 12 commits into from
Aug 3, 2023

Conversation

JaseTheJap
Copy link
Contributor

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

  • Adding a new entry
  • Updating the documentation

Checklist

  • [ *] All writings are my own.
  • [ *] My entry follows the Codecademy Docs style guide.
  • [* ] My changes generate no new warnings.
  • [ *] I have performed a self-review of my own writing and code.
  • [* ] I have checked my entry and corrected any misspellings.
  • [ *] I have made corresponding changes to the documentation if needed.
  • [* ] I have confirmed my changes are not being pushed from my forked main branch.
  • [ *] I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • [* ] Under "Development" on the right, I have linked any issues that are relevant to this PR (write "Closes # in the "Description" above).

@CLAassistant
Copy link

CLAassistant commented May 10, 2023

CLA assistant check
All committers have signed the CLA.

@yangc95 yangc95 self-assigned this May 10, 2023
@yangc95 yangc95 added swiftui new entry New entry or entries status: under review Issue or PR is currently being reviewed labels May 10, 2023
@yangc95 yangc95 linked an issue May 10, 2023 that may be closed by this pull request
3 tasks
Copy link
Contributor

@yangc95 yangc95 left a 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.

content/swiftui/concepts/widgets/widgets.md Outdated Show resolved Hide resolved
content/swiftui/concepts/widgets/widgets.md Outdated Show resolved Hide resolved
content/swiftui/concepts/widgets/widgets.md Outdated Show resolved Hide resolved
content/swiftui/concepts/widgets/widgets.md Outdated Show resolved Hide resolved
content/swiftui/concepts/widgets/widgets.md Outdated Show resolved Hide resolved
content/swiftui/concepts/widgets/widgets.md Outdated Show resolved Hide resolved
## 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## To create a widget using the Widget Extension template in Xcode, follow these steps:
## Xcode Widget Extension Template

Copy link
Contributor

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.

content/swiftui/concepts/widgets/widgets.md Outdated Show resolved Hide resolved
JaseTheJap and others added 5 commits May 11, 2023 09:05
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>
@JaseTheJap
Copy link
Contributor Author

@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!

@yangc95
Copy link
Contributor

yangc95 commented May 11, 2023

@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 🙂

@JaseTheJap
Copy link
Contributor Author

@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.

@yangc95
Copy link
Contributor

yangc95 commented May 25, 2023

@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 👍

@SSwiniarski
Copy link
Contributor

@JaseTheJap Just checking in, it's been a while. Do you still need assistance?

@JaseTheJap
Copy link
Contributor Author

@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.

Copy link
Contributor

@CBID2 CBID2 left a 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! 😊🙏🏽

Comment on lines 35 to 43
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.
Copy link
Contributor

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.

Suggested change
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.

Copy link
Contributor

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.)

@yangc95
Copy link
Contributor

yangc95 commented Jul 3, 2023

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!

@yangc95
Copy link
Contributor

yangc95 commented Jul 20, 2023

@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.

@yangc95 yangc95 merged commit 83ff2a2 into Codecademy:main Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

👋 @JaseTheJap
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

@yangc95
Copy link
Contributor

yangc95 commented Aug 3, 2023

@CBID2
Copy link
Contributor

CBID2 commented Aug 3, 2023

🍾 @JaseTheJap live link: https://www.codecademy.com/resources/docs/swiftui/widgets

Screenshot 2023-08-03 at 4 56 46 PM

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?

cc: @CBID2 @KTom101

My GitHub account is linked so I'm not sure @yang95

@yangc95
Copy link
Contributor

yangc95 commented Aug 4, 2023

@CBID2 oh haha, I tagged you b/c you helped leave a review on this one

@CBID2
Copy link
Contributor

CBID2 commented Aug 4, 2023

@CBID2 oh haha, I tagged you b/c you helped leave a review on this one

Maybe there's a technical issue @yangc95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Concept Entry] SwiftUI Widgets
5 participants