- Install Docker Desktop for Mac
- Download the
unifi-controller
container.
docker pull linuxserver/unifi-controller
system_profiler SPPowerDataType | grep Voltage; system_profiler SPPowerDataType | grep Amper |
extension UIColor { | |
/// Change the color of a template image | |
/// Used in interface elements and icons | |
/// - Parameter tintColor: UIColor to tint | |
func imageWithColor(tintColor: UIColor) -> UIImage { | |
UIGraphicsBeginImageContextWithOptions(self.size, false, self.scale) | |
tintColor.setFill() | |
let context = UIGraphicsGetCurrentContext() | |
context?.translateBy(x: 0, y: self.size.height) |
unifi-controller
container.docker pull linuxserver/unifi-controller
//Modified from: | |
//http://swiftquickstart.blogspot.com/2016/10/adding-done-button-to-keyboard.html | |
extension UITextField { | |
func addKeyboardDoneButton() { | |
let keyboardToolBar = UIToolbar() | |
keyboardToolBar.sizeToFit() | |
let flexibleSpace = UIBarButtonItem(barButtonSystemItem: | |
UIBarButtonItem.SystemItem.flexibleSpace, target: nil, action: nil) | |
let doneButton = UIBarButtonItem(barButtonSystemItem: |
Medium post with a ton of resources | |
https://medium.com/swlh/5-tools-to-speed-up-your-app-development-6979d0e49e34 | |
Repo full of awesome swift projects | |
https://github.com/vsouza/awesome-ios | |
Cool UIKit designs | |
https://www.invisionapp.com/inside-design/design-resources/now/ | |
https://www.invisionapp.com/inside-design/design-resources/tethr/ | |
https://www.sketchappsources.com/free-source/attachment-1722-phoenix-ui-kit-sketch-freebie-resource-img2.html |
extension Date { | |
func timeAgoSinceDate() -> String { | |
// From Time | |
let fromDate = self | |
// To Time | |
let toDate = Date() | |
let time = Calendar.current.dateComponents([.month, .day, .hour, .minute, .second], from: fromDate, to: toDate) |
import Foundation | |
import UIKit | |
let json = """ | |
[{ | |
"first_name": "Shakti", | |
"last_name": "prakash", | |
"age":25, | |
"address":"Cuttack,Odisha,India" | |
}, |
extension UIViewController { | |
func topPresentedViewController() -> UIViewController? { | |
var topViewController: UIViewController? = self | |
while true { | |
if topViewController?.presentedViewController != nil { | |
topViewController = topViewController?.presentedViewController | |
} else { | |
return topViewController | |
} | |
} |
(lldb) expr CATransaction.flush() | |
// This simple command will update your UI on your device while you are at a breakpoint. |
// When you rotate a screen, prevent animations and just snap into place | |
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { | |
coordinator.animate(alongsideTransition: nil) { _ in | |
UIView.setAnimationsEnabled(true) | |
} | |
UIView.setAnimationsEnabled(false) | |
super.viewWillTransition(to: size, with: coordinator) | |
} |