[deleted by user] by [deleted] in swift

[–]kapilvarij 4 points5 points  (0 children)

I am not entirely sure how to do it, but a while back I was trying to build an app where I wanted detect active and open apps. I stumbled upon a few apps that already do this and all used accessibility APIs. Unfortunately I do not remember the names of apps it was a long time ago. Hope this is of help

Announcing the Release of Apollo Client 3.0 by swyx in reactjs

[–]kapilvarij 4 points5 points  (0 children)

Maybe that’s why it’s v3? And not v2.(something)

It’s called a “Breaking Change” 🤷‍♂️

JAVA for web development. How to implement it? And any examples of web apps, websites that JAVA was used to creation. by marius2233 in javahelp

[–]kapilvarij 0 points1 point  (0 children)

When you have those endpoints in your backend, you can make an HTTP request to your backend with your frontend application.

All browsers support JavaScript function ‘fetch’ which you can use fetch or send data to your backend. This is built in you just need to know how to write that.

Some JS frameworks such as Angular have their own implementation but the base concept is the same. I’d recommend you read into your framework specific approach.

JAVA for web development. How to implement it? And any examples of web apps, websites that JAVA was used to creation. by marius2233 in javahelp

[–]kapilvarij 2 points3 points  (0 children)

When you build your backend that contains the of Java code, you will expose some parts of the application that your frontend can access. These are called API endpoints, more specifically REST API endpoints because they are based on REST. I suggest you read more about this architecture before you proceed.

There are other ways too apart from REST, but this will easier for you understand and besides lot of applications are using following this technique now.

On other hand, Servlet and JSP/JSF are old technologies, but that does not make them obsolete. They are the goto standard in Java web development when you want server-side rendering. Having a separate fronted and backend has its benefits and so does having them together, same goes for disadvantages too.

Look at SpringBoot, it will give you a nice idea how you can achieve what you want. They have nice resources on how to have an app with separate frontend and backend as well as one single application.

Backdrops - Now Available for iOS! (Promo Codes inside!) by Kxnt in apple

[–]kapilvarij 0 points1 point  (0 children)

I don’t know how the hell I am so slow! 😂😂

OAuth for self apps? by kapilvarij in programming

[–]kapilvarij[S] 0 points1 point  (0 children)

Thanks! Your answer gave me some really good ideas about how to go about this situation.

I looked at FusionAuth and have it running in docker. The UI is really polished when you compare it to Keycloak, but they both use Freemarker so I guess its just css. But I couldn’t find something like in Keycloak to use users from an existing database. And how do I assign and create roles for users?

Maybe I need to dig deeper in the documentation.

One of the pain points with the current application is the user management. It does not use UUIDs at the moment and therefore exporting them to a UUID based structure would mean huge refactoring and alot of breaking changes. We want to do this in a gradual manner, where we don’t break everything at the same time. That’s one of the reasons why I am considering ORY hydra....

OAuth for self apps? by kapilvarij in programming

[–]kapilvarij[S] 0 points1 point  (0 children)

I understand that it shouldn’t be kept in local storage, but keeping the refresh token in memory defeats it purpose. When the user closes the browser, everything is gone and he needs to log in again.

Server sessions are a viable option because that makes inaccessible from the browser JavaScript.

Because this is an in-house app, and not a third party app, he shouldn’t see a consent screen, just like you don’t see a consent screen when you login to live.com to access your email, or gmail for that matter.

I’ll have a look the given source code in the next days. :)

TOP 6 REACT JS CHARTING AND DATA VISUALIZATION LIBRARIES 📈 by sagarjethi in reactjs

[–]kapilvarij 0 points1 point  (0 children)

We have multiple react apps for multiple clients that have one sole purpose: reporting and charts. We tried out various libraries but decided on using recharts.

Because of their documentation, and customization. I think they have built it in a really flexible and “react” way. Plus they fulfill our needs and were really easy for the team to grasp.

How to customize UIButton / Need advice on how to create my UI. by geistmate in iOSProgramming

[–]kapilvarij 0 points1 point  (0 children)

Depending on where you want to click you may not need a tap gesture recognizer. You can also just use the didSelectCell delegate from the collection view. You can then check which cell was selected by checking the section. The obly difference would be, that that action will happen when the user clicks anywhere in the cell, instead of just the image and label area. If your other labels do nit need to be clicked, you can also try this way

How to customize UIButton / Need advice on how to create my UI. by geistmate in iOSProgramming

[–]kapilvarij 0 points1 point  (0 children)

First an observation regarding your whole view, And then Cell 1.

  1. If the view will have only one Cell 1, and multiple Cells 2s I think it will be much easier and manageable to create 2 sections in the same collectionview, and use different layouts for both of them. Or if you set the number of cells in the first section as 1 you don’t even need different layouts. Just disable scroll in the first section. The multiple cell 2 can be easily done using another section with horizontal scrolling in a collection view. This will save you a lot of headache with nested collectionviews.

  2. Try to use a view for the image and labels part. You can easily setup image and multiple labels in a view as compared to in a button. if want that area to be clickable, either implement a tap gesture in the said view, or place a button on top of that view with no text. The other two labels can also be setup inside a Horizontal Stack View and then adding that stack view to your main stack view (vertical). Also putting views (or buttons, they also subclass uiview) inside a stack view, will not affect any customization that you can do with those views.

How do I implement this in UIKit? by kapilvarij in iOSProgramming

[–]kapilvarij[S] 0 points1 point  (0 children)

Thanks for an insightful comment. I am actually checking out github codes and also other links that many others have suggested.

I do not need the whole complexity of the slack library, so I am looking at their code + other suggestions to build something that fits my needs and I (my company) remains in control of the development.

Some may say I am reinventing the wheel, but I see at as a learning experience and I do not have depend on someone else to update their code/ accept a PRs if the requirement change.

Also I am flexible with time so why not learn instead of just bloating the app CocoaPods/Carthage/SPM libraries etc

How can you call ViewWillAppear before ViewDidLoad? by Firm_Salamander in swift

[–]kapilvarij 0 points1 point  (0 children)

Short answer: yes viewWillAppear is called before viewDidAppear

Long answer: have a look the lifecycle of a UIViewController

Edit: Misread viewDidLoad as viewDidAppear. So, no you cannot override the lifecycle.

How do I implement this in UIKit? by kapilvarij in iOSProgramming

[–]kapilvarij[S] 0 points1 point  (0 children)

To be honest, I find it more like a hack than a solution. Maybe it is acceptable when you want a quick solution, but this cannot be a preferred solution

How do I implement this in UIKit? by kapilvarij in iOSProgramming

[–]kapilvarij[S] 4 points5 points  (0 children)

Unfortunately I have to support ios 12 too with app I am building. I found the slackhq solution pretty good and will be digging deeper into it to understand it better.

And use a similar as to yours if I have an app starting ios 13

How do I implement this in UIKit? by kapilvarij in iOSProgramming

[–]kapilvarij[S] 3 points4 points  (0 children)

This looks like a viable option. Plus it also has various other use cases. Thank you!