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 | |
extension UIScrollView { | |
func scrollToView(view:UIView, animated: Bool, navigationHeight: CGFloat?) { | |
let childStartPoint = view.frame.origin | |
let height = (navigationHeight ?? 0) * 2 + 16 | |
self.scrollRectToVisible( | |
CGRect(x: 0, | |
y: childStartPoint.y - height, | |
width: 1, |
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
NSArray* reversedArray = [[startArray reverseObjectEnumerator] allObjects]; |
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
extension UIColor { | |
convenience init(hex: String) { | |
let scanner = Scanner(string: hex) | |
scanner.scanLocation = 0 | |
var rgbValue: UInt64 = 0 | |
scanner.scanHexInt64(&rgbValue) | |
let r = (rgbValue & 0xff0000) >> 16 |
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 { | |
@IBOutlet weak var tableView: UITableView! | |
@IBOutlet weak var heightTableView: NSLayoutConstraint! | |
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
tableView.addObserver(self, | |
forKeyPath: "contentSize", | |
options: .new, | |
context: nil) |
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 | |
class InterctiveLabel: UILabel { | |
override var canBecomeFirstResponder: Bool { | |
return true | |
} | |
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { | |
self.backgroundColor = UIColor(hex: "EEEEEE") |
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 | |
class MessageVC: UIViewController { | |
@IBOutlet weak var textViewMessage: UITextView! | |
@IBOutlet weak var heightMessage: NSLayoutConstraint! | |
@IBOutlet var viewMessage: UIView! // the view that will be attached to the keyboard | |
var messageVM: MessageViewModel! | |
let MESSAGE_INITIAL_SIZE: CGFloat = 44 |
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
// | |
// CsvMapper.swift | |
// | |
// Created by Tiago Do Couto on 3/25/18. | |
// Copyright © 2018 CoutoCode. All rights reserved. | |
// | |
import Foundation | |
open class CsvMapper { |
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 android.annotation.TargetApi | |
import android.content.Context | |
import android.os.Build | |
import android.util.AttributeSet | |
import android.widget.RelativeLayout | |
/** | |
* Created by docouto on 4/9/18. | |
*/ |
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
/* | |
* Copyright (c) 2018. Couto Code | |
*/ | |
package com.coutocode.allgifts.Utils | |
/** | |
* Created by docouto on 4/17/18. | |
*/ |
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 | |
import ImageIO | |
fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool { | |
switch (lhs, rhs) { | |
case let (l?, r?): | |
return l < r | |
case (nil, _?): | |
return true |
OlderNewer