mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-28 11:46:28 +08:00
Revert "[Layout] Layout API based on content area (#2110)"
This reverts commit 8897614f0e.
This commit is contained in:
@@ -25,7 +25,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
let window = UIWindow(frame: UIScreen.mainScreen().bounds)
|
||||
window.backgroundColor = UIColor.whiteColor()
|
||||
window.rootViewController = UINavigationController(rootViewController: ViewController());
|
||||
window.rootViewController = ViewController()
|
||||
window.makeKeyAndVisible()
|
||||
self.window = window
|
||||
return true
|
||||
|
||||
@@ -54,8 +54,7 @@ final class SpinnerNode: ASDisplayNode {
|
||||
|
||||
override init() {
|
||||
super.init(viewBlock: { UIActivityIndicatorView(activityIndicatorStyle: .Gray) }, didLoadBlock: nil)
|
||||
|
||||
size.minHeight = ASDimensionMakeWithPoints(44.0)
|
||||
preferredFrameSize.height = 32
|
||||
}
|
||||
|
||||
override func didLoad() {
|
||||
|
||||
@@ -127,15 +127,14 @@ final class ViewController: ASViewController, ASTableDataSource, ASTableDelegate
|
||||
/// (Pretend) fetches some new items and calls the
|
||||
/// completion handler on the main thread.
|
||||
private static func fetchDataWithCompletion(completion: (Int) -> Void) {
|
||||
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(NSTimeInterval(NSEC_PER_SEC) * 1.0))
|
||||
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(NSTimeInterval(NSEC_PER_SEC) * 0.5))
|
||||
dispatch_after(time, dispatch_get_main_queue()) {
|
||||
let resultCount = Int(arc4random_uniform(20))
|
||||
completion(resultCount)
|
||||
}
|
||||
}
|
||||
|
||||
private static func handleAction(action: Action, fromState state: State) -> State {
|
||||
var state = state
|
||||
private static func handleAction(action: Action, var fromState state: State) -> State {
|
||||
switch action {
|
||||
case .BeginBatchFetch:
|
||||
state.fetchingMore = true
|
||||
|
||||
Reference in New Issue
Block a user