Skip to content

Instantly share code, notes, and snippets.

import UIKit
class RootStackTabViewController: UIViewController {
@IBOutlet weak var bottomStack: UIStackView!
var currentIndex = 0
lazy var tabs: [StackItemView] = {
import UIKit
import FLUtilities
protocol StackItemViewDelegate: class {
func handleTap(_ view: StackItemView)
}
class StackItemView: UIView {
class BottomStackItem {
var title: String
var image: String
var isSelected: Bool
init(title: String,
image: String,
isSelected: Bool = false) {
public func delay(_ delay: Double, closure: @escaping () -> Void) {
let deadline = DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC)
DispatchQueue.main.asyncAfter(
deadline: deadline,
execute: closure
)
}
//
// HorizontalPaginationManager.swift
// HorizontalPaginationDemo
//
// Created by Abhishek Thapliyal on 15/07/20.
// Copyright © 2020 Abhishek Thapliyal. All rights reserved.
//
import Foundation
import UIKit
extension ViewController: UITextViewDelegate {
private func setupTextView() {
self.commentTextView.delegate = self
}
func textViewDidEndEditing(_ textView: UITextView) {
self.placeHolderLabel.isHidden = !textView.text.isEmpty
}
extension ViewController {
private func setupKeyboardNotifications() {
NotificationCenter.default.addObserver(self,
selector: #selector(keyboardWillShow(_:)),
name: UIResponder.keyboardWillShowNotification,
object: nil)
NotificationCenter.default.addObserver(self,
//
// ViewController.swift
// ExpandableTextViewDemo
//
// Created by Abhishek Thapliyal on 20/07/20.
// Copyright © 2020 Abhishek Thapliyal. All rights reserved.
//
import UIKit
class DropDownCellModel {
var item: PerformanceDateGroup
var isSelected: Bool
init(item: PerformanceDateGroup, isSelected: Bool = false) {
self.item = item
self.isSelected = isSelected
}
}
extension MyViewController: DropDownViewDelegate {
private func setupData() {
guard let model = self.dropDownView.cellItems.first else { return }
self.handleDates(model: model)
}
private func hideOnOtherView() {
if self.dropDownView.isVisible {