home.social

#samplecode — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #samplecode, aggregated by home.social.

fetched live
  1. ⭐️ Updated my visionOS 'Safari Tab Bar' sample code to use the new custom hover effects introduced in visionOS 2.0, so the address bar now expands when you look at it (something impossible in earlier versions of the OS)

    #samplecode

    github.com/steventroughtonsmit

  2. ⭐️ Updated my visionOS 'Safari Tab Bar' sample code to use the new custom hover effects introduced in visionOS 2.0, so the address bar now expands when you look at it (something impossible in earlier versions of the OS)

    #samplecode

    github.com/steventroughtonsmit

  3. ⭐️ Updated my visionOS 'Safari Tab Bar' sample code to use the new custom hover effects introduced in visionOS 2.0, so the address bar now expands when you look at it (something impossible in earlier versions of the OS)

    #samplecode

    github.com/steventroughtonsmit

  4. ⭐️ New sample code: VisionImmersiveDockableUIKit

    "This is a simplified example showing how to spawn a fully immersive scene using UIKit and UIHostingSceneDelegate in visionOS 26.

    Additionally, it demonstrates using private API to dock the main window in the immersive scene, in a similar way to how video players work on visionOS."

    #samplecode

    github.com/steventroughtonsmit

  5. ⭐️ New sample code: VisionImmersiveDockableUIKit

    "This is a simplified example showing how to spawn a fully immersive scene using UIKit and UIHostingSceneDelegate in visionOS 26.

    Additionally, it demonstrates using private API to dock the main window in the immersive scene, in a similar way to how video players work on visionOS."

    #samplecode

    github.com/steventroughtonsmit

  6. ⭐️ New sample code: VisionImmersiveDockableUIKit

    "This is a simplified example showing how to spawn a fully immersive scene using UIKit and UIHostingSceneDelegate in visionOS 26.

    Additionally, it demonstrates using private API to dock the main window in the immersive scene, in a similar way to how video players work on visionOS."

    #samplecode

    github.com/steventroughtonsmit

  7. Algorithms and Data Structures implemented in #JavaScript and #TypeScript for beginners, following best practices. github.com/TheAlgorithm... #Programming #Tutorials #Algorithms #DataStructures #SampleCode #GitHub
  8. Algorithms and Data Structures implemented in #JavaScript and #TypeScript for beginners, following best practices. github.com/TheAlgorithm... #Programming #Tutorials #Algorithms #DataStructures #SampleCode #GitHub
  9. Algorithms and Data Structures implemented in #JavaScript and #TypeScript for beginners, following best practices. github.com/TheAlgorithm... #Programming #Tutorials #Algorithms #DataStructures #SampleCode #GitHub
  10. Algorithms and Data Structures implemented in #JavaScript for beginners, following best practices. github.com/TheAlgorithm... #Programming #Tutorials #algorithms #DataStructures #SampleCode
  11. Algorithms and Data Structures implemented in #JavaScript for beginners, following best practices. github.com/TheAlgorithm... #Programming #Tutorials #algorithms #DataStructures #SampleCode
  12. Algorithms and Data Structures implemented in #JavaScript for beginners, following best practices. github.com/TheAlgorithm... #Programming #Tutorials #algorithms #DataStructures #SampleCode
  13. ⭐️ Threw together a little proxy UIView subclass for visionOS that lets you set z position, transform and glass effects/radius while abstracting away the SwiftUI hosting so you don't really need to know about it. Not complete, but thought it might be useful.

    In the video below, it's used in a UICollectionViewCell subclass.

    I wish these properties were just exposed on UIView.

    gist.github.com/steventroughto

    #samplecode

  14. ⭐️ Threw together a little proxy UIView subclass for visionOS that lets you set z position, transform and glass effects/radius while abstracting away the SwiftUI hosting so you don't really need to know about it. Not complete, but thought it might be useful.

    In the video below, it's used in a UICollectionViewCell subclass.

    I wish these properties were just exposed on UIView.

    gist.github.com/steventroughto

    #samplecode

  15. ⭐️ Threw together a little proxy UIView subclass for visionOS that lets you set z position, transform and glass effects/radius while abstracting away the SwiftUI hosting so you don't really need to know about it. Not complete, but thought it might be useful.

    In the video below, it's used in a UICollectionViewCell subclass.

    I wish these properties were just exposed on UIView.

    gist.github.com/steventroughto

    #samplecode

  16. ⭐️ I wanted to figure out how to do a Messages-style auxiliary pane that animates out from behind the main content, so I put together this little UIKit project that demonstrates just that. Minimal SwiftUI usage just for the transform in 3D space

    github.com/steventroughtonsmit

    #samplecode
    #visionOS

  17. ⭐️ I wanted to figure out how to do a Messages-style auxiliary pane that animates out from behind the main content, so I put together this little UIKit project that demonstrates just that. Minimal SwiftUI usage just for the transform in 3D space

    github.com/steventroughtonsmit

    #samplecode
    #visionOS

  18. ⭐️ I wanted to figure out how to do a Messages-style auxiliary pane that animates out from behind the main content, so I put together this little UIKit project that demonstrates just that. Minimal SwiftUI usage just for the transform in 3D space

    github.com/steventroughtonsmit

    #samplecode
    #visionOS

  19. ⭐️ New sample code! Saw some confusion on how a UIKit app might add 3D content or views with z offset in visionOS, so I made a little demo project to show how it works. And I wrote it in ObjC this time, just to illustrate how any basically app can add this kind of stuff

    github.com/steventroughtonsmit

    #samplecode
    #visionos

  20. ⭐️ New sample code! Saw some confusion on how a UIKit app might add 3D content or views with z offset in visionOS, so I made a little demo project to show how it works. And I wrote it in ObjC this time, just to illustrate how any basically app can add this kind of stuff

    github.com/steventroughtonsmit

    #samplecode
    #visionos

  21. ⭐️ New sample code! Saw some confusion on how a UIKit app might add 3D content or views with z offset in visionOS, so I made a little demo project to show how it works. And I wrote it in ObjC this time, just to illustrate how any basically app can add this kind of stuff

    github.com/steventroughtonsmit

    #samplecode
    #visionos

  22. ⭐️ I've seen quite a bit of confusion over how Apple's visionOS apps structure non-window-based UI, where it's really not that complicated at all.

    This is a trivial example that illustrates how you might create UI that looks like it’s not part of a window — floating, animating, and transforming in 3D — and what that means for windows, views and ornaments. TL;DR don't overthink it!

    gist.github.com/steventroughto

    #samplecode

  23. ⭐️ I've seen quite a bit of confusion over how Apple's visionOS apps structure non-window-based UI, where it's really not that complicated at all.

    This is a trivial example that illustrates how you might create UI that looks like it’s not part of a window — floating, animating, and transforming in 3D — and what that means for windows, views and ornaments. TL;DR don't overthink it!

    gist.github.com/steventroughto

    #samplecode

  24. ⭐️ I've seen quite a bit of confusion over how Apple's visionOS apps structure non-window-based UI, where it's really not that complicated at all.

    This is a trivial example that illustrates how you might create UI that looks like it’s not part of a window — floating, animating, and transforming in 3D — and what that means for windows, views and ornaments. TL;DR don't overthink it!

    gist.github.com/steventroughto

    #samplecode

  25. ⭐️ I've seen this one asked on the official forums, so here's my quick take on how to expand a window to show a sidebar, Safari-style, on visionOS: github.com/steventroughtonsmit

    #visionos
    #samplecode

  26. ⭐️ I've seen this one asked on the official forums, so here's my quick take on how to expand a window to show a sidebar, Safari-style, on visionOS: github.com/steventroughtonsmit

    #visionos
    #samplecode

  27. ⭐️ I've seen this one asked on the official forums, so here's my quick take on how to expand a window to show a sidebar, Safari-style, on visionOS: github.com/steventroughtonsmit

    #visionos
    #samplecode

  28. ⭐️ Because I have nothing else to do with this SafariTabBar experiment right now, I've pushed the visionOS-updated version of the code to GitHub. If nothing else, it demonstrates how a UIKit app with custom UI might approach adding support for visionOS

    github.com/steventroughtonsmit

    #samplecode

  29. ⭐️ Because I have nothing else to do with this SafariTabBar experiment right now, I've pushed the visionOS-updated version of the code to GitHub. If nothing else, it demonstrates how a UIKit app with custom UI might approach adding support for visionOS

    github.com/steventroughtonsmit

    #samplecode

  30. ⭐️ Because I have nothing else to do with this SafariTabBar experiment right now, I've pushed the visionOS-updated version of the code to GitHub. If nothing else, it demonstrates how a UIKit app with custom UI might approach adding support for visionOS

    github.com/steventroughtonsmit

    #samplecode

  31. ⭐️ I've seen a few questions going around, so here's some sample code: VisionVolumetricUIKit — Present a volumetric window from a UIKit app on visionOS

    github.com/steventroughtonsmit

    #samplecode

  32. ⭐️ I've seen a few questions going around, so here's some sample code: VisionVolumetricUIKit — Present a volumetric window from a UIKit app on visionOS

    github.com/steventroughtonsmit

    #samplecode

  33. ⭐️ I've seen a few questions going around, so here's some sample code: VisionVolumetricUIKit — Present a volumetric window from a UIKit app on visionOS

    github.com/steventroughtonsmit

    #samplecode

  34. ⭐️ New sample code: CatalystUnsavedChanges — prevent window or app closure while the current window has unsaved changes github.com/steventroughtonsmit #samplecode

  35. ⭐️ New sample code: CatalystUnsavedChanges — prevent window or app closure while the current window has unsaved changes github.com/steventroughtonsmit #samplecode

  36. ⭐️ New sample code: CatalystUnsavedChanges — prevent window or app closure while the current window has unsaved changes github.com/steventroughtonsmit #samplecode

  37. ⭐️ New Sample Code: CatalystCustomToolbar — building a UIKit (or SwiftUI) toolbar that respects window controls and macOS fullscreen mode github.com/steventroughtonsmit #samplecode

  38. ⭐️ New Sample Code: CatalystCustomToolbar — building a UIKit (or SwiftUI) toolbar that respects window controls and macOS fullscreen mode github.com/steventroughtonsmit #samplecode

  39. ⭐️ New Sample Code: CatalystCustomToolbar — building a UIKit (or SwiftUI) toolbar that respects window controls and macOS fullscreen mode github.com/steventroughtonsmit #samplecode

  40. 🛠️ I'd been asked before how to implement custom menu views in Mac Catalyst, and I recently had the need to figure this out for one of my apps. Spoiler: it's a messy process, and desperately needs a public API (FB11863961), but it /can/ be done. github.com/steventroughtonsmit #samplecode #maccatalyst

  41. 🛠️ I'd been asked before how to implement custom menu views in Mac Catalyst, and I recently had the need to figure this out for one of my apps. Spoiler: it's a messy process, and desperately needs a public API (FB11863961), but it /can/ be done. github.com/steventroughtonsmit #samplecode #maccatalyst

  42. 🛠️ I'd been asked before how to implement custom menu views in Mac Catalyst, and I recently had the need to figure this out for one of my apps. Spoiler: it's a messy process, and desperately needs a public API (FB11863961), but it /can/ be done. github.com/steventroughtonsmit #samplecode #maccatalyst

  43. 🛠️ While I'm catching up on GitHub, I put together an NSSavePanel bridge example for Catalyst a couple months back that lets you do things like provide custom UI for export options. I know a lot of people asked me about that one, and I finally had reason to implement it in @pastelapp. You could use the same technique to call NSAlert and use Mac-specific alert styles (e.g. for text fields) github.com/steventroughtonsmit #samplecode #maccatalyst

  44. 🛠️ While I'm catching up on GitHub, I put together an NSSavePanel bridge example for Catalyst a couple months back that lets you do things like provide custom UI for export options. I know a lot of people asked me about that one, and I finally had reason to implement it in @pastelapp. You could use the same technique to call NSAlert and use Mac-specific alert styles (e.g. for text fields) github.com/steventroughtonsmit #samplecode #maccatalyst

  45. 🛠️ While I'm catching up on GitHub, I put together an NSSavePanel bridge example for Catalyst a couple months back that lets you do things like provide custom UI for export options. I know a lot of people asked me about that one, and I finally had reason to implement it in @pastelapp. You could use the same technique to call NSAlert and use Mac-specific alert styles (e.g. for text fields) github.com/steventroughtonsmit #samplecode #maccatalyst

  46. GitHub watchers would have seen this already, but I spent January building myself a drop-in cross-platform Help UI for my apps in place of Apple's Help Books (which have docs from the Stone Age, and don't support Apple's most-popular platforms for whatever reason). github.com/steventroughtonsmit #samplecode #maccatalyst

  47. GitHub watchers would have seen this already, but I spent January building myself a drop-in cross-platform Help UI for my apps in place of Apple's Help Books (which have docs from the Stone Age, and don't support Apple's most-popular platforms for whatever reason). github.com/steventroughtonsmit #samplecode #maccatalyst

  48. GitHub watchers would have seen this already, but I spent January building myself a drop-in cross-platform Help UI for my apps in place of Apple's Help Books (which have docs from the Stone Age, and don't support Apple's most-popular platforms for whatever reason). github.com/steventroughtonsmit #samplecode #maccatalyst