├── .DS_Store ├── Animated Tab Icons ├── .DS_Store ├── Animated Tab Icons.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── Animated Tab Icons │ ├── .DS_Store │ ├── Animated_Tab_IconsApp.swift │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── Home.swift │ ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json │ └── Tab.swift ├── AppJiggling ├── .DS_Store ├── AppJiggling.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── tonilijic.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist └── AppJiggling │ ├── App.swift │ ├── AppJiggling.entitlements │ ├── AppJigglingApp.swift │ ├── Assets.xcassets │ ├── .DS_Store │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ └── dock.png │ ├── Contents.json │ ├── Phone.imageset │ │ ├── App Icon.png │ │ ├── App Icon@2x.png │ │ ├── App Icon@3x.png │ │ └── Contents.json │ ├── Safari.imageset │ │ ├── App Icon.png │ │ ├── App Icon@2x.png │ │ ├── App Icon@3x.png │ │ └── Contents.json │ ├── arc.imageset │ │ ├── Contents.json │ │ ├── Group.png │ │ ├── Group@2x.png │ │ └── Group@3x.png │ ├── camera.imageset │ │ ├── Contents.json │ │ ├── camera-1.png │ │ ├── camera-2.png │ │ └── camera.png │ ├── fantastical.imageset │ │ ├── Contents.json │ │ ├── fantastical-1.png │ │ ├── fantastical-2.png │ │ └── fantastical.png │ ├── github.imageset │ │ ├── 4a8ad92b27803f0aa7acd8fa29e25bd0.png │ │ ├── 4a8ad92b27803f0aa7acd8fa29e25bd0@2x.png │ │ ├── 4a8ad92b27803f0aa7acd8fa29e25bd0@3x.png │ │ └── Contents.json │ ├── ia.imageset │ │ ├── Contents.json │ │ ├── ia-1.png │ │ ├── ia-2.png │ │ └── ia.png │ ├── maps.imageset │ │ ├── Contents.json │ │ ├── maps-1.png │ │ ├── maps-2.png │ │ └── maps.png │ ├── messages.imageset │ │ ├── Contents.json │ │ ├── messages-1.png │ │ ├── messages-2.png │ │ └── messages.png │ ├── onepass.imageset │ │ ├── Contents.json │ │ ├── Group 2.png │ │ ├── Group 2@2x.png │ │ └── Group 2@3x.png │ ├── perplexity.imageset │ │ ├── Contents.json │ │ ├── unnamed.png │ │ ├── unnamed@2x.png │ │ └── unnamed@3x.png │ ├── photos.imageset │ │ ├── Contents.json │ │ ├── photos-1.png │ │ ├── photos-2.png │ │ └── photos.png │ ├── things.imageset │ │ ├── Contents.json │ │ ├── things-1.png │ │ ├── things-2.png │ │ └── things.png │ └── wallpaper.imageset │ │ ├── Contents.json │ │ └── iPhone 15 Pro White Wallpaper 5 YTECHB.png │ ├── ContentView.swift │ ├── HDock.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── AppleTVLoader ├── .DS_Store ├── AppleTVLoader.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── AppleTVLoader │ ├── .DS_Store │ ├── AppleTVLoaderApp.swift │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── Icons.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── ArcDragInteraction ├── .DS_Store ├── ArcDragInteraction.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── ArcDragInteraction │ ├── .DS_Store │ ├── ArcDragInteraction.entitlements │ ├── ArcDragInteractionApp.swift │ ├── Assets.xcassets │ │ ├── .DS_Store │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Icon3.imageset │ │ │ ├── Contents.json │ │ │ └── icon3.png │ │ └── pic.imageset │ │ │ ├── Contents.json │ │ │ └── pfp-twitter brown copy.png │ ├── ContentView.swift │ └── Preview Content │ │ └── Preview Assets.xcassets │ │ └── Contents.json ├── ArcDragInteractionTests │ └── ArcDragInteractionTests.swift └── ArcDragInteractionUITests │ ├── ArcDragInteractionUITests.swift │ └── ArcDragInteractionUITestsLaunchTests.swift ├── Button Styles ├── .DS_Store ├── Button Styles.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── Button Styles │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── DarkBlue.colorset │ │ │ └── Contents.json │ ├── Button_Styles.entitlements │ ├── Button_StylesApp.swift │ ├── ContentView.swift │ └── Preview Content │ │ └── Preview Assets.xcassets │ │ └── Contents.json ├── Button StylesTests │ └── Button_StylesTests.swift └── Button StylesUITests │ ├── Button_StylesUITests.swift │ └── Button_StylesUITestsLaunchTests.swift ├── Button animation ├── .DS_Store ├── Button animation.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── Button animation │ ├── .DS_Store │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── toni.grey.colorset │ │ └── Contents.json │ ├── Button_animation.entitlements │ ├── Button_animationApp.swift │ ├── ContentView.swift │ ├── File.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── ConfettiFidgets ├── .DS_Store ├── Assets.xcassets │ ├── Contents.json │ └── Particle Sprite Atlas.spriteatlas │ │ ├── Contents.json │ │ ├── bokeh.imageset │ │ ├── Contents.json │ │ └── Rectangle.png │ │ └── spark.imageset │ │ ├── Contents.json │ │ └── spark.png ├── ConfettiFidgets.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── tonilijic.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── ConfettiFidgets │ ├── .DS_Store │ ├── Assets.xcassets │ │ ├── .DS_Store │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Particle Sprite Atlas.spriteatlas │ │ │ ├── Contents.json │ │ │ ├── bokeh.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── bokeh.png │ │ │ └── spark.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── spark.png │ │ ├── confetti.imageset │ │ │ ├── Contents.json │ │ │ └── Rectangle.png │ │ ├── figma.imageset │ │ │ ├── Contents.json │ │ │ └── Image.png │ │ ├── sketch.imageset │ │ │ ├── Contents.json │ │ │ └── Image.png │ │ └── xcode.imageset │ │ │ ├── Contents.json │ │ │ └── xcode.png │ ├── Confetti.sks │ ├── ConfettiFidgets.entitlements │ ├── ConfettiFidgetsApp.swift │ ├── ContentView.swift │ ├── FidgetItem.swift │ └── Preview Content │ │ └── Preview Assets.xcassets │ │ └── Contents.json └── Fidget.swift ├── Gradient Mesh ├── .DS_Store ├── Gradient Mesh.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── Gradient Mesh │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── ContentView.swift │ ├── Gradient_Mesh.entitlements │ ├── Gradient_MeshApp.swift │ └── Preview Content │ │ └── Preview Assets.xcassets │ │ └── Contents.json ├── Gradient MeshTests │ └── Gradient_MeshTests.swift └── Gradient MeshUITests │ ├── Gradient_MeshUITests.swift │ └── Gradient_MeshUITestsLaunchTests.swift ├── KeyframeChallenge ├── .DS_Store ├── KeyframeChallenge.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── KeyframeChallenge │ ├── .DS_Store │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── KeyframeChallengeApp.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── LICENSE ├── Meatball ├── .DS_Store ├── Meatball.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── Meatball │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── Meatball.entitlements │ ├── MeatballApp.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── Meditation ├── .DS_Store ├── Meditation.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── Meditation │ ├── .DS_Store │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── MeditationApp.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── OnDragExercise ├── .DS_Store ├── OnDragExercise.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── OnDragExercise │ ├── .DS_Store │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── OnDragExerciseApp.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── Paging Indicators ├── .DS_Store ├── Paging Indicators.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── Paging Indicators │ ├── .DS_Store │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── Home.swift │ ├── PageIndicator.swift │ ├── Paging_IndicatorsApp.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── Particles Burst ├── .DS_Store ├── LastBurstTest.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── Particles Burst │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ └── burst.png │ ├── Contents.json │ ├── DarkGrey.colorset │ │ └── Contents.json │ ├── GYellow.colorset │ │ └── Contents.json │ └── Gold.colorset │ │ └── Contents.json │ ├── LastBurstTest.swift │ ├── Particles │ ├── Assets.xcassets │ │ ├── Contents.json │ │ └── Particle Sprite Atlas.spriteatlas │ │ │ ├── Contents.json │ │ │ ├── bokeh.imageset │ │ │ ├── Contents.json │ │ │ └── bokeh.png │ │ │ └── spark.imageset │ │ │ ├── Contents.json │ │ │ └── spark.png │ └── MyParticle.sks │ ├── Preview Content │ ├── Particles.sks │ └── Preview Assets.xcassets │ │ ├── AppIcon.appiconset │ │ └── Contents.json │ │ └── Contents.json │ └── SceneView.swift ├── README.md ├── Spinner1 ├── .DS_Store ├── Spinner1.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── toni.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tonilijic.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tonilijic.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── Spinner1 │ ├── .DS_Store │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json │ └── Spinner1App.swift └── Volume Control ├── .DS_Store ├── Volume Control.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── toni.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── tonilijic.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── toni.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── tonilijic.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── Volume Control ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json └── Particle Sprite Atlas.spriteatlas │ ├── Contents.json │ ├── bokeh.imageset │ ├── Contents.json │ └── bokeh.png │ └── spark.imageset │ ├── Contents.json │ └── spark.png ├── ContentView.swift ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json ├── Spark.sks └── Volume_ControlApp.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/.DS_Store -------------------------------------------------------------------------------- /Animated Tab Icons/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Animated Tab Icons/.DS_Store -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Animated Tab Icons/Animated Tab Icons.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Animated Tab Icons/Animated Tab Icons.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons.xcodeproj/xcuserdata/toni.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Animated Tab Icons.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Animated Tab Icons.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Animated Tab Icons/Animated Tab Icons/.DS_Store -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/Animated_Tab_IconsApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Animated_Tab_IconsApp.swift 3 | // Animated Tab Icons 4 | // 5 | // Created by Toni on 10.11.2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct Animated_Tab_IconsApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Animated Tab Icons 4 | // 5 | // Created by Toni on 10.11.2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | var body: some View { 12 | Home() 13 | 14 | } 15 | } 16 | 17 | #Preview { 18 | ContentView() 19 | } 20 | 21 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/Home.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Home.swift 3 | // Animated Tab Icons 4 | // 5 | // Created by Toni on 11.11.2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct Home: View { 11 | 12 | 13 | @State private var activeTab: Tab = .settings 14 | 15 | @State private var allTabs: [AnimatedTab] = Tab.allCases.compactMap { tab -> AnimatedTab? in return .init(tab:tab) 16 | } 17 | var body: some View { 18 | VStack(spacing: 0) { 19 | TabView(selection: $activeTab) { 20 | 21 | //my TabView 22 | 23 | NavigationStack { 24 | VStack { 25 | 26 | 27 | } 28 | .navigationTitle(Tab.settings.title) 29 | 30 | } 31 | .setUpTab(.settings) 32 | 33 | NavigationStack { 34 | VStack { 35 | 36 | 37 | } 38 | .navigationTitle(Tab.chat.title) 39 | 40 | } 41 | .setUpTab(.chat) 42 | 43 | 44 | 45 | NavigationStack { 46 | VStack { 47 | 48 | 49 | } 50 | .navigationTitle(Tab.apps.title) 51 | 52 | } 53 | .setUpTab(.apps) 54 | 55 | 56 | 57 | NavigationStack { 58 | VStack { 59 | 60 | 61 | } 62 | .navigationTitle(Tab.profile.title) 63 | 64 | } 65 | .setUpTab(.profile) 66 | 67 | 68 | } 69 | 70 | 71 | 72 | CustomTabBar() 73 | 74 | } 75 | } 76 | 77 | //custom tab view 78 | @ViewBuilder 79 | func CustomTabBar() -> some View { 80 | HStack(spacing:0) { 81 | ForEach($allTabs) { $animatedTab in 82 | let atab = animatedTab.tab 83 | 84 | VStack(spacing:4){ 85 | Image(systemName: atab.rawValue) 86 | .font(.title2) 87 | .symbolEffect(.bounce.up.byLayer, value: animatedTab.isAnimating) 88 | 89 | Text(atab.title) 90 | .font(.caption2) 91 | .textScale(.secondary) 92 | } 93 | 94 | .frame(maxWidth: .infinity) 95 | .foregroundStyle(activeTab == atab ? Color.primary : Color.gray) 96 | .padding(.top, 16) 97 | .contentShape(.rect) 98 | .onTapGesture { 99 | withAnimation(.default, completionCriteria: .logicallyComplete, { 100 | activeTab = atab 101 | animatedTab.isAnimating = true 102 | }, completion: { 103 | 104 | var transaction = Transaction() 105 | transaction.disablesAnimations = true 106 | withTransaction(transaction) { 107 | animatedTab.isAnimating = nil 108 | }//to reset animation and avoid two times playing 109 | }) 110 | 111 | } 112 | 113 | } 114 | } 115 | .background(.bar) 116 | } 117 | 118 | 119 | } 120 | 121 | #Preview { 122 | ContentView() 123 | } 124 | 125 | extension View { 126 | @ViewBuilder 127 | func setUpTab(_ tab: Tab) -> some View { 128 | self 129 | .frame(maxWidth: .infinity, maxHeight: .infinity) 130 | .tag(tab) 131 | .toolbar(.hidden, for: .tabBar) 132 | 133 | 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Animated Tab Icons/Animated Tab Icons/Tab.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tab.swift 3 | // Animated Tab Icons 4 | // 5 | // Created by Toni on 11.11.2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | //Tabs 11 | 12 | enum Tab: String, CaseIterable { 13 | case settings = "gear" 14 | case chat = "bubble.left.and.text.bubble.right" 15 | case apps = "square.3.layers.3d" 16 | case profile = "person.crop.circle" 17 | 18 | var title: String { 19 | switch self { 20 | case .settings: 21 | return "Settings" 22 | case .chat: 23 | return "Chat" 24 | case .apps: 25 | return "Apps" 26 | case .profile: 27 | return "Profile" 28 | 29 | 30 | } 31 | } 32 | } 33 | 34 | //Animated SF Tab 35 | 36 | struct AnimatedTab: Identifiable { 37 | var id: UUID = .init() 38 | var tab: Tab 39 | var isAnimating: Bool? 40 | } 41 | 42 | -------------------------------------------------------------------------------- /AppJiggling/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/.DS_Store -------------------------------------------------------------------------------- /AppJiggling/AppJiggling.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AppJiggling/AppJiggling.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AppJiggling.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/App.swift: -------------------------------------------------------------------------------- 1 | // 2 | // App.swift 3 | // AppJiggling 4 | // 5 | // Created by Toni on 18.04.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | 11 | 12 | struct Apps: View { 13 | 14 | //variables 15 | @Binding var apps: [String] 16 | @Binding var isEditMode: Bool 17 | @Binding var shakingDegrees: Double 18 | @Binding var isWiggling: Bool 19 | @Binding var dockDelay: Double 20 | 21 | 22 | @State private var feedbackTriggered = false 23 | @State private var isDeleted = false 24 | @State private var scale = 1.0 25 | @State private var isSelected = false 26 | 27 | 28 | let appNames: [String] 29 | let feedbackGenerator = UIImpactFeedbackGenerator(style: .medium) 30 | 31 | //for detecting color schemes 32 | @Environment(\.colorScheme) var colorScheme 33 | 34 | 35 | var body: some View { 36 | 37 | GeometryReader { geometry in 38 | 39 | ForEach(appNames, id: \.self) { appName in 40 | 41 | 42 | ZStack { 43 | 44 | Image(appName) 45 | .resizable() 46 | .aspectRatio(contentMode: .fit) 47 | .frame(width: geometry.size.width, height: geometry.size.height) 48 | .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous)) 49 | .scaleEffect(scale) 50 | .position(x: geometry.size.width / 2, y: geometry.size.height / 2) 51 | 52 | 53 | //minus sign 54 | 55 | if isEditMode { 56 | Image(systemName: "minus.circle.fill") 57 | .symbolRenderingMode(.palette) 58 | .foregroundStyle(.black, Color(colorScheme == .dark ? .systemGray : .systemGray5)) 59 | .font(.system(size: 24)) 60 | .foregroundStyle(Color(.systemGray)) 61 | .offset(x: -28, y: -28) 62 | .transition(.asymmetric( 63 | insertion: .scale(scale: 0, anchor: .init(x: -0.5, y: -0.5)), 64 | removal: .scale(scale: 1, anchor: .init(x: -0.5, y: -0.5)) 65 | )) 66 | .onTapGesture { 67 | 68 | dockDelay = 0.3 69 | 70 | withAnimation(.easeInOut(duration: 0.3).delay(0.08)){ 71 | 72 | remove(appName: appName) 73 | 74 | } 75 | } 76 | } 77 | 78 | 79 | //notifications indicator 80 | 81 | 82 | if (appName == "messages" || appName == "Phone" ) && !isEditMode { 83 | 84 | Text(appName == "messages" ? "1" : "32") 85 | .foregroundStyle(.white) 86 | .padding(.horizontal, 8) 87 | .background( 88 | Capsule() 89 | .fill(.red) 90 | .frame(height: 24) 91 | ) 92 | .offset(x: 28, y: -28) 93 | .scaleEffect(scale) 94 | .transition(.asymmetric( 95 | insertion: .scale(scale: 0, anchor: .init(x: 1.5, y: -0.5)), 96 | removal: .scale(scale: 1, anchor: .init(x: 1.5, y: -0.5)) 97 | )) 98 | } 99 | } 100 | } 101 | 102 | 103 | //edit mode ON -> icons started jiggling 104 | .onTapGesture { 105 | //to unblock scrollView 106 | 107 | } 108 | 109 | 110 | //selection 111 | .onLongPressGesture(minimumDuration: 0.3) { 112 | 113 | 114 | if !isEditMode { 115 | //shaking restart 116 | if shakingDegrees >= 4 { 117 | shakingDegrees = shakingDegrees - 4 118 | } 119 | 120 | 121 | withAnimation(.spring(response: 0.5, dampingFraction: 1)) { 122 | scale = isEditMode ? 1 : 1.1 123 | feedbackGenerator.impactOccurred() 124 | } 125 | 126 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) { 127 | 128 | withAnimation(.default) { 129 | isEditMode = true 130 | feedbackGenerator.impactOccurred() 131 | scale = 1 132 | 133 | } 134 | 135 | 136 | updateShakingDegrees(isEditMode: isEditMode) 137 | 138 | 139 | } 140 | } 141 | } 142 | 143 | } 144 | 145 | .frame(width: 60, height: 60) 146 | } 147 | 148 | 149 | //functions 150 | func updateShakingDegrees(isEditMode: Bool) { 151 | 152 | 153 | if isEditMode { 154 | shakingDegrees += 4 155 | isWiggling = true 156 | } 157 | 158 | 159 | if !isEditMode { 160 | shakingDegrees = shakingDegrees 161 | isWiggling = false 162 | } 163 | 164 | } 165 | 166 | 167 | func remove(appName: String) { 168 | if let index = apps.firstIndex(of: appName) { 169 | apps.remove(at: index) 170 | } 171 | } 172 | 173 | } 174 | 175 | 176 | #Preview { 177 | ContentView() 178 | } 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/AppJiggling.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/AppJigglingApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppJigglingApp.swift 3 | // AppJiggling 4 | // 5 | // Created by Toni on 18.04.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct AppJigglingApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/.DS_Store -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "dock.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | }, 9 | { 10 | "idiom" : "mac", 11 | "scale" : "1x", 12 | "size" : "16x16" 13 | }, 14 | { 15 | "idiom" : "mac", 16 | "scale" : "2x", 17 | "size" : "16x16" 18 | }, 19 | { 20 | "idiom" : "mac", 21 | "scale" : "1x", 22 | "size" : "32x32" 23 | }, 24 | { 25 | "idiom" : "mac", 26 | "scale" : "2x", 27 | "size" : "32x32" 28 | }, 29 | { 30 | "idiom" : "mac", 31 | "scale" : "1x", 32 | "size" : "128x128" 33 | }, 34 | { 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "idiom" : "mac", 41 | "scale" : "1x", 42 | "size" : "256x256" 43 | }, 44 | { 45 | "idiom" : "mac", 46 | "scale" : "2x", 47 | "size" : "256x256" 48 | }, 49 | { 50 | "idiom" : "mac", 51 | "scale" : "1x", 52 | "size" : "512x512" 53 | }, 54 | { 55 | "idiom" : "mac", 56 | "scale" : "2x", 57 | "size" : "512x512" 58 | } 59 | ], 60 | "info" : { 61 | "author" : "xcode", 62 | "version" : 1 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/AppIcon.appiconset/dock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/AppIcon.appiconset/dock.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Phone.imageset/App Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/Phone.imageset/App Icon.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Phone.imageset/App Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/Phone.imageset/App Icon@2x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Phone.imageset/App Icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/Phone.imageset/App Icon@3x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Phone.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "App Icon.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "App Icon@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "App Icon@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Safari.imageset/App Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/Safari.imageset/App Icon.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Safari.imageset/App Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/Safari.imageset/App Icon@2x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Safari.imageset/App Icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/Safari.imageset/App Icon@3x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/Safari.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "App Icon.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "App Icon@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "App Icon@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/arc.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Group.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "Group@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "Group@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/arc.imageset/Group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/arc.imageset/Group.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/arc.imageset/Group@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/arc.imageset/Group@2x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/arc.imageset/Group@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/arc.imageset/Group@3x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/camera.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "camera.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "camera-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "camera-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/camera.imageset/camera-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/camera.imageset/camera-1.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/camera.imageset/camera-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/camera.imageset/camera-2.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/camera.imageset/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/camera.imageset/camera.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/fantastical.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "fantastical.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "fantastical-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "fantastical-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/fantastical.imageset/fantastical-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/fantastical.imageset/fantastical-1.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/fantastical.imageset/fantastical-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/fantastical.imageset/fantastical-2.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/fantastical.imageset/fantastical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/fantastical.imageset/fantastical.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/github.imageset/4a8ad92b27803f0aa7acd8fa29e25bd0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/github.imageset/4a8ad92b27803f0aa7acd8fa29e25bd0.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/github.imageset/4a8ad92b27803f0aa7acd8fa29e25bd0@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/github.imageset/4a8ad92b27803f0aa7acd8fa29e25bd0@2x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/github.imageset/4a8ad92b27803f0aa7acd8fa29e25bd0@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/github.imageset/4a8ad92b27803f0aa7acd8fa29e25bd0@3x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/github.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "4a8ad92b27803f0aa7acd8fa29e25bd0.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "4a8ad92b27803f0aa7acd8fa29e25bd0@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "4a8ad92b27803f0aa7acd8fa29e25bd0@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/ia.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ia.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ia-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ia-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/ia.imageset/ia-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/ia.imageset/ia-1.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/ia.imageset/ia-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/ia.imageset/ia-2.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/ia.imageset/ia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/ia.imageset/ia.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/maps.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "maps.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "maps-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "maps-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/maps.imageset/maps-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/maps.imageset/maps-1.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/maps.imageset/maps-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/maps.imageset/maps-2.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/maps.imageset/maps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/maps.imageset/maps.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/messages.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "messages.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "messages-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "messages-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/messages.imageset/messages-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/messages.imageset/messages-1.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/messages.imageset/messages-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/messages.imageset/messages-2.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/messages.imageset/messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/messages.imageset/messages.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/onepass.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Group 2.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "Group 2@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "Group 2@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/onepass.imageset/Group 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/onepass.imageset/Group 2.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/onepass.imageset/Group 2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/onepass.imageset/Group 2@2x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/onepass.imageset/Group 2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/onepass.imageset/Group 2@3x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/perplexity.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "unnamed.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "unnamed@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "unnamed@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/perplexity.imageset/unnamed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/perplexity.imageset/unnamed.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/perplexity.imageset/unnamed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/perplexity.imageset/unnamed@2x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/perplexity.imageset/unnamed@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/perplexity.imageset/unnamed@3x.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/photos.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "photos.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "photos-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "photos-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/photos.imageset/photos-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/photos.imageset/photos-1.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/photos.imageset/photos-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/photos.imageset/photos-2.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/photos.imageset/photos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/photos.imageset/photos.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/things.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "things.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "things-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "things-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/things.imageset/things-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/things.imageset/things-1.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/things.imageset/things-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/things.imageset/things-2.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/things.imageset/things.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/things.imageset/things.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/wallpaper.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "iPhone 15 Pro White Wallpaper 5 YTECHB.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Assets.xcassets/wallpaper.imageset/iPhone 15 Pro White Wallpaper 5 YTECHB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppJiggling/AppJiggling/Assets.xcassets/wallpaper.imageset/iPhone 15 Pro White Wallpaper 5 YTECHB.png -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // AppJiggling 4 | // 5 | // Created by Toni on 18.04.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | 12 | 13 | @State private var isEditMode = false 14 | 15 | 16 | var body: some View { 17 | 18 | ZStack { 19 | 20 | VStack { 21 | 22 | Spacer() 23 | 24 | HDock(isEditMode: $isEditMode) 25 | 26 | } 27 | 28 | .padding(.bottom, 13.5) 29 | 30 | } 31 | 32 | .background( 33 | // 34 | Color.black 35 | 36 | ) 37 | .frame(height: .infinity) 38 | .ignoresSafeArea() 39 | .onTapGesture { withAnimation(.snappy){ isEditMode = false } 40 | 41 | } 42 | } 43 | } 44 | 45 | #Preview { 46 | ContentView() 47 | .preferredColorScheme(/*@START_MENU_TOKEN@*/.dark/*@END_MENU_TOKEN@*/) 48 | } 49 | -------------------------------------------------------------------------------- /AppJiggling/AppJiggling/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /AppleTVLoader/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppleTVLoader/.DS_Store -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppleTVLoader/AppleTVLoader.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppleTVLoader/AppleTVLoader.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AppleTVLoader.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AppleTVLoader.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/AppleTVLoader/AppleTVLoader/.DS_Store -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader/AppleTVLoaderApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppleTVLoaderApp.swift 3 | // AppleTVLoader 4 | // 5 | // Created by Toni on 22.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct AppleTVLoaderApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader/Icons.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Icons.swift 3 | // AppleTVLoader 4 | // 5 | // Created by Toni on 22.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | //Tabs 11 | 12 | enum Tab: String, CaseIterable { 13 | case vstack = "square.3.layers.3d" 14 | case hstack = "square.stack.3d.forward.dottedline" 15 | case circle = "circle.hexagonpath" 16 | 17 | 18 | 19 | } 20 | 21 | //Animated SF Tab 22 | 23 | struct AnimatedTab: Identifiable { 24 | var id: UUID = .init() 25 | var tab: Tab 26 | var isAnimating: Bool? 27 | } 28 | -------------------------------------------------------------------------------- /AppleTVLoader/AppleTVLoader/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ArcDragInteraction/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ArcDragInteraction/.DS_Store -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ArcDragInteraction/ArcDragInteraction.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ArcDragInteraction.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ArcDragInteraction/ArcDragInteraction/.DS_Store -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/ArcDragInteraction.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/ArcDragInteractionApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArcDragInteractionApp.swift 3 | // ArcDragInteraction 4 | // 5 | // Created by Toni on 04.02.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct ArcDragInteractionApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Assets.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ArcDragInteraction/ArcDragInteraction/Assets.xcassets/.DS_Store -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "1x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "2x", 16 | "size" : "16x16" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "1x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "2x", 26 | "size" : "32x32" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "2x", 36 | "size" : "128x128" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "1x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "2x", 46 | "size" : "256x256" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "1x", 51 | "size" : "512x512" 52 | }, 53 | { 54 | "idiom" : "mac", 55 | "scale" : "2x", 56 | "size" : "512x512" 57 | } 58 | ], 59 | "info" : { 60 | "author" : "xcode", 61 | "version" : 1 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Assets.xcassets/Icon3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon3.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Assets.xcassets/Icon3.imageset/icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ArcDragInteraction/ArcDragInteraction/Assets.xcassets/Icon3.imageset/icon3.png -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Assets.xcassets/pic.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "pfp-twitter brown copy.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Assets.xcassets/pic.imageset/pfp-twitter brown copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ArcDragInteraction/ArcDragInteraction/Assets.xcassets/pic.imageset/pfp-twitter brown copy.png -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteraction/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteractionTests/ArcDragInteractionTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArcDragInteractionTests.swift 3 | // ArcDragInteractionTests 4 | // 5 | // Created by Toni on 04.02.2024. 6 | // 7 | 8 | import XCTest 9 | 10 | final class ArcDragInteractionTests: XCTestCase { 11 | 12 | override func setUpWithError() throws { 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | } 15 | 16 | override func tearDownWithError() throws { 17 | // Put teardown code here. This method is called after the invocation of each test method in the class. 18 | } 19 | 20 | func testExample() throws { 21 | // This is an example of a functional test case. 22 | // Use XCTAssert and related functions to verify your tests produce the correct results. 23 | // Any test you write for XCTest can be annotated as throws and async. 24 | // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. 25 | // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. 26 | } 27 | 28 | func testPerformanceExample() throws { 29 | // This is an example of a performance test case. 30 | measure { 31 | // Put the code you want to measure the time of here. 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteractionUITests/ArcDragInteractionUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArcDragInteractionUITests.swift 3 | // ArcDragInteractionUITests 4 | // 5 | // Created by Toni on 04.02.2024. 6 | // 7 | 8 | import XCTest 9 | 10 | final class ArcDragInteractionUITests: XCTestCase { 11 | 12 | override func setUpWithError() throws { 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | 15 | // In UI tests it is usually best to stop immediately when a failure occurs. 16 | continueAfterFailure = false 17 | 18 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 19 | } 20 | 21 | override func tearDownWithError() throws { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | func testExample() throws { 26 | // UI tests must launch the application that they test. 27 | let app = XCUIApplication() 28 | app.launch() 29 | 30 | // Use XCTAssert and related functions to verify your tests produce the correct results. 31 | } 32 | 33 | func testLaunchPerformance() throws { 34 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { 35 | // This measures how long it takes to launch your application. 36 | measure(metrics: [XCTApplicationLaunchMetric()]) { 37 | XCUIApplication().launch() 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ArcDragInteraction/ArcDragInteractionUITests/ArcDragInteractionUITestsLaunchTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArcDragInteractionUITestsLaunchTests.swift 3 | // ArcDragInteractionUITests 4 | // 5 | // Created by Toni on 04.02.2024. 6 | // 7 | 8 | import XCTest 9 | 10 | final class ArcDragInteractionUITestsLaunchTests: XCTestCase { 11 | 12 | override class var runsForEachTargetApplicationUIConfiguration: Bool { 13 | true 14 | } 15 | 16 | override func setUpWithError() throws { 17 | continueAfterFailure = false 18 | } 19 | 20 | func testLaunch() throws { 21 | let app = XCUIApplication() 22 | app.launch() 23 | 24 | // Insert steps here to perform after app launch but before taking a screenshot, 25 | // such as logging into a test account or navigating somewhere in the app 26 | 27 | let attachment = XCTAttachment(screenshot: app.screenshot()) 28 | attachment.name = "Launch Screen" 29 | attachment.lifetime = .keepAlways 30 | add(attachment) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Button Styles/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Button Styles/.DS_Store -------------------------------------------------------------------------------- /Button Styles/Button Styles.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Button Styles/Button Styles.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Button Styles/Button Styles.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Button Styles/Button Styles.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Button Styles/Button Styles.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Button Styles.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Button Styles/Button Styles/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Button Styles/Button Styles/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "appearances" : [ 10 | { 11 | "appearance" : "luminosity", 12 | "value" : "dark" 13 | } 14 | ], 15 | "idiom" : "universal", 16 | "platform" : "ios", 17 | "size" : "1024x1024" 18 | }, 19 | { 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "tinted" 24 | } 25 | ], 26 | "idiom" : "universal", 27 | "platform" : "ios", 28 | "size" : "1024x1024" 29 | }, 30 | { 31 | "idiom" : "mac", 32 | "scale" : "1x", 33 | "size" : "16x16" 34 | }, 35 | { 36 | "idiom" : "mac", 37 | "scale" : "2x", 38 | "size" : "16x16" 39 | }, 40 | { 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "32x32" 44 | }, 45 | { 46 | "idiom" : "mac", 47 | "scale" : "2x", 48 | "size" : "32x32" 49 | }, 50 | { 51 | "idiom" : "mac", 52 | "scale" : "1x", 53 | "size" : "128x128" 54 | }, 55 | { 56 | "idiom" : "mac", 57 | "scale" : "2x", 58 | "size" : "128x128" 59 | }, 60 | { 61 | "idiom" : "mac", 62 | "scale" : "1x", 63 | "size" : "256x256" 64 | }, 65 | { 66 | "idiom" : "mac", 67 | "scale" : "2x", 68 | "size" : "256x256" 69 | }, 70 | { 71 | "idiom" : "mac", 72 | "scale" : "1x", 73 | "size" : "512x512" 74 | }, 75 | { 76 | "idiom" : "mac", 77 | "scale" : "2x", 78 | "size" : "512x512" 79 | } 80 | ], 81 | "info" : { 82 | "author" : "xcode", 83 | "version" : 1 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Button Styles/Button Styles/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Button Styles/Button Styles/Assets.xcassets/DarkBlue.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.875", 9 | "green" : "0.384", 10 | "red" : "0.094" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Button Styles/Button Styles/Button_Styles.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Button Styles/Button Styles/Button_StylesApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Button_StylesApp.swift 3 | // Button Styles 4 | // 5 | // Created by Toni on 19.08.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct Button_StylesApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Button Styles/Button Styles/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // 4 | // Created by Toni on 13.12.2023. 5 | // 6 | 7 | import SwiftUI 8 | 9 | struct ContentView: View { 10 | 11 | @State private var is2024: Bool = false 12 | 13 | 14 | var body: some View { 15 | 16 | VStack{ 17 | 18 | Spacer() 19 | 20 | Picker("", selection: $is2024){ 21 | Text("2023") 22 | .tag(false) 23 | 24 | Text("2024") 25 | .tag(true) 26 | } 27 | .pickerStyle(.segmented) 28 | .padding(.horizontal,100) 29 | 30 | 31 | Spacer() 32 | 33 | 34 | VStack { 35 | 36 | Button("Manage"){ 37 | 38 | } 39 | .padding(.horizontal, 32) 40 | .padding(.vertical, 16) 41 | .foregroundColor(.white) 42 | .font(.title3) 43 | .fontWeight(.medium) 44 | .background(.blue) 45 | .clipShape(RoundedRectangle(cornerRadius: 12)) 46 | .overlay{ 47 | RoundedRectangle(cornerRadius: 12) 48 | .inset(by: 2) 49 | .stroke( 50 | LinearGradient( 51 | gradient: Gradient(colors: [.white.opacity(0.3), .clear]), 52 | startPoint: UnitPoint(x: 0.5, y: 0), 53 | endPoint: UnitPoint(x: 0.5, y: 0.5) 54 | ), lineWidth: is2024 ? 2 : 0 55 | ) 56 | } 57 | .overlay{ 58 | RoundedRectangle(cornerRadius: 12) 59 | .stroke( 60 | LinearGradient( 61 | gradient: Gradient(colors: is2024 ? [Color("DarkBlue"), .blue] : [.blue, .blue]), 62 | startPoint: UnitPoint(x: 0.5, y: 0), 63 | endPoint: UnitPoint(x: 0.5, y: 0.5) 64 | ), lineWidth: is2024 ? 2 : 0 65 | ) 66 | 67 | } 68 | .padding(.vertical, 20) 69 | 70 | Button("Manage"){ 71 | 72 | } 73 | .padding(.horizontal, 32) 74 | .padding(.vertical, 16) 75 | .foregroundColor(.black) 76 | .font(.title3) 77 | .fontWeight(.medium) 78 | .background(is2024 ? .gray.opacity(0.08) : .gray.opacity(0.12)) 79 | .clipShape(RoundedRectangle(cornerRadius: 12)) 80 | .overlay{ 81 | RoundedRectangle(cornerRadius: 12) 82 | .inset(by: 2) 83 | .stroke( 84 | LinearGradient( 85 | gradient: Gradient(colors: [.white, .clear]), 86 | startPoint: UnitPoint(x: 0.5, y: 0), 87 | endPoint: UnitPoint(x: 0.5, y: 0.5) 88 | ), lineWidth: is2024 ? 2 : 0 89 | ) 90 | } 91 | .overlay{ 92 | RoundedRectangle(cornerRadius: 12) 93 | .stroke(.gray.opacity(0.2), lineWidth: is2024 ? 2 : 0 94 | ) 95 | 96 | } 97 | 98 | 99 | } 100 | .animation(.default, value: is2024) 101 | Spacer() 102 | Spacer() 103 | 104 | } 105 | .padding() 106 | } 107 | } 108 | 109 | #Preview { 110 | ContentView() 111 | } 112 | -------------------------------------------------------------------------------- /Button Styles/Button Styles/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Button Styles/Button StylesTests/Button_StylesTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Button_StylesTests.swift 3 | // Button StylesTests 4 | // 5 | // Created by Toni on 19.08.2024. 6 | // 7 | 8 | import Testing 9 | 10 | struct Button_StylesTests { 11 | 12 | @Test func testExample() async throws { 13 | // Write your test here and use APIs like `#expect(...)` to check expected conditions. 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Button Styles/Button StylesUITests/Button_StylesUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Button_StylesUITests.swift 3 | // Button StylesUITests 4 | // 5 | // Created by Toni on 19.08.2024. 6 | // 7 | 8 | import XCTest 9 | 10 | final class Button_StylesUITests: XCTestCase { 11 | 12 | override func setUpWithError() throws { 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | 15 | // In UI tests it is usually best to stop immediately when a failure occurs. 16 | continueAfterFailure = false 17 | 18 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 19 | } 20 | 21 | override func tearDownWithError() throws { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | @MainActor 26 | func testExample() throws { 27 | // UI tests must launch the application that they test. 28 | let app = XCUIApplication() 29 | app.launch() 30 | 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | @MainActor 35 | func testLaunchPerformance() throws { 36 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { 37 | // This measures how long it takes to launch your application. 38 | measure(metrics: [XCTApplicationLaunchMetric()]) { 39 | XCUIApplication().launch() 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Button Styles/Button StylesUITests/Button_StylesUITestsLaunchTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Button_StylesUITestsLaunchTests.swift 3 | // Button StylesUITests 4 | // 5 | // Created by Toni on 19.08.2024. 6 | // 7 | 8 | import XCTest 9 | 10 | final class Button_StylesUITestsLaunchTests: XCTestCase { 11 | 12 | override class var runsForEachTargetApplicationUIConfiguration: Bool { 13 | true 14 | } 15 | 16 | override func setUpWithError() throws { 17 | continueAfterFailure = false 18 | } 19 | 20 | @MainActor 21 | func testLaunch() throws { 22 | let app = XCUIApplication() 23 | app.launch() 24 | 25 | // Insert steps here to perform after app launch but before taking a screenshot, 26 | // such as logging into a test account or navigating somewhere in the app 27 | 28 | let attachment = XCTAttachment(screenshot: app.screenshot()) 29 | attachment.name = "Launch Screen" 30 | attachment.lifetime = .keepAlways 31 | add(attachment) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Button animation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Button animation/.DS_Store -------------------------------------------------------------------------------- /Button animation/Button animation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Button animation/Button animation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Button animation/Button animation.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Button animation/Button animation.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Button animation/Button animation.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Button animation/Button animation.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Button animation/Button animation.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Button animation.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Button animation/Button animation.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Button animation.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Button animation/Button animation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Button animation/Button animation/.DS_Store -------------------------------------------------------------------------------- /Button animation/Button animation/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "1x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "2x", 16 | "size" : "16x16" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "1x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "2x", 26 | "size" : "32x32" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "2x", 36 | "size" : "128x128" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "1x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "2x", 46 | "size" : "256x256" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "1x", 51 | "size" : "512x512" 52 | }, 53 | { 54 | "idiom" : "mac", 55 | "scale" : "2x", 56 | "size" : "512x512" 57 | } 58 | ], 59 | "info" : { 60 | "author" : "xcode", 61 | "version" : 1 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Button animation/Button animation/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Button animation/Button animation/Assets.xcassets/toni.grey.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.921", 9 | "green" : "0.921", 10 | "red" : "0.921" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | }, 20 | "properties" : { 21 | "localizable" : true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Button animation/Button animation/Button_animation.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Button animation/Button animation/Button_animationApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Button_animationApp.swift 3 | // Button animation 4 | // 5 | // Created by Toni on 13.08.23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct Button_animationApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Button animation/Button animation/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Button animation 4 | // 5 | // Created by Toni on 13.08.23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | 11 | 12 | 13 | struct ContentView: View { 14 | 15 | @State private var isPressed = false 16 | @State private var isTapped = false 17 | @State private var greenbutton = false 18 | 19 | 20 | 21 | func toggleTwice() { 22 | isTapped.toggle() 23 | 24 | if isTapped == true { 25 | 26 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { 27 | isTapped.toggle() 28 | 29 | } 30 | } 31 | isPressed = false 32 | 33 | } 34 | 35 | 36 | var body: some View { 37 | 38 | 39 | ZStack{ 40 | Color("toni.grey").ignoresSafeArea() 41 | 42 | Circle() 43 | .stroke(lineWidth: greenbutton ? 4 : 0) 44 | .frame(width: greenbutton ? 500 : 0, height: greenbutton ? 500 : 0) 45 | .foregroundColor(.black) 46 | .blur(radius: greenbutton ? 4 : 10) 47 | .opacity(greenbutton ? 0 : 1) 48 | 49 | 50 | Text("Button") 51 | .font(.system(size: 24, weight: .semibold, design: .rounded)) 52 | .padding(.vertical, 20).padding(.horizontal,greenbutton ? 0 : 60) 53 | .background(greenbutton ? .black : .white) 54 | .foregroundColor(greenbutton ? Color.clear : .primary) 55 | .clipShape(RoundedRectangle(cornerRadius: greenbutton ? 100 : 16, style: .continuous)) 56 | .shadow( 57 | color: isPressed ? .black.opacity(0.6) : .black.opacity(0.2), 58 | radius: isTapped ? 5 : (greenbutton ? 8 : 10), 59 | x: greenbutton ? 0 : (isTapped ? 0 : (isPressed ? 0 : 20)), 60 | y: greenbutton ? 0 : (isTapped ? 0 : (isPressed ? 0 : 20)) 61 | 62 | ) 63 | .opacity(greenbutton ? 0 : 1) 64 | .scaleEffect(greenbutton ? 0 : (isTapped ? 0.9 : 1)) 65 | .gesture( 66 | DragGesture(minimumDistance: 0) 67 | .onChanged { _ in 68 | if isPressed == true { 69 | isPressed = false 70 | } 71 | 72 | isTapped = true 73 | DispatchQueue.main.asyncAfter(deadline: .now() + 1) { 74 | 75 | if isTapped == true { 76 | isPressed = true 77 | DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { 78 | greenbutton = true 79 | } 80 | 81 | } 82 | 83 | 84 | 85 | } 86 | 87 | } 88 | 89 | 90 | 91 | .onEnded { _ in 92 | 93 | if isPressed == false { 94 | isTapped = false 95 | } 96 | 97 | 98 | } 99 | ) 100 | 101 | 102 | 103 | 104 | } 105 | .animation(.spring(response: 0.5, dampingFraction: 0.5, blendDuration: 0), value: isTapped) 106 | .animation(.spring(response: 0.5, dampingFraction: 0.5, blendDuration: 0), value: isPressed) 107 | .animation(.spring(response: 0.5, dampingFraction: 0.5, blendDuration: 0), value: greenbutton) 108 | } 109 | } 110 | 111 | 112 | 113 | 114 | struct ContentView_Previews: PreviewProvider { 115 | static var previews: some View { 116 | ContentView() 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /Button animation/Button animation/File.swift: -------------------------------------------------------------------------------- 1 | //texh might invisible in dark mode 2 | 3 | import SwiftUI 4 | 5 | struct CorrectButton: View { 6 | @State var tap = false 7 | @State var press = false 8 | @State var alterState = false 9 | 10 | var body: some View { 11 | ZStack { 12 | Circle() 13 | .stroke(lineWidth: alterState ? 20 : 0) 14 | .frame(width: alterState ? 500 : 0, height: alterState ? 500 : 0) 15 | .foregroundColor(Color(#colorLiteral(red: 0.49200207, green: 1, blue: 0.4950069785, alpha: 1))) 16 | .blur(radius: alterState ? 5 : 20) 17 | .opacity(alterState ? 0 : 1) 18 | 19 | Text("correct") 20 | .font(.system(size: 20, weight: .semibold, design: .rounded)) 21 | .foregroundColor(alterState ? Color.clear : (tap ? Color(#colorLiteral(red: 0.4931054115, green: 0.6306983232, blue: 1, alpha: 1)) : Color(#colorLiteral(red: 0.4657435417, green: 0.5916289687, blue: 0.9575648904, alpha: 0.8119689388)))) 22 | .frame(width: 200, height: alterState ? 200 : 60) 23 | 24 | .background( 25 | ZStack { 26 | Color(#colorLiteral(red: 0.7608050108, green: 0.8164883852, blue: 0.9259157777, alpha: 1)) 27 | RoundedRectangle(cornerRadius: alterState ? 100 : 16, style: .continuous) 28 | .foregroundColor(.white) 29 | .blur(radius: 3) 30 | .offset(x: -2, y: -2) 31 | RoundedRectangle(cornerRadius: alterState ? 100 : 16, style: .continuous) 32 | .fill(alterState ? LinearGradient(gradient: Gradient(colors: [Color(#colorLiteral(red: 0.7411747575, green: 0.9638548493, blue: 1, alpha: 1)), Color(#colorLiteral(red: 0.49200207, green: 1, blue: 0.4950069785, alpha: 1))]), startPoint: .topLeading, endPoint: .bottomTrailing) : LinearGradient(gradient: Gradient(colors: [Color(#colorLiteral(red: 0.9194613099, green: 0.941408515, blue: 1, alpha: 0.75)), Color.white]), startPoint: tap ? .top : .topTrailing, endPoint: tap ? .bottom : .bottomLeading)) 33 | .padding(2) 34 | .blur(radius: 3) 35 | .offset(x: 3, y: 3) 36 | } 37 | ) 38 | .clipShape(RoundedRectangle(cornerRadius: alterState ? 100 : 16, style: .continuous)) 39 | .shadow(color: press ? Color(#colorLiteral(red: 0.4931054115, green: 0.6306983232, blue: 1, alpha: 1)) : Color.clear, radius: 9, x: 0, y: 0) 40 | .shadow(color: press ? Color.clear : (tap ? Color(#colorLiteral(red: 0.4132584929, green: 0.4436882138, blue: 0.5055162311, alpha: 0.7532925793)) : Color(#colorLiteral(red: 0.6476906538, green: 0.6953927875, blue: 0.7922747135, alpha: 0.5097243202))), radius: tap ? 5:10, x:tap ? 1:20, y:tap ? 1:20) 41 | .scaleEffect(alterState ? 0 : (tap ? 0.9 : 1)) 42 | .gesture( 43 | DragGesture(minimumDistance: 0) 44 | .onChanged { _ in 45 | if self.press == true { 46 | self.press = false 47 | } 48 | self.tap = true 49 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { 50 | if self.tap == true { 51 | self.press = true 52 | DispatchQueue.main.asyncAfter(deadline: .now() + 1){ 53 | self.alterState = true 54 | } 55 | } 56 | } 57 | } 58 | .onEnded { _ in 59 | if self.press == false { 60 | self.tap = false 61 | } 62 | } 63 | ) 64 | .opacity(alterState ? 0 : 0.9) 65 | } 66 | .animation(.spring(response: 0.5, dampingFraction: 0.5, blendDuration: 0)) 67 | .statusBar(hidden: true) 68 | } 69 | } 70 | 71 | struct CorrectButton_Previews: PreviewProvider { 72 | static var previews: some View { 73 | CorrectButton() 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /Button animation/Button animation/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ConfettiFidgets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/.DS_Store -------------------------------------------------------------------------------- /ConfettiFidgets/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Rectangle.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/Rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/Rectangle.png -------------------------------------------------------------------------------- /ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "spark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/spark.png -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ConfettiFidgets.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/.DS_Store -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/Assets.xcassets/.DS_Store -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "1x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "2x", 16 | "size" : "16x16" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "1x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "2x", 26 | "size" : "32x32" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "2x", 36 | "size" : "128x128" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "1x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "2x", 46 | "size" : "256x256" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "1x", 51 | "size" : "512x512" 52 | }, 53 | { 54 | "idiom" : "mac", 55 | "scale" : "2x", 56 | "size" : "512x512" 57 | } 58 | ], 59 | "info" : { 60 | "author" : "xcode", 61 | "version" : 1 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "bokeh.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/bokeh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/bokeh.png -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "spark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/spark.png -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/confetti.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Rectangle.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/confetti.imageset/Rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/Assets.xcassets/confetti.imageset/Rectangle.png -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/figma.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Image.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/figma.imageset/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/Assets.xcassets/figma.imageset/Image.png -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/sketch.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Image.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/sketch.imageset/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/Assets.xcassets/sketch.imageset/Image.png -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/xcode.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "xcode.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Assets.xcassets/xcode.imageset/xcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/Assets.xcassets/xcode.imageset/xcode.png -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Confetti.sks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/ConfettiFidgets/ConfettiFidgets/Confetti.sks -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/ConfettiFidgets.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/ConfettiFidgetsApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConfettiFidgetsApp.swift 3 | // ConfettiFidgets 4 | // 5 | // Created by Toni on 11.05.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct ConfettiFidgetsApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // ConfettiFidget 4 | // 5 | // Created by Toni on 02.05.2024. 6 | // 7 | 8 | import SwiftUI 9 | import SpriteKit 10 | 11 | struct ContentView: View { 12 | 13 | 14 | @State private var showIcons = false 15 | @State private var showCircle = false 16 | @State private var confetti = Confetti() 17 | @State private var backgroundColor: BackgroundColor = .sketch 18 | @State private var fidgetItems: [FidgetItem] = [ 19 | 20 | 21 | // Figma App Icon 22 | FidgetItem( 23 | image: "figma", 24 | delay: 0.0, 25 | rotationDegrees: .degrees(8), 26 | offset: CGSize(width: 80, height: -90), 27 | transitionOffset: CGSize(width: 60, height: -100), 28 | introRotation: .degrees(220), 29 | anchor: CGPoint(x: 80, y: 90) 30 | 31 | ), 32 | 33 | 34 | // Xcode App Icon 35 | FidgetItem( 36 | image: "xcode", 37 | delay: 0.05, 38 | rotationDegrees: .degrees(8), 39 | offset: CGSize(width: -85, height: 0), 40 | transitionOffset: CGSize(width: -80, height: 0), 41 | introRotation: .degrees(-220), 42 | anchor: CGPoint(x: -85, y: 0) 43 | 44 | ), 45 | 46 | // Sketch App Icon 47 | FidgetItem( 48 | image: "sketch", 49 | delay: 0.1, 50 | rotationDegrees: .degrees(-12), 51 | offset: CGSize(width: 60, height: 70), 52 | transitionOffset: CGSize(width: 80, height: 70), 53 | introRotation: .degrees(220), 54 | anchor: CGPoint(x: 60, y: -70) 55 | 56 | ) 57 | ] 58 | @State private var showSpriteView = false 59 | 60 | var body: some View { 61 | 62 | 63 | ZStack { 64 | 65 | 66 | 67 | 68 | VStack { 69 | 70 | Text("Confetti Playground") 71 | .offset(x:0, y: 120) 72 | .foregroundStyle(.gray) 73 | .font(.callout) 74 | 75 | Spacer() 76 | Spacer() 77 | } 78 | 79 | 80 | //background element 81 | if showCircle { 82 | Circle() 83 | .frame(width: 280) 84 | .foregroundStyle(backgroundColor.color.opacity(0.1)) 85 | .blur(radius: 14) 86 | .transition(.scale(scale: 0, anchor: .center)) 87 | 88 | } 89 | 90 | 91 | ZStack { 92 | 93 | ForEach($fidgetItems) { $fidgetItem in 94 | Fidget(fidgetItem: $fidgetItem, backgroundColor: $backgroundColor, showSpriteView: $showSpriteView, confetti: $confetti) 95 | .rotationEffect(showIcons ? fidgetItem.rotationDegrees : fidgetItem.introRotation) 96 | .offset(fidgetItem.offset) 97 | .zIndex(fidgetItem.zIndex) 98 | .scaleEffect(showIcons ? 1 : 0) 99 | .opacity(showIcons ? 1 : 0) 100 | } 101 | } 102 | 103 | 104 | .onAppear { 105 | 106 | // trigger for icon rotation 107 | withAnimation(.interpolatingSpring(stiffness: 30, damping: 60)) { 108 | showIcons = true 109 | } 110 | 111 | // display bg circle 112 | withAnimation(.easeIn(duration: 1).delay(0.4)) { 113 | showCircle = true 114 | } 115 | } 116 | 117 | if showSpriteView { 118 | withAnimation(.default) { 119 | SpriteView(scene: confetti, options: .allowsTransparency) 120 | .ignoresSafeArea() 121 | } 122 | } 123 | 124 | 125 | } 126 | .background(.white) 127 | .ignoresSafeArea() 128 | 129 | 130 | } 131 | } 132 | 133 | #Preview { 134 | ContentView() 135 | } 136 | 137 | 138 | 139 | // SK Scene 140 | 141 | class Confetti: SKScene, ObservableObject { 142 | 143 | @Published var positionConfetti: CGPoint { 144 | didSet { 145 | updateConfettiPoisition() 146 | } 147 | } 148 | 149 | var emitterNode: SKEmitterNode! 150 | 151 | 152 | init(positionConfetti: CGPoint = CGPoint(x: 0, y: 0)) { 153 | self.positionConfetti = positionConfetti 154 | super.init(size: UIScreen.main.bounds.size) 155 | 156 | sceneDidLoad() 157 | } 158 | 159 | required init?(coder aDecoder: NSCoder) { 160 | fatalError("init(coder:) has not been implemented") 161 | } 162 | 163 | override func sceneDidLoad() { 164 | 165 | anchorPoint = CGPoint(x: 0.5, y: 0.5) 166 | scaleMode = .resizeFill 167 | backgroundColor = .clear 168 | 169 | 170 | emitterNode = SKEmitterNode(fileNamed: "Confetti.sks")! 171 | emitterNode.particleColorSequence = nil 172 | emitterNode.particleColorBlendFactor = 1 173 | emitterNode.particleAlphaRange = 1 174 | emitterNode.particleColorRedRange = 10 175 | emitterNode.particleColorBlueRange = 10 176 | emitterNode.particleColorGreenRange = 10 177 | emitterNode.particleSize = CGSize(width: 40, height: 20) 178 | } 179 | 180 | 181 | func updateConfettiPoisition() { 182 | 183 | removeAllChildren() 184 | 185 | emitterNode.particlePosition = positionConfetti 186 | 187 | addChild(emitterNode) 188 | 189 | sceneDidLoad() 190 | 191 | } 192 | } 193 | 194 | 195 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/FidgetItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FidgetItem.swift 3 | // ConfettiFidget 4 | // 5 | // Created by Toni on 09.05.2024. 6 | // 7 | 8 | 9 | import SwiftUI 10 | 11 | 12 | struct FidgetItem: Identifiable { 13 | let id = UUID() 14 | let image: String 15 | let delay: Double 16 | let rotationDegrees: Angle 17 | let offset: CGSize 18 | let transitionOffset : CGSize 19 | var zIndex: Double = 0.0 20 | var introRotation : Angle 21 | var anchor: CGPoint 22 | } 23 | 24 | 25 | 26 | enum BackgroundColor { 27 | case sketch 28 | case xCode 29 | case figma 30 | 31 | var color: Color { 32 | switch self { 33 | 34 | case .sketch: 35 | return .orange 36 | 37 | case .xCode: 38 | return .blue 39 | 40 | case .figma: 41 | return .purple 42 | } 43 | } 44 | } 45 | 46 | 47 | -------------------------------------------------------------------------------- /ConfettiFidgets/ConfettiFidgets/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Gradient Mesh/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Gradient Mesh/.DS_Store -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Gradient Mesh/Gradient Mesh.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Gradient Mesh.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "appearances" : [ 10 | { 11 | "appearance" : "luminosity", 12 | "value" : "dark" 13 | } 14 | ], 15 | "idiom" : "universal", 16 | "platform" : "ios", 17 | "size" : "1024x1024" 18 | }, 19 | { 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "tinted" 24 | } 25 | ], 26 | "idiom" : "universal", 27 | "platform" : "ios", 28 | "size" : "1024x1024" 29 | }, 30 | { 31 | "idiom" : "mac", 32 | "scale" : "1x", 33 | "size" : "16x16" 34 | }, 35 | { 36 | "idiom" : "mac", 37 | "scale" : "2x", 38 | "size" : "16x16" 39 | }, 40 | { 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "32x32" 44 | }, 45 | { 46 | "idiom" : "mac", 47 | "scale" : "2x", 48 | "size" : "32x32" 49 | }, 50 | { 51 | "idiom" : "mac", 52 | "scale" : "1x", 53 | "size" : "128x128" 54 | }, 55 | { 56 | "idiom" : "mac", 57 | "scale" : "2x", 58 | "size" : "128x128" 59 | }, 60 | { 61 | "idiom" : "mac", 62 | "scale" : "1x", 63 | "size" : "256x256" 64 | }, 65 | { 66 | "idiom" : "mac", 67 | "scale" : "2x", 68 | "size" : "256x256" 69 | }, 70 | { 71 | "idiom" : "mac", 72 | "scale" : "1x", 73 | "size" : "512x512" 74 | }, 75 | { 76 | "idiom" : "mac", 77 | "scale" : "2x", 78 | "size" : "512x512" 79 | } 80 | ], 81 | "info" : { 82 | "author" : "xcode", 83 | "version" : 1 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Gradient Mesh 4 | // 5 | // Created by Toni on 11.06.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | 11 | struct ContentView: View { 12 | @State var t: Float = 0.0 13 | @State var timer: Timer? 14 | 15 | var body: some View { 16 | 17 | ZStack { 18 | 19 | 20 | 21 | MeshGradient(width: 3, 22 | height: 3, 23 | points: [ 24 | 25 | [0.0, 0.0],[0.5, 0.0],[1.0, 0.0], 26 | // [0.0, 0.5],[1.0, 0.5],[1.0, 0.5], 27 | // [0.0, 1.0],[0.5, 1.0],[1.0, 1.0], 28 | 29 | 30 | 31 | [sinInRange(-0.8...(-0.2), 0.439, 0.342, t), sinInRange(0.3...0.7, 3.42, 0.984, t)], 32 | [sinInRange(0.1...0.8, 0.239, 0.084, t), sinInRange(0.2...0.8, 5.21, 0.242, t)], 33 | [sinInRange(1.0...1.5, 0.939, 0.084, t), sinInRange(0.4...0.8, 0.25, 0.642, t)], 34 | 35 | [sinInRange(-0.8...0.0, 1.439, 0.442, t), sinInRange(1.4...1.9, 3.49, 0.942, t)], 36 | [sinInRange(0.3...0.6, 0.339, 0.784, t), sinInRange(1.0...1.2, 1.22, 0.772, t)], 37 | [sinInRange(1.0...1.5, 0.939, 0.056, t), sinInRange(1.3...1.7, 0.47, 0.342, t)] 38 | 39 | 40 | 41 | 42 | ], colors:[ 43 | .pink, .pink, .pink , 44 | .purple, .purple, .purple, 45 | .blue, .blue, .blue 46 | 47 | 48 | ], background: .blue) 49 | 50 | .ignoresSafeArea() 51 | 52 | // ZStack { 53 | // Rectangle() 54 | // .fill(.white) 55 | // .ignoresSafeArea() 56 | // 57 | // Text("Easy") 58 | // .font(.system(size: 120)) 59 | // .fontWeight(.heavy) 60 | // .blendMode(.destinationOut) 61 | // 62 | // } 63 | // .compositingGroup() 64 | } 65 | 66 | .onAppear { 67 | timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true, block: {_ in 68 | t += 0.02 69 | }) 70 | 71 | } 72 | } 73 | 74 | func sinInRange(_ range: ClosedRange, _ offset: Float, _ timeScale: Float, _ t: Float) -> Float { 75 | let amplitude = (range.upperBound - range.lowerBound) / 2 76 | let midPoint = (range.upperBound + range.lowerBound) / 2 77 | return midPoint + amplitude * sin(timeScale * t + offset) 78 | 79 | } 80 | } 81 | 82 | #Preview { 83 | ContentView() 84 | } 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh/Gradient_Mesh.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh/Gradient_MeshApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Gradient_MeshApp.swift 3 | // Gradient Mesh 4 | // 5 | // Created by Toni on 11.06.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct Gradient_MeshApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient Mesh/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient MeshTests/Gradient_MeshTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Gradient_MeshTests.swift 3 | // Gradient MeshTests 4 | // 5 | // Created by Toni on 11.06.2024. 6 | // 7 | 8 | import Testing 9 | 10 | struct Gradient_MeshTests { 11 | 12 | @Test func testExample() async throws { 13 | // Write your test here and use APIs like `#expect(...)` to check expected conditions. 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient MeshUITests/Gradient_MeshUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Gradient_MeshUITests.swift 3 | // Gradient MeshUITests 4 | // 5 | // Created by Toni on 11.06.2024. 6 | // 7 | 8 | import XCTest 9 | 10 | final class Gradient_MeshUITests: XCTestCase { 11 | 12 | override func setUpWithError() throws { 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | 15 | // In UI tests it is usually best to stop immediately when a failure occurs. 16 | continueAfterFailure = false 17 | 18 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 19 | } 20 | 21 | override func tearDownWithError() throws { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | @MainActor 26 | func testExample() throws { 27 | // UI tests must launch the application that they test. 28 | let app = XCUIApplication() 29 | app.launch() 30 | 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | @MainActor 35 | func testLaunchPerformance() throws { 36 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { 37 | // This measures how long it takes to launch your application. 38 | measure(metrics: [XCTApplicationLaunchMetric()]) { 39 | XCUIApplication().launch() 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Gradient Mesh/Gradient MeshUITests/Gradient_MeshUITestsLaunchTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Gradient_MeshUITestsLaunchTests.swift 3 | // Gradient MeshUITests 4 | // 5 | // Created by Toni on 11.06.2024. 6 | // 7 | 8 | import XCTest 9 | 10 | final class Gradient_MeshUITestsLaunchTests: XCTestCase { 11 | 12 | override class var runsForEachTargetApplicationUIConfiguration: Bool { 13 | true 14 | } 15 | 16 | override func setUpWithError() throws { 17 | continueAfterFailure = false 18 | } 19 | 20 | @MainActor 21 | func testLaunch() throws { 22 | let app = XCUIApplication() 23 | app.launch() 24 | 25 | // Insert steps here to perform after app launch but before taking a screenshot, 26 | // such as logging into a test account or navigating somewhere in the app 27 | 28 | let attachment = XCTAttachment(screenshot: app.screenshot()) 29 | attachment.name = "Launch Screen" 30 | attachment.lifetime = .keepAlways 31 | add(attachment) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /KeyframeChallenge/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/KeyframeChallenge/.DS_Store -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/KeyframeChallenge/KeyframeChallenge.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/KeyframeChallenge/KeyframeChallenge.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | KeyframeChallenge.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | KeyframeChallenge.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/KeyframeChallenge/KeyframeChallenge/.DS_Store -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // KeyframeChallenge 4 | // 5 | // Created by Toni on 14.12.2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | 12 | @State private var startKeyframeAnimation: Bool = false 13 | @State private var isclicked: Bool = false 14 | 15 | var body: some View { 16 | VStack{ 17 | Spacer() 18 | 19 | ZStack(alignment: Alignment(horizontal: .center, vertical: .bottom)) { 20 | 21 | 22 | Ellipse() 23 | .frame(width: 75, height: 20) 24 | .foregroundStyle(.gray) 25 | .keyframeAnimator(initialValue: Keyframe(), trigger: startKeyframeAnimation) { view, frame in 26 | 27 | view 28 | .scaleEffect(frame.scale) 29 | .opacity(frame.reflectionOpacity) 30 | 31 | 32 | } keyframes: { frame in 33 | 34 | //scale 35 | KeyframeTrack(\.scale){ 36 | CubicKeyframe(1.2, duration: 0.1) 37 | CubicKeyframe(0.4, duration: 0.2) 38 | CubicKeyframe(0.4, duration: 0.65) 39 | CubicKeyframe(1.6, duration: 0.25) 40 | 41 | } 42 | 43 | //opacity 44 | KeyframeTrack(\.reflectionOpacity){ 45 | CubicKeyframe(1, duration: 0.1) 46 | CubicKeyframe(0.4, duration: 0.85) 47 | CubicKeyframe(0.8, duration: 0.2) 48 | CubicKeyframe(0, duration: 0.05) 49 | 50 | } 51 | 52 | //blur 53 | 54 | } 55 | 56 | Rectangle() 57 | .frame(width: 150, height: 150) 58 | .foregroundStyle(.orange) 59 | .cornerRadius(16) 60 | .keyframeAnimator(initialValue: Keyframe(), trigger: startKeyframeAnimation) { view, frame in 61 | 62 | view 63 | .scaleEffect(frame.scale) 64 | .rotationEffect(frame.rotation, anchor: .center) 65 | .offset(y: frame.offsetY) 66 | 67 | } keyframes: { frame in 68 | 69 | //offsetY 70 | KeyframeTrack(\.offsetY){ 71 | CubicKeyframe(10, duration: 0.15) 72 | SpringKeyframe(-100, duration: 0.3, spring: .bouncy) 73 | CubicKeyframe(-100, duration: 0.4) 74 | SpringKeyframe(0, duration: 0.3, spring: .bouncy) 75 | 76 | } 77 | 78 | //scale 79 | KeyframeTrack(\.scale){ 80 | CubicKeyframe(0.9, duration: 0.15) 81 | CubicKeyframe(1.2, duration: 0.3) 82 | CubicKeyframe(1.2, duration: 0.3) 83 | CubicKeyframe(1, duration: 0.3) 84 | 85 | } 86 | 87 | //rotation 88 | KeyframeTrack(\.rotation){ 89 | CubicKeyframe(.zero, duration: 0.15) 90 | CubicKeyframe(.zero, duration: 0.3) 91 | CubicKeyframe(.init(degrees: 180), duration: 0.25) 92 | 93 | } 94 | 95 | } 96 | // .onTapGesture(perform: { 97 | // startKeyframeAnimation.toggle() 98 | // }) 99 | } 100 | 101 | Spacer() 102 | 103 | Button("START"){ 104 | startKeyframeAnimation.toggle() 105 | withAnimation(.smooth){ 106 | isclicked.toggle() 107 | } 108 | 109 | } 110 | .buttonRepeatBehavior(.enabled) 111 | .padding(.horizontal,40).padding(.vertical,16) 112 | .foregroundStyle(.white) 113 | .font(.headline).fontWeight(.semibold) 114 | .background(isclicked ? .blue : .blue.opacity(0.8)) 115 | .cornerRadius(8) 116 | 117 | } 118 | } 119 | } 120 | 121 | 122 | #Preview { 123 | ContentView() 124 | } 125 | 126 | struct Keyframe { 127 | var scale: CGFloat = 1 128 | var offsetY: CGFloat = 0 129 | var rotation: Angle = .zero 130 | var reflectionOpacity: CGFloat = 1 131 | } 132 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge/KeyframeChallengeApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyframeChallengeApp.swift 3 | // KeyframeChallenge 4 | // 5 | // Created by Toni on 14.12.2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct KeyframeChallengeApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /KeyframeChallenge/KeyframeChallenge/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Toni Lijic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Meatball/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Meatball/.DS_Store -------------------------------------------------------------------------------- /Meatball/Meatball.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Meatball/Meatball.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Meatball/Meatball.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Meatball/Meatball.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Meatball/Meatball.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Meatball.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Meatball/Meatball/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Meatball/Meatball/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "1x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "2x", 16 | "size" : "16x16" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "1x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "2x", 26 | "size" : "32x32" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "2x", 36 | "size" : "128x128" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "1x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "2x", 46 | "size" : "256x256" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "1x", 51 | "size" : "512x512" 52 | }, 53 | { 54 | "idiom" : "mac", 55 | "scale" : "2x", 56 | "size" : "512x512" 57 | } 58 | ], 59 | "info" : { 60 | "author" : "xcode", 61 | "version" : 1 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Meatball/Meatball/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Meatball/Meatball/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Meatball 4 | // 5 | // Created by Toni on 14.02.2024. 6 | // 7 | 8 | import SwiftUI 9 | import CoreMotion 10 | 11 | //gyroscope 12 | class MotionManager: ObservableObject { 13 | private let motionManager = CMMotionManager() 14 | @Published var x = 0.0 15 | @Published var y = 0.0 16 | 17 | init() { 18 | 19 | motionManager.startDeviceMotionUpdates(to: .main) { [weak self] data, error in 20 | guard let motion = data?.attitude else {return} 21 | self?.x = motion.roll 22 | self?.y = motion.pitch 23 | 24 | } 25 | } 26 | } 27 | 28 | 29 | 30 | struct ContentView: View { 31 | 32 | 33 | @State private var dragOffset: CGSize = .zero 34 | @StateObject private var motion = MotionManager() 35 | @State private var animatedOffset: CGSize = .zero 36 | 37 | var body: some View { 38 | 39 | ZStack { 40 | Color.white.ignoresSafeArea() 41 | 42 | Meatball(dragOffset: dragOffset) 43 | } 44 | } 45 | 46 | 47 | @ViewBuilder 48 | func Meatball(dragOffset: CGSize) -> some View { 49 | 50 | //meatball shape 51 | Canvas { context, size in 52 | context.addFilter(.alphaThreshold(min: 0.5, color: .black)) 53 | context.addFilter(.blur(radius: 18)) 54 | 55 | context.drawLayer { ctx in 56 | for index in [1, 2] { 57 | if let resolvedView = context.resolveSymbol(id: index) { 58 | ctx.draw(resolvedView, at: CGPoint(x: size.width / 2, y: size.height / 2)) 59 | } 60 | } 61 | } 62 | } symbols: { 63 | Circle() 64 | .fill(.white) 65 | .frame(width: 150, height: 150) 66 | .offset(.zero) 67 | .tag(1) 68 | 69 | Circle() 70 | .fill(.white) 71 | .frame(width: 150, height: 150) 72 | .offset(animatedOffset) 73 | .tag(2) 74 | 75 | } 76 | 77 | .onChange(of: motion.y) { 78 | withAnimation { 79 | self.animatedOffset = CGSize(width: CGFloat(motion.x), height: CGFloat(motion.y * 400)) 80 | } 81 | } 82 | } 83 | } 84 | 85 | #Preview { 86 | ContentView() 87 | } 88 | 89 | -------------------------------------------------------------------------------- /Meatball/Meatball/Meatball.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Meatball/Meatball/MeatballApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MeatballApp.swift 3 | // Meatball 4 | // 5 | // Created by Toni on 14.02.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct MeatballApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Meatball/Meatball/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Meditation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Meditation/.DS_Store -------------------------------------------------------------------------------- /Meditation/Meditation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Meditation/Meditation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Meditation/Meditation.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Meditation/Meditation.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Meditation/Meditation.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Meditation/Meditation.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Meditation/Meditation.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Meditation.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Meditation/Meditation.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Meditation.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Meditation/Meditation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Meditation/Meditation/.DS_Store -------------------------------------------------------------------------------- /Meditation/Meditation/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Meditation/Meditation/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Meditation/Meditation/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Meditation/Meditation/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Meditation 4 | // 5 | // Created by Toni on 29.11.2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | 12 | @State private var color: [Color] = [.blue, .mint, .green, .yellow, .orange, .pink, .red, .purple, .indigo, .cyan] 13 | @State private var index: Int = 0 14 | @State private var scaleUPDown = false 15 | @State private var rotateInOut = false 16 | @State private var moveInOut = false 17 | 18 | var body: some View { 19 | ZStack { 20 | 21 | //first pair or circles 22 | ZStack { 23 | ZStack { 24 | Circle() 25 | .fill(LinearGradient(gradient: Gradient(colors: [color[index], .white]), startPoint: .top, endPoint: .bottom)) 26 | .frame(width: 120, height: 120) 27 | .offset(y: moveInOut ? -60 : 0) 28 | 29 | Circle().fill(LinearGradient(gradient:Gradient(colors: [color[index], .white]), startPoint: .bottom, endPoint: .top)) 30 | .frame(width: 120, height: 120, alignment: .center) 31 | .offset(y: moveInOut ? 60 : 0) 32 | }.opacity(0.5) 33 | } 34 | 35 | // Second pair of circles 36 | ZStack { 37 | ZStack { 38 | Circle() 39 | .fill(LinearGradient(gradient: Gradient(colors: [color[index], .white]), startPoint: .top, endPoint: .bottom)) 40 | .frame(width: 120, height: 120) 41 | .offset(y: moveInOut ? -60 : 0) 42 | 43 | Circle().fill(LinearGradient(gradient:Gradient(colors: [color[index], .white]), startPoint: .bottom, endPoint: .top)) 44 | .frame(width: 120, height: 120, alignment: .center) 45 | .offset(y: moveInOut ? 60 : 0) 46 | } 47 | .opacity(0.5) 48 | .rotationEffect(.degrees(60)) 49 | } 50 | 51 | // Third pair of circles 52 | ZStack { 53 | ZStack { 54 | Circle() 55 | .fill(LinearGradient(gradient: Gradient(colors: [color[index], .white]), startPoint: .top, endPoint: .bottom)) 56 | .frame(width: 120, height: 120) 57 | .offset(y: moveInOut ? -60 : 0) 58 | 59 | Circle().fill(LinearGradient(gradient:Gradient(colors: [color[index], .white]), startPoint: .bottom, endPoint: .top)) 60 | .frame(width: 120, height: 120, alignment: .center) 61 | .offset(y: moveInOut ? 60 : 0) 62 | } 63 | .opacity(0.5) 64 | .rotationEffect(.degrees(120)) 65 | } 66 | 67 | } 68 | .rotationEffect(.degrees(rotateInOut ? 90 : 0)) 69 | .scaleEffect(scaleUPDown ? 1 : 1/8) 70 | .animation(Animation.easeInOut.repeatForever(autoreverses: true).speed(1/8),value: scaleUPDown) 71 | 72 | .onAppear{ 73 | scaleUPDown.toggle() 74 | rotateInOut.toggle() 75 | moveInOut.toggle() 76 | 77 | Timer.scheduledTimer(withTimeInterval: 5.65, repeats: true) { timer in 78 | withAnimation { 79 | // Generate a random index 80 | 81 | let newIndex = (index + 1) % color.count 82 | index = newIndex 83 | } 84 | } 85 | 86 | 87 | } 88 | } 89 | } 90 | 91 | #Preview { 92 | ContentView() 93 | .preferredColorScheme(/*@START_MENU_TOKEN@*/.dark/*@END_MENU_TOKEN@*/) 94 | } 95 | -------------------------------------------------------------------------------- /Meditation/Meditation/MeditationApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MeditationApp.swift 3 | // Meditation 4 | // 5 | // Created by Toni on 29.11.2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct MeditationApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Meditation/Meditation/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /OnDragExercise/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/OnDragExercise/.DS_Store -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/OnDragExercise/OnDragExercise.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/OnDragExercise/OnDragExercise.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise.xcodeproj/xcuserdata/toni.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | OnDragExercise.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | OnDragExercise.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/OnDragExercise/OnDragExercise/.DS_Store -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // OnDragExercise 4 | // 5 | // Created by Toni on 18.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | //distance between points in 2D 11 | func getDistance(p1: CGPoint, p2: CGPoint) -> Float { 12 | return hypotf(Float(p1.x - p2.x), Float(p1.y - p2.y)) 13 | } 14 | 15 | 16 | // equation 17 | func scale(inputMins: CGFloat, inputMax: CGFloat, outputMin: CGFloat, outputMax: CGFloat, value: CGFloat) -> CGFloat { 18 | return outputMin + (outputMax - outputMin) * (value - inputMins) / ( inputMax - inputMins) 19 | 20 | } 21 | 22 | 23 | 24 | 25 | 26 | //variables 27 | var rows: Int = 24 28 | var columns: Int = 20 29 | var spacing: Int = 6 30 | var padding: Int = 4 31 | var size: Int = 8 32 | 33 | 34 | struct ContentView: View { 35 | 36 | 37 | 38 | @State var selectedPoint: CGPoint = .zero 39 | @State var isDragging = false 40 | 41 | 42 | func getOffset(row: Int, column: Int, selectedPoint: CGPoint, isDragging: Bool) -> CGPoint { 43 | 44 | //starting point coordinates 45 | let p1: CGPoint = CGPoint( 46 | x: Double(row * ( size + spacing)), 47 | y: Double(column * ( size + spacing)) 48 | ) 49 | 50 | //selected/dragged point coordinates 51 | let p2 = selectedPoint 52 | let distance = getDistance(p1: p1, p2: p2) 53 | 54 | 55 | var normalizedDistance = scale(inputMins: 0, inputMax: 100, outputMin: 0, outputMax: 2, value: CGFloat(distance)) 56 | 57 | normalizedDistance = min(1, max(0, normalizedDistance)) 58 | 59 | 60 | if isDragging { 61 | 62 | 63 | let x = (p1.x * (normalizedDistance)) + (p2.x * (1 - normalizedDistance)) 64 | let y = (p1.y * normalizedDistance) + (p2.y * (1 - normalizedDistance)) 65 | 66 | return CGPoint(x: x, y: y) 67 | } else { 68 | return p1 69 | } 70 | } 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | func getFill(column: Int, row: Int, selectedPoint: CGPoint, isDragging: Bool) -> Color { 81 | 82 | let p1: CGPoint = CGPoint( 83 | x: Double(row * (size + spacing)), 84 | y: Double(column * (size + spacing)) 85 | ) 86 | 87 | 88 | let p2 = selectedPoint 89 | 90 | let distance = getDistance(p1: p1, p2: p2) 91 | 92 | var normalizedDistance = scale(inputMins: 0, inputMax: 1000, outputMin: 0, outputMax: 1, value: CGFloat(distance)) 93 | 94 | normalizedDistance = min(1, max(0, normalizedDistance)) 95 | 96 | if isDragging && normalizedDistance <= 0.05 { 97 | return Color.white 98 | 99 | } else { 100 | return Color.white.opacity(0.4) 101 | } 102 | } 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | var body: some View { 112 | 113 | 114 | 115 | ZStack { 116 | Color(.black).ignoresSafeArea() 117 | 118 | .gesture( 119 | DragGesture(minimumDistance: 0) 120 | .onChanged { gesture in 121 | withAnimation(.spring()) { 122 | selectedPoint = CGPoint(x: gesture.location.x, y: gesture.location.y) 123 | } 124 | withAnimation(.interactiveSpring()) { 125 | isDragging = true 126 | } 127 | 128 | } 129 | .onEnded { _ in 130 | withAnimation(.spring()) { 131 | isDragging = false 132 | } 133 | } 134 | ) 135 | 136 | ZStack { 137 | ForEach((0...rows - 1),id: \.self) { row in 138 | ForEach((0...columns - 1), id: \.self) {column in 139 | RoundedRectangle(cornerRadius: 3, style: /*@START_MENU_TOKEN@*/.continuous/*@END_MENU_TOKEN@*/) 140 | .fill(getFill(column: column, row: row, selectedPoint: selectedPoint, isDragging: isDragging)) 141 | .frame(width: CGFloat(size), height: CGFloat(size)) 142 | 143 | .position(getOffset(row: row,column: column, selectedPoint: selectedPoint, isDragging: isDragging)) 144 | 145 | } 146 | } 147 | } 148 | } 149 | 150 | .offset(x: 37, y: 240) 151 | .scaleEffect(1) 152 | .preferredColorScheme(.dark) 153 | 154 | } 155 | 156 | } 157 | 158 | #Preview { 159 | ContentView() 160 | } 161 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise/OnDragExerciseApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OnDragExerciseApp.swift 3 | // OnDragExercise 4 | // 5 | // Created by Toni on 18.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct OnDragExerciseApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /OnDragExercise/OnDragExercise/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Paging Indicators/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Paging Indicators/.DS_Store -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Paging Indicators/Paging Indicators.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Paging Indicators/Paging Indicators.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Paging Indicators.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Paging Indicators.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Paging Indicators/Paging Indicators/.DS_Store -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Paging Indicators 4 | // 5 | // Created by Toni on 04.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | var body: some View { 12 | NavigationStack{ 13 | Home() 14 | } 15 | 16 | } 17 | } 18 | 19 | #Preview { 20 | ContentView() 21 | } 22 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators/Home.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Home.swift 3 | // Paging Indicators 4 | // 5 | // Created by Toni on 04.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct Home: View { 11 | @State private var colors: [Color] = [.blue, .orange, .purple, .gray] 12 | 13 | 14 | 15 | var body: some View { 16 | VStack { 17 | ScrollView(.horizontal) { 18 | VStack{ 19 | LazyHStack(spacing:0) { 20 | ForEach(colors, id: \.self) { color in 21 | RoundedRectangle(cornerRadius: 25) 22 | .fill(color.gradient) 23 | .padding(15) 24 | .containerRelativeFrame(.horizontal) 25 | } 26 | } 27 | 28 | PageIndicator() 29 | 30 | 31 | 32 | } 33 | 34 | } 35 | 36 | 37 | .scrollTargetBehavior(.paging) 38 | .scrollIndicators(.hidden) 39 | .frame(height: 300) 40 | 41 | Spacer() 42 | 43 | } 44 | .navigationTitle("Indicators") 45 | } 46 | 47 | } 48 | 49 | #Preview { 50 | ContentView() 51 | } 52 | -------------------------------------------------------------------------------- /Paging Indicators/Paging Indicators/PageIndicator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PageIndicator.swift 3 | // Paging Indicators 4 | // 5 | // Created by Toni on 04.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct PageIndicator: View { 11 | 12 | var body: some View { 13 | 14 | GeometryReader { 15 | 16 | let width = $0.size.width 17 | 18 | if let scrollViewWidth = $0.bounds(of: .scrollView(axis: .horizontal))?.width, 19 | scrollViewWidth > 0 { 20 | 21 | let minX = $0.frame(in: .scrollView(axis: .horizontal)).minX 22 | 23 | 24 | let totalPages = Int(width / scrollViewWidth) 25 | 26 | let progress = -minX/scrollViewWidth 27 | let activeIndex = Int(progress) 28 | let nextIndex = Int(progress.rounded(.awayFromZero)) 29 | 30 | let indicatorProgress = progress - CGFloat(activeIndex) 31 | 32 | //Indicators Width 33 | let nextIndicatorWidth = indicatorProgress * 24 34 | let currentIndicatorWidth = 24 - (nextIndicatorWidth) 35 | 36 | 37 | 38 | 39 | HStack(spacing: 10) { 40 | ForEach(0.. 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Particles Burst/LastBurstTest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Particles Burst/LastBurstTest.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Particles Burst/LastBurstTest.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Particles Burst/LastBurstTest.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Particles Burst/LastBurstTest.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Particles Burst/LastBurstTest.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LastBurstTest.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Particles Burst/LastBurstTest.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LastBurstTest.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "burst.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | }, 9 | { 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "dark" 14 | } 15 | ], 16 | "idiom" : "universal", 17 | "platform" : "ios", 18 | "size" : "1024x1024" 19 | }, 20 | { 21 | "appearances" : [ 22 | { 23 | "appearance" : "luminosity", 24 | "value" : "tinted" 25 | } 26 | ], 27 | "idiom" : "universal", 28 | "platform" : "ios", 29 | "size" : "1024x1024" 30 | } 31 | ], 32 | "info" : { 33 | "author" : "xcode", 34 | "version" : 1 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Assets.xcassets/AppIcon.appiconset/burst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Particles Burst/Particles Burst/Assets.xcassets/AppIcon.appiconset/burst.png -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Assets.xcassets/DarkGrey.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.230", 9 | "green" : "0.188", 10 | "red" : "0.188" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "idiom" : "universal" 23 | } 24 | ], 25 | "info" : { 26 | "author" : "xcode", 27 | "version" : 1 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Assets.xcassets/GYellow.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.761", 9 | "green" : "0.902", 10 | "red" : "1.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "idiom" : "universal" 23 | } 24 | ], 25 | "info" : { 26 | "author" : "xcode", 27 | "version" : 1 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Assets.xcassets/Gold.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.318", 9 | "green" : "0.486", 10 | "red" : "0.643" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "idiom" : "universal" 23 | } 24 | ], 25 | "info" : { 26 | "author" : "xcode", 27 | "version" : 1 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/LastBurstTest.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LastBurstTestApp.swift 3 | // LastBurstTest 4 | // 5 | // Created by Toni on 08.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct LastBurstTest: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | SceneView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Particles/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Particles/Assets.xcassets/Particle Sprite Atlas.spriteatlas/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Particles/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "bokeh.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Particles/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/bokeh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Particles Burst/Particles Burst/Particles/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/bokeh.png -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Particles/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "spark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Particles/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Particles Burst/Particles Burst/Particles/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/spark.png -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Particles/MyParticle.sks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Particles Burst/Particles Burst/Particles/MyParticle.sks -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Preview Content/Particles.sks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Particles Burst/Particles Burst/Preview Content/Particles.sks -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Preview Content/Preview Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Particles Burst/Particles Burst/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## SwiftUI-Explorations ## 2 | 3 | Here, you’ll find a collection of my swiftUI prototypes. As I delve into SwiftUI, I’m sharing my learning journey and experiments in this space. I also cover these topics in more detail in my [blog post](https://www.toni.li/blog/swiftui-explorations)

