- Create a new file CNAME and put the domain.com in the file.
- Login GoDaddy > Manage domain > DNS Zone File.
- Under A (Host) change @ point to 192.30.252.153.
- Under CName (Alias) change www point to website.github.io.
see also GitHub Pages + GoDaddy
// Create CustomView.xib, set File's Owner to CustomView. | |
// Link the top level view in the XIB to the contentView outlet. | |
class CustomView : UIView { | |
@IBOutlet private var contentView:UIView? | |
// other outlets | |
override init(frame: CGRect) { // for using CustomView in code | |
super.init(frame: frame) | |
self.commonInit() |
see also GitHub Pages + GoDaddy
import Foundation | |
import QuartzCore | |
/// Calculates elapsed time. | |
/// | |
/// Typical usage is to construct an instance at the start of an operation, | |
/// and then call `elapsedTimeInterval()` or `elapsedTimeString()` at | |
/// the end to determine how much time has passed. | |
/// | |
/// The underlying time reference is `mach_absolute_time()` |
import QuartzCore | |
func executionTimeInterval(block: () -> ()) -> CFTimeInterval { | |
let start = CACurrentMediaTime() | |
block(); | |
let end = CACurrentMediaTime() | |
return end - start | |
} |
extension UIViewController { | |
func rz_smoothlyDeselectRows(tableView tableView: UITableView?) { | |
let selectedIndexPaths = tableView?.indexPathsForSelectedRows ?? [] | |
if let coordinator = transitionCoordinator() { | |
coordinator.animateAlongsideTransitionInView(parentViewController?.view, animation: { context in | |
selectedIndexPaths.forEach { | |
tableView?.deselectRowAtIndexPath($0, animated: context.isAnimated()) | |
} |
- (UIViewController *)topViewController{ | |
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; | |
} | |
- (UIViewController *)topViewController:(UIViewController *)rootViewController | |
{ | |
if (rootViewController.presentedViewController == nil) { | |
return rootViewController; | |
} | |