import UIKit
extension UIView {
func startShimmering() {
let light = self.tintColor.cgColor
let dark = UIColor(white: 0, alpha: 0.3).cgColor
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 ViewController { | |
| @objc func handleKeyboardWillShow(notification: Notification) { | |
| guard notification.name == UIResponder.keyboardWillShowNotification else { | |
| return | |
| } | |
| guard let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect else { return } | |
| let viewFrame = self.view.frame | |
| let newRect = self.view.convert(self.view.frame, to: self.view.window) | |
| print("KeyboardFrame: \(keyboardFrame)") |
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
| // | |
| // main.swift | |
| // Calculator | |
| // | |
| // Created by NeilsUltimateLab on 03/06/18. | |
| // Copyright © 2018 NeilsUltimateLab. All rights reserved. | |
| // | |
| import Foundation |
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
| protocol SectionProviderProtocol { | |
| associatedtype T | |
| var header: String? { get } | |
| var rows: [T] { get } | |
| } | |
| extension Array where Element: SectionProviderProtocol, Element.T: Equatable { | |
| var indexPaths: [IndexPath] { | |
| var paths: [IndexPath] = [] | |
| for (section, item) in self.enumerated() { |
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
| Up key: 2011254800 | |
| Down key: 2011246608 | |
| Left key: 2011271184 | |
| Right key:2011258896 | |
| Menu key: 2011283472 | |
| PlayPause key: 2011298320 2011275280 |
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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| let errorJsonData = """ | |
| { | |
| "message": "The message", | |
| "reference_url": "https://www.api.refer.co" | |
| } | |
| """.data(using: .utf8)! |
To enable the rotation of a single view controller used to display the preview of Images/Videos. It is intuitive to allow user to rotate there device and screen changes accordingly, so it feels pleasant. But to achieve this, we need to enable the (almost) all Supported Device orientations.
Ex: `Portrait`, `LandscapeLeft`, `LandscapeRight`.
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
| // | |
| // SystemAppType.swift | |
| // REIWA | |
| // | |
| // Created by Neil Jain on 19/03/18. | |
| // Copyright © 2018 NeilsUltimateLab. All rights reserved. | |
| // | |
| import Foundation |
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
| import UIKit | |
| class SelectionTableCell: UITableViewCell { | |
| override init(style: UITableViewCellStyle, reuseIdentifier: String?) { | |
| super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| self.selectionStyle = .none | |
| } | |
| required init?(coder aDecoder: NSCoder) { |
NewerOlder