mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[Examples] Fix a couple of examples due to API changes recently #trivial (#267)
* Fix ASDKGram example * Fix some more examples * Convert Swift example to 3.0 * Fix VerticalWithinHorizontalScrolling * Fix some headers * Fix some more API changes * Remove semicolons
This commit is contained in:
committed by
GitHub
parent
9d84b9e635
commit
299df0aa8c
@@ -4,8 +4,9 @@
|
||||
//
|
||||
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree. An additional grant
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
// LICENSE file in the /ASDK-Licenses directory of this source tree. An additional
|
||||
// grant of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
// Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present,
|
||||
// Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +14,6 @@
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
@@ -49,9 +44,10 @@ class ViewController: ASViewController<ASCollectionNode>, MosaicCollectionViewLa
|
||||
}
|
||||
}
|
||||
|
||||
_collectionNode.dataSource = self;
|
||||
_collectionNode.delegate = self;
|
||||
_collectionNode.backgroundColor = UIColor.white
|
||||
_collectionNode.dataSource = self
|
||||
_collectionNode.delegate = self
|
||||
_collectionNode.layoutInspector = _layoutInspector
|
||||
_collectionNode.registerSupplementaryNode(ofKind: UICollectionElementKindSectionHeader)
|
||||
}
|
||||
|
||||
@@ -59,14 +55,8 @@ class ViewController: ASViewController<ASCollectionNode>, MosaicCollectionViewLa
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
deinit {
|
||||
_collectionNode.dataSource = nil;
|
||||
_collectionNode.delegate = nil;
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
_collectionNode.view.layoutInspector = _layoutInspector
|
||||
_collectionNode.view.isScrollEnabled = true
|
||||
}
|
||||
|
||||
@@ -84,7 +74,7 @@ class ViewController: ASViewController<ASCollectionNode>, MosaicCollectionViewLa
|
||||
let textInsets = UIEdgeInsets(top: 11, left: 0, bottom: 11, right: 0)
|
||||
let textCellNode = ASTextCellNode(attributes: textAttributes as! [AnyHashable : Any], insets: textInsets)
|
||||
textCellNode.text = String(format: "Section %zd", indexPath.section + 1)
|
||||
return textCellNode;
|
||||
return textCellNode
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user