Skip to content

Commit 3cd9413

Browse files
authored
Merge pull request #124 from sunshinejr/example-swift-aseditabletextnode
[ASEditableTextNode/ASMultiplexImageNode] Update Swift examples.
2 parents 81aaf94 + c585b15 commit 3cd9413

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

docs/_docs/editable-text-node.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ editableTextNode.typingAttributes = @{NSForegroundColorAttributeName: [UIColor b
6969
</pre>
7070

7171
<pre lang="swift" class = "swiftCode hidden">
72-
editableTextNode.typingAttributes = [NSForegroundColorAttributeName: UIColor.blueColor(),
73-
NSBackgroundColorAttributeName: UIColor.redColor()]
72+
editableTextNode.typingAttributes = [NSForegroundColorAttributeName: UIColor.blue,
73+
NSBackgroundColorAttributeName: UIColor.red]
7474
</pre>
7575
</div>
7676
</div>

docs/_docs/multiplex-image-node.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Then, assign an array of keys to the property `imageIdentifiers`. This list sho
3737
init(urls: [String: NSURL]) {
3838
imageURLs = urls
3939

40-
multiplexImageNode = ASMultiplexImageNode(cache: nil, downloader: ASBasicImageDownloader.sharedImageDownloader())
40+
multiplexImageNode = ASMultiplexImageNode(cache: nil, downloader: ASBasicImageDownloader.shared())
4141
multiplexImageNode.downloadsIntermediateImages = true
4242
multiplexImageNode.imageIdentifiers = ["original", "medium", "thumb" ]
4343

@@ -67,7 +67,7 @@ Then, if you've set up a simple dictionary that holds the keys you provided earl
6767
</pre>
6868

6969
<pre lang="swift" class = "swiftCode hidden">
70-
func multiplexImageNode(imageNode: ASMultiplexImageNode, URLForImageIdentifier imageIdentifier: ASImageIdentifier) -> NSURL? {
70+
func multiplexImageNode(_ imageNode: ASMultiplexImageNode, urlForImageIdentifier imageIdentifier: ASImageIdentifier) -> URL? {
7171
return imageURLs[imageIdentifier]
7272
}
7373
</pre>
@@ -96,11 +96,11 @@ For example, in the case that you want to react to the fact that a new image arr
9696
</pre>
9797

9898
<pre lang="swift" class = "swiftCode hidden">
99-
func multiplexImageNode(imageNode: ASMultiplexImageNode,
100-
didUpdateImage image: UIImage?,
101-
withIdentifier imageIdentifier: ASImageIdentifier?,
102-
fromImage previousImage: UIImage?,
103-
withIdentifier previousImageIdentifier: ASImageIdentifier?) {
99+
func multiplexImageNode(_ imageNode: ASMultiplexImageNode,
100+
didUpdate image: UIImage?,
101+
withIdentifier imageIdentifier: ASImageIdentifier?,
102+
from previousImage: UIImage?,
103+
withIdentifier previousImageIdentifier: ASImageIdentifier?) {
104104
// this is optional, in case you want to react to the fact that a new image came in
105105
}
106106
</pre>

0 commit comments

Comments
 (0)