How to create widgets for existing iOS app | iOS 14 Widgets tutorial in Hindi
Vložit
- čas přidán 2. 10. 2020
- This widgets tutorial in Hindi covers ios 14 widgets introduction and how to create widgets for the existing iOS app. In this swiftui widgets tutorial in Hindi we will see how we can use existing iOS code for our widgets extension. The data of the widget is fetched from an API but the good thing is we are using the existing iOS app code for the same for re-usability purpose
Medium link blog post on widgets: / ios-14-widgets-not-ren...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
✅ Subscribe to the channel and stay ahead of everyone by following the right way for writing clean code in swift. 🔥🔥🔥🔥🔥
🔗Click on the link to subscribe: czcams.com/users/codecat?sub...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------------------------------------------------------
📥 Download the source code from
Github: github.com/codecat15/CZcams-...
Google Drive: drive.google.com/file/d/11BLJ...
-----------------------------------------------------------------------------------------------------------------------
🎶 Royalty-free Music: www.bensound.com
############################################
Connect with me on social media
📧: codecat15@gmail.com
Instagram: / codecat15
🐦: / codecat15
Facebook: / code.cat.792
Github: github.com/codecat15
###########################################
#swiftUIWidgetsiOS14 #swiftWidgetTutorialHindi #widgetsTutorialHindi
In this tutorial we will understand what are widgets and how to create widgets for your existing iOS app, since we will be working with an existing app we will try to re-use the code from our iOS app into our widget extension for re-usability. I hope this video will provide you all the steps you need to start your widget development for your iOS app, if you have any questions then please feel free to ask them as comments or email and do share and subscribe the channel with your iOS group
@@mhmudsalah2594 I responded to this question in the earlier comment, do check that out
Very nice explanation! step by step explanation is good. Thank you!
Glad it was helpful!
Love your lectures, sir
It's really great. Please create a Deep Link video soon. i am waiting for that.
Nice Explanation Thankyou for covering this important video in Hindi
Thanks for liking
Hey - very well explained, can you also show tap on some uielement on widget via deep link? or if you have some example already then please share
Hii Thanks for the Awesome Tutorial
Hey Pratik, thanks man just sharing what I have learned and implemented in widgets so far with the community, please do ask questions on this topic and do share this tutorial with your iOS friends on facebook or whats app and do ask them to subscribe for latest updates on swift programming :)
Hi Ravi, Awesome and very helpful video !
can you please create a video tutorial , how to use "share extension" (ios 13.0 or later ) to share image from iPhone's photo gallery to our app 's specific screen (and further to chat - we can omit this part)
Thank you.
Such a useful tutorial u made .. please take me to the link where you explain further part mentioned in this view :
force reload and rest of the things.
I have not explained force reloads but they are fairly simple to do, but should only be done when it's needed and not all the time.
You can refer to this documentation link for how you should plan your widget reloads with best practice: developer.apple.com/documentation/widgetkit/keeping-a-widget-up-to-date
Could you please create a video on deeplinking , Profiler and Instrumental ?
And
How to create custom framework?
👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻 nice
Do feel free to ask questions on this topic sai and do share this with your iOS group
Thanks for the video. Can we add or remove widget dynamically? It can be done using live activity in ActivityKit. But it's supports from ios 16.1. Is there any way to add / remove widget on a button click from application that supports from ios 14?
Hi Code Cat, great quality video, and thanks for doing this, could you please let me know how can I create a widget for an app which displays images in a table view cell. Is there any way to recreate a table view cell onto a widget?
yes its possible to show the images on the widgets, and here's how I would approach it. If your API supports pagination (top and skip) then just bring top 10 records from it, you don't want to bring the entire data set as widgets have limited UI and scrolling is not possible in widgets.
The image URL can then be loaded by the image view using the image from URL function, since widgets do not support scrolling you don't need to worry about lazy loading them but it will be a good idea to include lazy loading images else it's fine.
Let me know if that answers your question if not then feel free to ask more and do share this video with your iOS group to show how easy it is to use the existing codebase to build widgets for your application
Hi sir
How can we navigate an specific View Controller on click of widgets?
Please help for this
Hi Ravi, It was really very good session on iOS 14 Widgets. It was very clear and your explanation is too good. I am eagerly waiting for next part of iOS 14 widgets (Deeplink and Link) in UIKit application.
Hey Monish, welcome to the channel. Glad that this video was helpful to you. I will be making a video on the pending topics very soon. Do share the video with your iOS group and show them how easy it is to create a widget with their existing codebase
Hi Rav, when will you upload video ?
how to link widgets in swift project ?
Hii sir can I show websocket data on widget? Ex - some trading widget like reliance share and it's price and this value is always fluctuate till websocket didn't disconnect. Please reply me..🙂
Hey!!! Any video on interactive widgets specially with toggle. Thanks
As shown in the WWDC video you cannot have widgets that interact with the user. Which means you cannot have UI components like toggle in your widget
@@CodeCat15 i was reading about it and it says we can have button and toggle as an interactive components
ssl panning ,jail broken , xcode cloud, security management , Reactive @code cat these topic can you cover
SSL pinning and security management are few topics in the list, are you looking for something specific for jail broken and Xcode cloud?
Can you please make a video on how to release app to AppStore with Apple guidelines , and what all certificates we need , and what is provisioning profile, what are .cer ? Please
I don't have my app store account so I would have to buy one to actually make a video, however I am working on getting an account of my friend and see if they are comfortable with me using that for this video, till now many have just said NO let's see
@@CodeCat15 Sure Thanks for the response
Great teaching Sir 💯👍
Sir, I wanted to make my career in IOS development but I'm having 2 yrs of gap now. Can you please guide & help me??
in programming, gap does not matter, if you can code you get the job. companies won't reject you as long as you code right and your technical skills are to the point for all the basic concepts. Yes, they will surely ask you why the gap and as long as you have a good reason for it I think you will do okay because companies value talent and good developers.
Since the gap is of 2 years some company may not pay you as per the market standards example: if prior to the gap you had 4 years of experience so they may give you salary as per the market standard for a 4-year exp dev or they may just say you lack some skills and after 6 months we can raise your salary if you perform well, salary is a different gamble and different companies have different measuring mathematics on how they arrive at the figure they pay to their employees.
Just focus on your end result which is getting a job and don't worry about the gap be honest with the company and even if you fail in some interviews then rather than getting tensed learn from your mistakes or even ask the company where you lacked and just focus on skill development.
My key advice is do not sign a bond for 3-5 years, bond is very bad and if you get a better opportunity then you are stuck in one place for 3 years, if the bond is for 1 year I don't really mind because in 1 year you come to know about the company culture, process, management, appraisal process etc
Wishing you all the best and success in your coming days, if this channel helps you in your interview preparations then consider helping your friends who are preparing for job interviews by sharing this channel with them.
and also, do you know if I can refresh the data from the widget when the app receives a push notification and the app is killed/closed?
yes you can do a force refresh on your widget but I have not tested it with push notifications but I do know that you can force a refresh on the widget, we should avoid force refreshing our widgets all the time as it will consume battery and hence apple designed widgets in such a way that the widget with which the user interacts the most is the one to be given priority.
Waiting for force reload and Deeplink for the widgets
Sir, can we use widget in objective C project, please reply soon..
I have not tried that, but I think you should be able to add a widget if you are supporting iOS 13 and above. If you can add the widget project in your existing iOS project build it and run it if you see the widget in your simulator you are all set buddy
Excellent coverage of widget creation & essential topics! Thank you!
When a user opens their home screen on the phone does the widget automatically update at that point or does it just display what was gained in the last update? In other words, does it just use what was gained at the last timeline? Or does it update immediately and then start following the timeline again?
Hello Brad, welcome to the channel. The widget update is actually determined by the OS and there are various factors that are taken under consideration like how many times does the user interacts with the widget and how many times does the widget appear to the user etc based on those calculations the OS determines the priority of the refresh.
However we can force refresh the widget if we want to like if an event occurred in the app you can write code to pass that information to the widget.
If the OS considers the widget less popular then the widget updates based on the timeline that was provided.
Let me know if I answered your question and if not then please feel free to ask more
Widget getTimeLine not called on second install of app
1. Add widget.
2. Uninstall app.
3. Reinstall app.
4. Add widget.
Widget seems to be cached on previous install, please help me to solve it. Thanks a lot!
bro how set widget
Can we add widgets using UIButton through the ViewController??
Hey Shubham, welcome to the channel as of now you cannot add the widget using a uibutton
@@CodeCat15 Okk...Thanks
while adding widget to an existing app widget is not preview or loading in canvas I don't know what's the issue can anyone help
I have an timmer app can i used timmer on widget
I am not very sure about this, but will try it out and let you know soon. Good question btw :)
will show to my project manager and let c what he decides but I really want to work on it
Api calling in widgets are easy, however if you are working with a database i think there’s a different approach you need to take.
@@CodeCat15 yeah I need to call api for just display the upcoming appointment with the doctors . Will try on weekend and then will show the manager if he likes it .
By the way you always provide great content ❤️❤️
Just make sure to re-use the existing code like shown in the video coz then the widget and the main app both will refer the same swift file and you don’t need to maintain two different copies. If you get stuck plz feel free to ask questions 😊
@@CodeCat15 Thank you so much for such comprehensive reply :-) Yeah Sure will let you know if stuck somewhere
Is widget supported animation?
No they don’t only plain data display is supported in widgets
Can we add SQLite data to widgets?
I tried hard but it didn't work out. I don't know where I'm going wrong.
can you made one more video on widgets with SQLite?
Yes you can fetch data from db and show it on the widget can you share your example code on GitHub add me as collaborator please. Let’s resolve this together
@@CodeCat15 Yahh Sure...I will send you to night...!!!
Cool
Hello! In the preview I see my widget correct, but when I place on the screen it's empty...
what are you trying to display on the widget? you cannot display a list view as it's a limitation of the widget, apart from that I think if you can see it in the preview you should be able to view it on the simulator or device, make sure it's iOS 14 and above. Let me know if that helps or if you have resolved the issue would request you to share the solution please :)
@@CodeCat15 i tried on a simulator iphone 8 with ios 14, can I send you an email with some ss? i am new to swift UI and also widgets
@@CodeCat15 i sent you an email with the subject: widget problem
Hey there, I responded to the email, let me know if you are still facing issues with the widget
how to upload image as muti part form-data using Viper and URL session ?!
I have a video on that as part of API series given is the link for the same, there I am explaining 3 ways to upload an image on the server. VIPER is an architecture and to be honest it's one of that architecture which I would avoid at any cost unless I really need it, you need to compare as what benefits you are getting to use VIPER as compared to MVVM or MVC
Upload image: czcams.com/video/qhoL1lp4kiY/video.html
I am tried to return data like your example with multi-part and body contain data and sent to the server but the image did not change.
thanks a lot.@@CodeCat15
@@mhmudsalah2594 when you say the image did not change what do you mean by that? Are you trying to update an existing image on the server? I also have a gist in case of multi-part form data which adds extra content-type parameters because some API do need that so do try this code as well
Link: gist.github.com/codecat15/6c1eaa5b7ea48b26b10d907fef68abf2
@@CodeCat15
yes .. I tried to update an existing image on the server.
confused , you have spend so much time to write code to get data , but you are still using constant value as in "TMSSmallView" you have hard coded value in TWSmallView_Preview ? i am sure i am missing something
The values are hardcoded in the preview so that we can see how the view looks like when we are designing it via code.
However when you run the application you will see that a real api is hit and the api data is added on the widget screen.
What you may try here is download the code and in the preview section type any random string you like, you will see that your random string only appears during design time and when you run the app it hits the api.
Let me know if that answers your questions Aqeel and if not plz ask more
how can we opt out for Dark Mode for widgets?
I am unaware of this, would need to check and i think its almost time to make a second video on widgets covering these things
@@CodeCat15 thanks :) I figured out by the way and I can share you if you want,
I would be happy to know that Ali
@@CodeCat15 just don't use the systems color 😆
add your own UIColor set with Universal color (i.e. for both light/dark theme)
Nice Video but what language exactly do you speaking!? (70% English 30% Hindi?) please write your video title in Hindi if you want to speak Hindi in the Video. Thanks.
Hey Ahmad, welcome to the channel, the reason why i speak in english and hindi is coz am from Mumbai and it’s called the Mumbai Hindi, unintentionally sometimes I do speak half of the video in English and then in Hindi as how i did here but i see your point and it’s valid and I will try to keep consistency in my videos from now. 😊
@@CodeCat15 Thank you, I'm surprised how humble you are. Thumbs Up 👍
I think feedback is one way where i can improve myself and make myself better so i take all the feedback in much more positive way as its helping me to be better that’s how i look at it
@@CodeCat15 but I love your explanation in mixed Hindi and English. ❤️
Sir i have mailed you some topic please check that.
Maps and animations right? Can you add more details to those like what exactly would you like to see with maps and animations
@@CodeCat15 ok sir
@@CodeCat15
Google Maps -
1. Auto fetch current location
2. Search specific location and fill current location in text field.
3. Show route from one location to other
4.Fetch latitude and longitude of current location etc.
5. User will get a alert "Allow location access to aap" When install application first time.
Please sir when you got time.
Add some point from your side which I don't remembering.
Great these are good points, i can add a couple and what about animations?
@@CodeCat15 sir i don't have more idea about animation. First I will read about animation then I will let you know.
please sir check your email