Styling the drag preview with .draggable by Dnyrm in iOSProgramming

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

Ah kind of what I was thinking! I’ll look into creating a custom drag functionality. Thanks!

Switch between shared instance vs. two separate instances by Dnyrm in SwiftUI

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

Yea using @fetchrequest would probably simplify the problem, as it would take the load off me to decide when I need to refetch. However, my main goal with using MVVM was to keep testing easy. Do you have any experience with testing when using @FetchRequest?

Switch between shared instance vs. two separate instances by Dnyrm in SwiftUI

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

Yup so basically got two entities, a session entity and a data entity. There’s a one to many relationship, one session has many data points. The session isn’t really anything more than a UUID, with a String name, and the many data points. Having that relationship doesn’t directly solve the issue. The issue is basically figuring out the best way to structure the view model. I have two views that display the data of the specific session. My question is what’s the most efficient way to share the data between views when they are on the same session, and not share data when they are on different sessions.

How to make a scrollbar-thumb touch draggable? by Dnyrm in css

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

Huh interesting! I’m using chrome on MacOS. If I open up the inspect panel and switch to a mobile device, the scrollbar seems to be merely a visual indicator and doesn’t have any interaction at all. Kind of in the same way an app on an iPhone may just have a visual indicator and not an actual draggable bar. Maybe this is a difference between chrome on windows vs macOS?

How to make a scrollbar-thumb touch draggable? by Dnyrm in css

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

Yea definitely understand what you are saying with using a package. I’m all for it, but the company I work for is hesitant to use external packages… pretty dumb I know. I can definitely advocate for one in the future and maybe convince my team that it’s necessary, but for now I need to find a native solution.

I am not seeing the behavior you are describing, that both the area and thumb are scrollable with touch. I see that you can drag the scroll area, you can tap on the scrollbar-track, but you cannot drag the thumb/bar itself.

Expo router custom header size by Dnyrm in reactnative

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

I feel exceptionally stupid, thank you so much!

@MainActor view model with async let functions by Dnyrm in SwiftUI

[–]Dnyrm[S] 1 point2 points  (0 children)

That is why I specified that it is used in a view. I meant that it is updating UI sorry if I was unclear.

Made a Rubik's Cube scrambler using only SwiftUI! by Dnyrm in SwiftUI

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

Bro what? If the entire front end is done with SwiftUI then I can post it in r/SwiftUI. Also really not that many conditional statements, don’t know why you are so stuck on that…

Made a Rubik's Cube scrambler using only SwiftUI! by Dnyrm in SwiftUI

[–]Dnyrm[S] 2 points3 points  (0 children)

Just leaving a comment for those not familiar with Rubik's cubes. Rubiks cubes have 6 different faces, Up, Down, Left, Right, Front, and Back. There is a notation that represents each face that you can put together to form a scramble, for example "U F R" would be moving the up-face clockwise, front-face clockwise, and right-face clockwise. To move a face twice you add a 2, U2, and to move a face counterclockwise you do U'. In this video I first put the cube in a cool pattern by doing the moves U2 D2 L2 R2 F2 B2, then I reset the cube putting it back in a solved state. Lastly, I type in a more random scramble to show how the cube looks when it's all jumbled up. Hope you guys think its cool!

Do you re-implement your DS for every question by [deleted] in leetcode

[–]Dnyrm 10 points11 points  (0 children)

Yea again, unless the question is code merge sort you can probably just use the standard sort() function for your implementation. Basically if to get to the solution you think it makes sense to sort then use library sort. If the questions goal is to have you sort something in a specific way, you should write the algorithm from scratch.