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 / APIHelper.swift
Last active August 21, 2022 12:51
APIHelper in SwiftUI
//
// APIHelper.swift
// APISwiftUI
//
// Created by Kode on 04/08/22.
//
import Foundation
class APIHelper : ObservableObject {
@ashishkakkad8
ashishkakkad8 / Models.swift
Created August 21, 2022 12:36
Models for Contacts JSON Response
//
// Models.swift
// APISwiftUI
//
// Created by Kode on 04/08/22.
//
import Foundation
// MARK: - ContactResult
struct ContactResult: Codable {
@ashishkakkad8
ashishkakkad8 / ContactListView.swift
Created August 21, 2022 12:56
Populate Contact List in SwiftUI
//
// ContactListView.swift
// APISwiftUI
//
// Created by Kode on 21/08/22.
//
import SwiftUI
struct ContactListView: View {
@ashishkakkad8
ashishkakkad8 / SecondView.swift
Created August 24, 2022 18:03
PassDataSwiftUI
//
// SecondView.swift
// PassDataSwiftUI
//
// Created by Kode on 24/08/22.
//
import SwiftUI
struct SecondView: View {
@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 {
@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 / 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 / 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 / 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 / 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