Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am andreyz on github.
  • I am andreyz (https://keybase.io/andreyz) on keybase.
  • I have a public key whose fingerprint is C8AA 43DE 0B55 A0B6 6F25 A6A9 52BA F05C 980F 07B3

To claim this, I am signing this object:

@andreyz
andreyz / about.md
Created August 10, 2011 19:57 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
import UIKit
class TouchForwardingView: UIView {
var passthroughViews: [UIView] = []
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
guard let hitView = super.hitTest(point, with: event) else { return nil }
guard hitView == self else { return hitView }
@andreyz
andreyz / UIEdgeInsets+Extension.swift
Last active February 17, 2018 21:59
Initialisers through key paths
public extension UIEdgeInsets {
public var vertical: CGFloat {
get { return 0 } // meaningless but not fatal
set { (top, bottom) = (newValue, newValue) }
}
public var horizontal: CGFloat {
get { return 0 } // meaningless but not fatal
set { (left, right) = (newValue, newValue) }
}
[
{
"name": "Admir Rocks",
"category": "Featured",
"city": "Huddik",
"state": "Norrland",
"id": 1000,
"park": "Joshua Tree National Park",
"coordinates": {
"longitude": -116.166868,
import SwiftUI
import WebKit
import Combine
class WebViewData: ObservableObject {
@Published var loading: Bool = false
@Published var scrollPercent: Float = 0
@Published var url: URL? = nil
@Published var urlBar: String = "https://nasa.gov"
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
import Combine
import ComposableArchitecture
import UserNotifications
public struct UserNotificationClient {
public var add: (UNNotificationRequest) -> Effect<Void, Error>
public var delegate: Effect<DelegateEvent, Never>
public var getNotificationSettings: Effect<Notification.Settings, Never>
public var removeDeliveredNotificationsWithIdentifiers: ([String]) -> Effect<Never, Never>
public var removePendingNotificationRequestsWithIdentifiers: ([String]) -> Effect<Never, Never>
@andreyz
andreyz / Calendar.swift
Created November 3, 2020 14:38 — forked from mecid/Calendar.swift
SwiftUI Calendar view using LazyVGrid
import SwiftUI
fileprivate extension DateFormatter {
static var month: DateFormatter {
let formatter = DateFormatter()
formatter.dateFormat = "MMMM"
return formatter
}
static var monthAndYear: DateFormatter {
@andreyz
andreyz / ManagedObjectChangesPublisher.swift
Created April 29, 2020 18:45 — forked from mjm/ManagedObjectChangesPublisher.swift
Observe changes to a Core Data fetch request with Combine
import Combine
import CoreData
extension NSManagedObjectContext {
func changesPublisher<Object: NSManagedObject>(for fetchRequest: NSFetchRequest<Object>)
-> ManagedObjectChangesPublisher<Object>
{
ManagedObjectChangesPublisher(fetchRequest: fetchRequest, context: self)
}
}