This file contains hidden or 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
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { | |
animateFading(fromController: selectedViewController, toController: viewController) | |
return true | |
} | |
func animateFading(fromController: UIViewController?, toController: UIViewController?) { | |
if fromController == nil || toController == fromController { return } | |
guard let selectView = (selectedViewController as? UINavigationController)?.viewControllers.first?.view, | |
let newView = (toController as? UINavigationController)?.viewControllers.first?.view else { return } |
This file contains hidden or 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
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { | |
animateSliding(fromController: selectedViewController, toController: viewController) | |
return false | |
} | |
func animateSliding(fromController: UIViewController?, toController: UIViewController?) { | |
guard let fromController = fromController, let toController = toController else { return } | |
guard let fromIndex = viewControllers?.index(of: fromController), | |
let toIndex = viewControllers?.index(of: toController) else { return } |
This file contains hidden or 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
struct ogeSystemCalendar { | |
let eventStore = EKEventStore() | |
func addEvent(title: String, startDate: Date, | |
endDate: Date, notes: String?) { | |
eventStore.requestAccess(to: .event) { (granted, error) in | |
if granted == false { | |
DispatchQueue.main.async { | |
self.tellNoPermission() } | |
return |
This file contains hidden or 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 Animator { | |
var view = UIView() | |
lazy var dropZone = self.makeDropZone() | |
var dragImageView: UIImageView? | |
var startPoint = CGPoint.zero | |
var recognizer: UILongPressGestureRecognizer? | |
private func makeDropZone() -> UIView { | |
let dropZoneEdge = 250 | |
let dropZoneMissingEdge: CGFloat = 50 |
This file contains hidden or 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
extension UIView { | |
static let loadingViewTag = 1938123987 | |
func showLoading(style: UIActivityIndicatorView.Style = .gray, color: UIColor? = nil, scale: CGFloat = 1) { | |
var loading = viewWithTag(UIView.loadingViewTag) as? UIActivityIndicatorView | |
if loading == nil { | |
loading = UIActivityIndicatorView(style: style) | |
} | |
loading?.scale(value: scale) | |
if let color = color { | |
loading?.color = color |
This file contains hidden or 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
// | |
// UITextField.swift | |
// kLibrary | |
// | |
// Created by Ky Nguyen on 8/27/16. | |
// Copyright © 2016 Ky Nguyen. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or 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
// Online C++ compiler to run C++ program online | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
struct Sach | |
{ | |
string id; | |
string tenSach; | |
string tacGia; |
OlderNewer