#even though theyre not like the nasty abuse ones. its because capturing the uncanny valley is so important
Explore tagged Tumblr posts
Text
THE 50 THOUSAND WORD MARK HAS BEEN BREACHED I REPEAT THE FIFTY THOUSAND WORD MARK HAS BEEN BREACHED
#personal#canary continuity#when it comes to the first draft im very sure i wont be crossing 55k words#but that doesnt mean its not going to end up longer than that because i need to lengthen several scenes#and yes i actually think i might need to make it slower in some places. even though i have just crossed fifty thousand words#the last 25 thousand words of this is just a dissociative psychotic break so stay tuned for that#my highest estimate was a lot larger than how it turned out but like. GOOD. i do not need to make a novel length fanfiction#(ignoring that 50k is the minimum length of a novel and this is like 140 pages long)#i mostly have to do some of the earlier scenes which are the ones i have to be more delicate with#even though theyre not like the nasty abuse ones. its because capturing the uncanny valley is so important#ill probably be heavily editing them after i finish the first draft#sorry ive been yapping about my progress so much btw i do Not share my fic with my friends for personal reasons (intense paranoia disorder)#so this is my thought dumping ground. also i just love babbling about writing
5 notes
·
View notes
Text
Async Await
Async Await is a feature introduced in Swift 5.5 that allows developers to write asynchronous code in a synchronous style. This means that we can use the async and await keywords to write asynchronous code that looks like synchronous code.
Implementing a Generic Network Request using Async Await
To implement a generic network request using async await on Swift for iOS, we will follow these steps:
Create a Result type that can hold the response of the network request.
enum Result { case success(T) case failure(Error) }
Swift
Create a fetch function that takes a URL and returns a Result type.
Swift
Call the fetch function and handle the Result type.
Swift
Using Combine
We can also implement a generic network request using Combine, which is a framework that provides a declarative Swift API for processing values over time. To implement a generic network request using Combine, we will follow these steps:
Create a fetch function that takes a URL and returns a AnyPublisher type.
Swift
Call the fetch function and handle the AnyPublisher type.
Swift
Using Completion Blocks
We can also implement a generic network request using completion blocks, which is a traditional way of handling asynchronous code in iOS. To implement a generic network request using completion blocks, we will follow these steps:
Create a fetch function that takes a URL and a completion block.
Swift
Call the fetch function and handle the Result type.
Swift
Conclusion
In this tutorial, we learned how to implement a generic network request using async await on Swift for iOS. We also discussed the differences between implementing this using Combine and completion blocks. Depending on the use case, you can choose the best approach that fits your needs.
Source: Implementing a generic network request using async await, Combine and Completion blocks.
2 notes
·
View notes