Close Menu
Technotification
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Technotification
    • Home
    • News
    • How To
    • Explained
    • Facts
    • Lists
    • Programming
    • Security
    • Gaming
    Technotification
    Home › Programming › 5 New Features and Updates in Swift 5 Every Developer Should Know

    5 New Features and Updates in Swift 5 Every Developer Should Know

    By Subham KapisweJuly 15, 2019
    Facebook Twitter Reddit LinkedIn
    swift

    A new version of Swift programming language is here. After the Objective-C, it’s the ‘second’ official language for app development in the Apple ecosystem.

    Swift 5.0 brings several new features such as ABI Stability and other functions. The latest version comes with updated package manager and compiler. Today, I will share some major features and other updates every mobile developer should know.

    Read: Why You Should Learn Swift Programming Language?

    Contents

    • Swift 5 Important Features and Changes
      • 1. ABI Stability
      • 2. Integer Multiples With “isMultiple(of)”
      • 3. Filter And Count With “count(where)”
      • 4. Package Manager Updates
      • 5. Other Language and Compiler Updates
    • Ending Words

    Swift 5: Important Features and Changes

    1. ABI Stability

    ABI stands for Application Binary Interface, a binary equivalent of an API. It aims to make future apps easier to build and a lot smaller in size.

    As you might know, most of the codes written in apps are already available as part of iOS, frameworks, and libraries. With ABI, a user won’t have to download all the application code. The app will just have to use the binary code already present and that’s it.

    2. Integer Multiples With “isMultiple(of:)”

    Swift 5 comes with a new function isMultiple(of:) for testing if a given integer is a multiple of another number. This function is free from redundancy and thus improves the readability of the code. Regardless to say, it’s now also discoverable by the auto-complete feature of XCode.

    Sample Usage:

    let number = 42
    if number.isMultiple(of: 2) {
    print("\(number) is even!")
    }

    3. Filter And Count With “count(where:)”

    The problems with current collection functions such as map(_:), reduce(_:) and filter(_:) are — they make the code too verbose and wasteful. Even if we just want to count, we need to filter first, and this is where ‘count(where:) comes in. This function allows us to filter and count with just one function call.

    Sample Usage:

    let scores = [1, 3, 8, 2, 5, 6, 2, 10]
    let count = scores.count(where: { $0 > 5 })
    print(count)
    
    Output = 3

    Also Read: Android Development vs iOS Development: Which one is Better?

    4. Package Manager Updates

    Swift 5 brings a number of updates in Swift Package Manager. It includes target-specific build settings, customized deployment targets, dependency mirroring, etc.

    It now allows you to import libraries in a REPL using the run command without thinking about building an executable.

    5. Other Language and Compiler Updates

    Swift 5 comes with Exclusivity Enforcement by defaults. It allows exclusive access to memory for both debug and release builds. Swift 5 supports dynamic callable types and helps improve interoperability with languages like JavaScript, Python, and Ruby.

    Some other updates include Literal initialization via coercion, Identity key path, etc.

    Recommended: An Introduction to Functions in Swift Programming Language

    Ending Words

    Overall, Swift 5 comes with lightweight syntax and combines powerful type inference and pattern matching. If you’re impressed by the features of Swift 5 and looking for migration, there’s nothing to worry about.

    You can just use the XCode 10.2’s code migrator and it will handle the rest automatically. Swift 5 is compatible with Swift 4, Swift 4.1 and Swift 4.2. So, which features of Swift 5 you liked the most? Do let us know in the comments below.

    Share. Facebook Twitter LinkedIn Tumblr Reddit Telegram WhatsApp
    Subham Kapiswe
    • LinkedIn

    A computer science engineer by education and blogger by profession who loves to write about Programming, Cybersecurity, Blockchain, Artificial Intelligence, Open Source and other latest technologies.

    Related Posts

    The Best Python Libraries for Data Visualization in 2025

    April 1, 2025

    Is C++ Still Relevant in 2025 and Beyond?

    February 20, 2025

    5 Best Programming Languages for Machine Learning in 2025

    February 18, 2025

    10 Must-Have Chrome Extensions for Web Developers in 2025

    February 17, 2025

    Difference Between C, C++, C#, and Objective-C Programming

    February 16, 2025

    How to Learn Programming Faster and Smarter in 2025

    February 14, 2025
    Lists You May Like

    10 Best RARBG Alternative Sites in April 2025 [Working Links]

    April 1, 2025

    10 Sites to Watch Free Korean Drama [2025 Edition]

    January 2, 2025

    The Pirate Bay Proxy List in 2025 [Updated List]

    January 2, 2025

    10 Best Torrent Search Engine Sites (2025 Edition)

    February 12, 2025

    10 Best GTA V Roleplay Servers in 2025 (Updated List)

    January 6, 2025

    5 Best Torrent Sites for Software in 2025

    January 2, 2025

    1337x Alternatives, Proxies, and Mirror Sites in 2025

    January 2, 2025

    10 Best Torrent Sites for eBooks in 2025 [Working]

    January 2, 2025

    10 Best Anime Torrent Sites in 2025 [Working Sites]

    January 6, 2025

    Top Free Photo Editing Software For PC in 2025

    January 2, 2025
    Pages
    • About
    • Contact
    • Privacy
    • Careers
    Privacy

    Information such as the type of browser being used, its operating system, and your IP address is gathered in order to enhance your online experience.

    © 2013 - 2025 Technotification | All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.