Skip to content

Instantly share code, notes, and snippets.

View ashishkakkad8's full-sized avatar
👨‍💻
Koding

Ashish Kakkad ashishkakkad8

👨‍💻
Koding
View GitHub Profile
@ashishkakkad8
ashishkakkad8 / AnimationMeshGradient.swift
Created July 30, 2024 19:18
Animate MeshGradient in SwiftUI
TimelineView(.animation) { timeline in
let x = (sin(timeline.date.timeIntervalSince1970) + 1) / 2
MeshGradient(
width: 3,
height: 3,
points: [
[0.0, 0.0], [0.5, 0.0], [1.0, 0.0],
[0.0, 0.5], [Float(x), 0.5], [1.0, 0.5],
[0.0, 1.0], [0.5, 1.0], [1.0, 1.0]
], colors: [
@ashishkakkad8
ashishkakkad8 / MeshGradient.swift
Created June 30, 2024 19:41
MeshGradient in SwiftUI
MeshGradient(
width: 3,
height: 3,
points: [
[0.0, 0.0], [0.5, 0.0], [1.0, 0.0],
[0.0, 0.5], [0.5, 0.5], [1.0, 0.5],
[0.0, 1.0], [0.5, 1.0], [1.0, 1.0]
], colors: [
.red, .red, .red,
.black, .red, .black,
@ashishkakkad8
ashishkakkad8 / AKPageView.swift
Created August 31, 2023 18:15
AKPageView for Onboarding View
//
// AKPageView.swift
// AKPageView
//
// Created by Ashish Kakkad on 31/08/23.
//
import SwiftUI
struct AKPageView: View {
@ashishkakkad8
ashishkakkad8 / CardView.swift
Created August 31, 2023 18:09
CardView for Onboarding View
//
// CardView.swift
// AKPageView
//
// Created by Ashish Kakkad on 31/08/23.
//
import SwiftUI
struct CardView: View {
@ashishkakkad8
ashishkakkad8 / PreventScrollViewScreenshot.swift
Created April 23, 2023 10:56
Screenshot Prevent for ScrollView
extension UIView {
func preventScrollViewScreenshotRecursive() {
guard superview != nil else {
for subview in subviews {
subview.preventScrollViewScreenshotRecursive()
}
return
}
let guardTextField = UITextField()
guardTextField.backgroundColor = .red
@ashishkakkad8
ashishkakkad8 / ContentView.swift
Last active September 20, 2022 17:51
Sample View to demonstrate Start Activity
import SwiftUI
import ActivityKit
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "capsule")
.imageScale(.large)
.foregroundColor(.black)
Text("Hello, Dynamic Island!")
@ashishkakkad8
ashishkakkad8 / LiveActivitySample.swift
Created September 20, 2022 17:35
Live Activity Sample Code
//
// LiveActivitySample.swift
// LiveActivitySample
//
// Created by Ashish Kakkad on 20/09/22.
//
import WidgetKit
import SwiftUI
@ashishkakkad8
ashishkakkad8 / ActivityAttributesSample.swift
Created September 20, 2022 17:30
ActivityAttributesSample File
import ActivityKit
struct ActivityAttributesSample: ActivityAttributes {
public typealias Status = ContentState
public struct ContentState: Codable, Hashable {
var value: String
}
}
@ashishkakkad8
ashishkakkad8 / Info.plist
Last active September 20, 2022 17:25
Update Info Plist for Support Live Activities
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSSupportsLiveActivities</key>
<true/>
</dict>
</plist>
@ashishkakkad8
ashishkakkad8 / FirstView.swift
Created August 24, 2022 18:05
PassDataSwiftUI
//
// FirstView.swift
// PassDataSwiftUI
//
// Created by Kode on 24/08/22.
//
import SwiftUI
struct FirstView: View {