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
| #!/usr/bin/env bash | |
| rm -rf "${HOME}/Library/Caches/CocoaPods" | |
| rm -rf "`pwd`/Pods/" | |
| pod update |
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 UIViewController { | |
| func topMostViewController() -> UIViewController { | |
| if self.presentedViewController == nil { | |
| return self | |
| } | |
| if let navigation = self.presentedViewController as? UINavigationController { | |
| return navigation.visibleViewController.topMostViewController() | |
| } | |
| if let tab = self.presentedViewController as? UITabBarController { | |
| if let selectedTab = tab.selectedViewController { |
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
| UIFont.familyNames.forEach({ familyName in | |
| let fontNames = UIFont.fontNames(forFamilyName: familyName) | |
| print(familyName, fontNames) | |
| }) |
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
| /* | |
| Example of how to create a view that has rounded corners and a shadow. | |
| These cannot be on the same layer because setting the corner radius requires masksToBounds = true. | |
| When it's true, the shadow is clipped. | |
| It's possible to add sublayers and set their path with a UIBezierPath(roundedRect...), but this becomes difficult when using AutoLayout. | |
| Instead, we a containerView for the cornerRadius and the current view for the shadow. | |
| All subviews should just be added and constrained to the containerView | |
| */ | |
| 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
| import Foundation | |
| extension UIView { | |
| func height(constant: CGFloat) { | |
| setConstraint(value: constant, attribute: .height) | |
| } | |
| func width(constant: CGFloat) { | |
| setConstraint(value: constant, attribute: .width) | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.