mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +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
@@ -9,12 +9,12 @@
|
||||
// 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.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// 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.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#import "RandomCoreGraphicsNode.h"
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
@implementation RandomCoreGraphicsNode
|
||||
|
||||
@synthesize indexPath=_indexPath;
|
||||
@synthesize indexPath = _indexPath;
|
||||
|
||||
+ (UIColor *)randomColor
|
||||
{
|
||||
@@ -48,8 +48,7 @@
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)colors, locations);
|
||||
|
||||
CGGradientDrawingOptions drawingOptions;
|
||||
CGContextDrawLinearGradient(ctx, gradient, CGPointZero, CGPointMake(bounds.size.width, bounds.size.height), drawingOptions);
|
||||
CGContextDrawLinearGradient(ctx, gradient, CGPointZero, CGPointMake(bounds.size.width, bounds.size.height), 0);
|
||||
|
||||
CGGradientRelease(gradient);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
@@ -69,8 +68,19 @@
|
||||
|
||||
- (void)setIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
_indexPath = indexPath;
|
||||
_indexPathTextNode.attributedText = [[NSAttributedString alloc] initWithString:[indexPath description] attributes:nil];
|
||||
@synchronized (self) {
|
||||
_indexPath = indexPath;
|
||||
_indexPathTextNode.attributedText = [[NSAttributedString alloc] initWithString:[indexPath description] attributes:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSIndexPath *)indexPath
|
||||
{
|
||||
NSIndexPath *indexPath = nil;
|
||||
@synchronized (self) {
|
||||
indexPath = _indexPath;
|
||||
}
|
||||
return indexPath;
|
||||
}
|
||||
|
||||
- (void)layout
|
||||
|
||||
Reference in New Issue
Block a user