This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ScrollViewController.swift | |
// Test | |
// | |
// Created by Jayesh Kawli on 19/04/2023. | |
// | |
// custom scroll view stack view in Swift | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MovieCell.swift | |
// | |
import UIKit | |
final class MovieCell: UITableViewCell { | |
let posterImageView = UIImageView(frame: .zero) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
findMatches() | |
findMatchingElements() | |
replaceMatchingElements() | |
} | |
func findMatches() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CustomAttributedStringTextView.swift | |
// SwiftUIBlogPosts | |
// | |
// Created by Jayesh Kawli on 8/31/22. | |
// | |
import SwiftUI | |
struct CustomAttributedStringTextViewModel { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MyNotificationCenter.swift | |
// MyNotificationCenterImplementation | |
// | |
// Created by Jayesh Kawli on 10/12/19. | |
// Copyright © 2019 Jayesh Kawli. All rights reserved. | |
// | |
import Foundation | |
enum NotificationCenterError: Error { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Searchable.swift | |
import SwiftUI | |
struct Searchable: View { | |
@State var searchText: String = "" | |
private let suggestions = ["Milan", "Rome", "Paris", "Iceland", "Greenland", "Florida"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct Place: Identifiable { | |
let id: String | |
let name: String | |
let imageName: String | |
var isFavorited: Bool = false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ShadowView: View { | |
let xOffset: CGFloat | |
let yOffset: CGFloat | |
var body: some View { | |
Text("SwiftUI is Awesome").padding().background( | |
Rectangle() |