4 | 5 | 6 | | # | Project Name & Link | Description | 7 | |-----|-----------------------------------------------------------------------------------------------------|---------------------------------------------------------------| 8 | | 1 | [Animated Tab Icons](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Animated%20Tab%20Icons) | Animating symbols and native animation properties. | 9 | | 2 | [Apple TV Loader](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/AppleTVLoader) | Experimented with layouts and recreated loading spinner. | 10 | | 3 | [Arc Drag Interaction](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/ArcDragInteraction) | Replicated onboarding fidget spinner from Arc Search app. | 11 | | 4 | [Button Animation](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Button%20animation) | Tap, press exercise. | 12 | | 5 | [Button Styles](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Button%20Styles) | 2023 and 2024 button style toggle. | 13 | | 6 | [Confetti Fidgets](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/ConfettiFidgets) | Recreated Framer interaction by Daniel Korpai. | 14 | | 7 | [Gradient Mesh](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Gradient%20Mesh) | Gradient mesh experiment. | 15 | | 8 | [iOS Dock](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/AppJiggling) | iOS Dock adjusted for horizontal scrolling. | 16 | | 9 | [iOS Slider](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Volume%20Control) | iOS Slider with added glow. | 17 | | 10 | [Keyframe Challenge](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/KeyframeChallenge) | Keyframe animation exercise. | 18 | | 11 | [Meatball](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Meatball) | CoreMotion exercise. | 19 | | 12 | [Meditation](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Meditation) | Breathing Apple Watch-like interaction. | 20 | | 13 | [On Drag Interaction](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/OnDragExercise) | Dynamic cloth-like grid. | 21 | | 14 | [Paging Indicators](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Paging%20Indicators) | Based on idea from Andie Logan. | 22 | | 15 | [Particles Burst](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Particles%20Burst) | Recreated [prototype](https://x.com/alexwidua/status/1702356242713178411?s=20) by Alex Widua. | 23 | | 16 | [Spinner](https://github.com/tonilijic/SwiftUI-Explorations/tree/main/Spinner1) | Played with layouts and tried to recreate Apple TV spinner. | 24 | 25 |

