Skip to content

Instantly share code, notes, and snippets.

View jayesh15111988's full-sized avatar

Jayesh Kawli jayesh15111988

View GitHub Profile
@jayesh15111988
jayesh15111988 / StackViewScrollView.swift
Created April 20, 2023 08:08
A demo to show how to use scroll behavior with stack view and scroll view in Swift
//
// ScrollViewController.swift
// Test
//
// Created by Jayesh Kawli on 19/04/2023.
//
// custom scroll view stack view in Swift
import Foundation
//
// MovieCell.swift
//
import UIKit
final class MovieCell: UITableViewCell {
let posterImageView = UIImageView(frame: .zero)
@jayesh15111988
jayesh15111988 / ImageDownloader.swift
Created April 26, 2020 21:37
A gist for image downloader and caching library written in Swift for iOS applications
import UIKit
// Image downloader utility class. We are going to use the singleton instance to be able to download required images and store them into in-memory cache.
final class ImageDownloader {
static let shared = ImageDownloader()
private var cachedImages: [String: UIImage]
private var imagesDownloadTasks: [String: URLSessionDataTask]
@jayesh15111988
jayesh15111988 / Regex.swift
Created July 18, 2022 13:33
The Gist to summarize how to use Regular expression on iOS platform using Swift
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
findMatches()
findMatchingElements()
replaceMatchingElements()
}
func findMatches() {
@jayesh15111988
jayesh15111988 / .zshrc
Last active February 15, 2023 15:32
My zshrc file
function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
COLOR_DEF=$'\e[0m'
COLOR_USR=$'\e[38;5;243m'
COLOR_DIR=$'\e[38;5;197m'
COLOR_GIT=$'\e[38;5;39m'
setopt PROMPT_SUBST
@jayesh15111988
jayesh15111988 / CustomAttributedStringTextView.swift
Created September 2, 2022 09:39
A source code to demo applying attributed strings attribute from markdown styles
//
// CustomAttributedStringTextView.swift
// SwiftUIBlogPosts
//
// Created by Jayesh Kawli on 8/31/22.
//
import SwiftUI
struct CustomAttributedStringTextViewModel {
//
// MyNotificationCenter.swift
// MyNotificationCenterImplementation
//
// Created by Jayesh Kawli on 10/12/19.
// Copyright © 2019 Jayesh Kawli. All rights reserved.
//
import Foundation
enum NotificationCenterError: Error {
@jayesh15111988
jayesh15111988 / Searchable_demo.swift
Created August 30, 2022 09:32
A Source code to demonstrate new searchable modifier introduced in iOS 15
// Searchable.swift
import SwiftUI
struct Searchable: View {
@State var searchText: String = ""
private let suggestions = ["Milan", "Rome", "Paris", "Iceland", "Greenland", "Florida"]
@jayesh15111988
jayesh15111988 / SwipeActionsModifier.swift
Last active August 29, 2022 10:37
A Gist to demo SwiftUI's swipe actions modifier in action
import SwiftUI
struct Place: Identifiable {
let id: String
let name: String
let imageName: String
var isFavorited: Bool = false
}
@jayesh15111988
jayesh15111988 / shadow_view_swiftUI.swift
Created May 6, 2022 08:22
Adding Shadow View in SwiftUI
import SwiftUI
struct ShadowView: View {
let xOffset: CGFloat
let yOffset: CGFloat
var body: some View {
Text("SwiftUI is Awesome").padding().background(
Rectangle()