I hear ya @thnkwww! Let’s go back into our “How to Play a Sounds in Swift” and let’s shrink that duplicate code!
In this One Minute, we will show you how we moved the ‘Do Catch’ block into its own Function to reduce the duplicated code.
(…𝘢𝘯𝘥 𝘺𝘦𝘴, 𝘐 𝘭𝘦𝘧𝘵 𝘵𝘩𝘦 𝘶𝘳𝘭 𝘰𝘶𝘵 𝘵𝘩𝘦𝘳𝘦 𝘵𝘰 𝘮𝘢𝘬𝘦 𝘮𝘺 𝘧𝘶𝘯𝘤𝘵𝘪𝘰𝘯 𝘯𝘪𝘤𝘦 𝘢𝘯𝘥 𝘱𝘳𝘦𝘵𝘵𝘺 𝘣𝘶𝘵 𝘧𝘦𝘦𝘭 𝘧𝘳𝘦𝘦 𝘵𝘰 𝘮𝘰𝘷𝘦 𝘪𝘵 𝘪𝘯𝘵𝘰 𝘵𝘩𝘦 𝘧𝘶𝘯𝘤𝘵𝘪𝘰𝘯 𝘵𝘰𝘰!)
Created and Edited by @AdrienVillez
Music: @declandpmusic
“Forward" by Declan DP - / declandp
Licensing Agreement 2.0 - http://www.declandp.info/music-licensing
#OneMinute #SwiftMinute #SwiftSnack
Watch video How to Simplify Code in One Minute online without registration, duration hours minute second in high quality. This video was added by user CodeWithChris 19 October 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,554 once and liked it 94 people.