Skip to content

Instantly share code, notes, and snippets.

View sam-moshenko's full-sized avatar
🏠
Working from home

Simon Lebedev sam-moshenko

🏠
Working from home
View GitHub Profile
@sam-moshenko
sam-moshenko / SearchViewControllerIOS13Bug.playground
Created September 24, 2019 16:07
This is the simplest code that reproduces a iOS 13 bug with adding UISearchViewController to UINavigationItem after view was loaded.
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
public func setupSearch() {
let searchController = UISearchController(searchResultsController: nil)
navigationItem.searchController = searchController
//navigationController?.navigationBar.sizeToFit() // This line fixes the issue by updating navigationBar's size
}
}
import Foundation
import UIKit
@IBDesignable
class HollowCircle: UIView {
@IBInspectable var internalRadius: CGFloat = 0 {
didSet {
createOverlay()
}
}
@sam-moshenko
sam-moshenko / WUImageDownloader.swift
Last active September 16, 2017 12:29
A little helper for downloading images
//
// WUImageDownloader.swift
// WorkUp
//
// Created by Simon Lebedev on 9/6/17.
// Copyright © 2017 Simon. All rights reserved.
//
import UIKit
import AlamofireImage
@sam-moshenko
sam-moshenko / TMFadeAnimator.swift
Created July 3, 2017 18:19
Simple class for fading animation between UIViewControllers in UINavigationController
//
// NavigationVC.swift
// WorkUp
//
// Created by Simon on 4/23/17.
// Copyright © 2017 Simon. All rights reserved.
//
import UIKit
@sam-moshenko
sam-moshenko / BEMCheckBoxWithView.swift
Created April 28, 2017 15:57
BEMCheckBox "extension" to support some content view to be highlighted when the checkbox is checked
import UIKit
import BEMCheckBox
//BEMCheckBox does not have any text or image next to the checkbox itself
//This class helps a bit with that
@IBDesignable
class BEMCheckBoxWithView: BEMCheckBox {
//this is the view that stands near checkbox
@sam-moshenko
sam-moshenko / BaseVC.swift
Last active June 17, 2017 15:54
BaseViewController for iOS Swift to handle keyboard overlapping important views and easier translations between view controllers(IMHO)
//
// BaseVC.swift
//
// Created by Simon on 4/23/17.
// Copyright © 2017 Simon. All rights reserved.
//
import UIKit
/*