26 | 27 | > [!NOTE] 28 | > As I am currently in the learning process and exploring out of pure joy and curiosity, please note that the code may not yet be fully optimized for production-level usage.
29 |
30 | -------------------------------------------------------------------------------- /Spinner1/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Spinner1/.DS_Store -------------------------------------------------------------------------------- /Spinner1/Spinner1.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Spinner1/Spinner1.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Spinner1/Spinner1.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Spinner1/Spinner1.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Spinner1/Spinner1.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Spinner1/Spinner1.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Spinner1/Spinner1.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Spinner1.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Spinner1/Spinner1.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Spinner1.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Spinner1/Spinner1/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Spinner1/Spinner1/.DS_Store -------------------------------------------------------------------------------- /Spinner1/Spinner1/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Spinner1/Spinner1/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spinner1/Spinner1/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Spinner1/Spinner1/ContentView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | 4 | 5 | extension View { 6 | 7 | 8 | func glow(color: Color, radius: CGFloat) -> some View { 9 | self 10 | .shadow(color: color.opacity(1), radius: 4 * radius) 11 | .shadow(color: color.opacity(1), radius: 4 * radius) 12 | } 13 | 14 | } 15 | 16 | 17 | 18 | 19 | 20 | struct ContentView: View { 21 | 22 | @State private var count = 1 23 | @State private var animated: Bool = false 24 | 25 | var body: some View { 26 | 27 | ZStack { 28 | Color.black.ignoresSafeArea() 29 | 30 | 31 | 32 | ZStack { 33 | ForEach(0.. 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Volume Control/Volume Control.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Volume Control/Volume Control.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Volume Control/Volume Control.xcodeproj/project.xcworkspace/xcuserdata/toni.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Volume Control/Volume Control.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Volume Control/Volume Control.xcodeproj/project.xcworkspace/xcuserdata/tonilijic.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Volume Control/Volume Control.xcodeproj/xcuserdata/toni.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Volume Control.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Volume Control/Volume Control.xcodeproj/xcuserdata/tonilijic.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Volume Control.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Assets.xcassets/Particle Sprite Atlas.spriteatlas/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "bokeh.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/bokeh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Volume Control/Volume Control/Assets.xcassets/Particle Sprite Atlas.spriteatlas/bokeh.imageset/bokeh.png -------------------------------------------------------------------------------- /Volume Control/Volume Control/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "spark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Volume Control/Volume Control/Assets.xcassets/Particle Sprite Atlas.spriteatlas/spark.imageset/spark.png -------------------------------------------------------------------------------- /Volume Control/Volume Control/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Volume Control 4 | // 5 | // Created by Toni on 05.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | 11 | 12 | struct iOsSlider: View { 13 | 14 | 15 | //constants 16 | 17 | enum Const { 18 | static let shapeSize: CGSize = .init(width: 80.0, height: 240.0) 19 | static let cornerRadius: CGFloat = 25.0 20 | } 21 | 22 | 23 | //variables 24 | 25 | @State var value = 0.0 26 | @State var hScale = 1.0 27 | @State var vScale = 1.0 28 | @State var vOffset: CGFloat = 0.0 29 | @State var startValue: CGFloat = 0.0 30 | @State var anchor: UnitPoint = .center 31 | @State var isTouching = false 32 | 33 | 34 | 35 | 36 | var body: some View { 37 | 38 | ZStack { 39 | 40 | Color.black.ignoresSafeArea() 41 | 42 | VStack { 43 | 44 | slider 45 | .clipShape(RoundedRectangle(cornerRadius: Const.cornerRadius, style: .continuous)) 46 | 47 | //feel free to adjust shadow radius as you like 48 | .shadow(color: .orange.opacity(value),radius: (80*value)) 49 | 50 | .frame(width: Const.shapeSize.width, height: Const.shapeSize.height) 51 | .scaleEffect(x: hScale, y: vScale, anchor: anchor) 52 | .offset(x:0, y:vOffset) 53 | .gesture(DragGesture(minimumDistance: 0) 54 | .onChanged { drag in 55 | if !isTouching { 56 | startValue = value 57 | } 58 | 59 | isTouching = true 60 | 61 | 62 | //adjusting height of slider on drag 63 | 64 | var value = startValue - (drag.translation.height/Const.shapeSize.height) 65 | self.value = min(max(value,0.0), 1.0) 66 | 67 | 68 | //top - rubbery strech behavior 69 | 70 | if value > 1 { 71 | value = sqrt(sqrt(sqrt(value))) 72 | anchor = .bottom 73 | vOffset = Const.shapeSize.height * (1 - value)/2 74 | 75 | 76 | //bottom - rubbery stretch behavior 77 | 78 | } else if value < 0 { 79 | value = sqrt(sqrt(sqrt(1 - value))) 80 | anchor = .top 81 | vOffset = -Const.shapeSize.height * ( 1 - value)/2 82 | 83 | 84 | } else { 85 | value = 1.0 86 | anchor = .center 87 | 88 | } 89 | 90 | vScale = value 91 | hScale = 2 - value 92 | 93 | 94 | } 95 | 96 | // end of interaction - reset 97 | 98 | .onEnded {_ in 99 | isTouching = false 100 | vScale = 1.0 101 | hScale = 1.0 102 | anchor = .center 103 | vOffset = 0.0 104 | }) 105 | } 106 | .animation(isTouching ? .none : .spring, value: vScale) 107 | .frame(maxWidth: .infinity, maxHeight: .infinity) 108 | } 109 | } 110 | 111 | 112 | @ViewBuilder 113 | var slider: some View { 114 | ZStack { 115 | Rectangle() 116 | .foregroundStyle(.gray.opacity(0.1)) 117 | VStack { 118 | 119 | Spacer() 120 | .frame(minHeight: 0) 121 | 122 | Rectangle() 123 | .frame(width: Const.shapeSize.width, height: value * Const.shapeSize.height) 124 | .foregroundStyle(.orange.gradient) 125 | 126 | } 127 | } 128 | } 129 | } 130 | 131 | 132 | #Preview { 133 | iOsSlider() 134 | } 135 | 136 | 137 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Volume Control/Volume Control/Spark.sks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonilijic/SwiftUI-Explorations/d8ab8ce5d10240c16eb97674e4f4c6d9c7f64efa/Volume Control/Volume Control/Spark.sks -------------------------------------------------------------------------------- /Volume Control/Volume Control/Volume_ControlApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Volume_ControlApp.swift 3 | // Volume Control 4 | // 5 | // Created by Toni on 05.01.2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct Volume_ControlApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | iOsSlider() 15 | } 16 | } 17 | } 18 | --------------------------------------------------------------------------------