<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dino Bozic on Medium]]></title>
        <description><![CDATA[Stories by Dino Bozic on Medium]]></description>
        <link>https://medium.com/@dino-bozic?source=rss-e26c12d2644------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*3p6Bh2mdnq4S0utt.jpg</url>
            <title>Stories by Dino Bozic on Medium</title>
            <link>https://medium.com/@dino-bozic?source=rss-e26c12d2644------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 18 Oct 2026 22:40:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dino-bozic/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Unleashing the Power of Web3 and Blockchain in iOS — Part 1]]></title>
            <link>https://medium.com/azikus/unleashing-the-power-of-web3-and-blockchain-in-ios-part-1-e990ae04eb44?source=rss-e26c12d2644------2</link>
            <guid isPermaLink="false">https://medium.com/p/e990ae04eb44</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Dino Bozic]]></dc:creator>
            <pubDate>Wed, 22 May 2024 14:46:18 GMT</pubDate>
            <atom:updated>2024-05-23T13:11:13.090Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unleashing the Power of Web3 and Blockchain in iOS — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EKSHBJPDcxkuX6eKY7r1OQ.jpeg" /></figure><blockquote><strong>Embracing the Future with Web3 and Blockchain in Swift &amp; iOS Development<br>Part 1</strong></blockquote><p>In the dynamic landscape of mobile app development, staying ahead means embracing emerging technologies that redefine the way we interact with digital platforms. Enter <strong>Web3</strong> and <strong>blockchain</strong> — revolutionary forces reshaping the internet as we know it. As iOS developers, harnessing the power of <strong>Swift</strong>, Apple’s sophisticated programming language, we have the opportunity to pioneer the integration of Web3 and blockchain into the iOS ecosystem.</p><p><strong>Web3</strong> represents a paradigm shift towards a <strong>decentralized</strong> internet, where users have greater control over their data and interactions. At the core of this evolution lies blockchain technology, offering immutable ledgers, smart contracts, and cryptographic security. The potential applications of Web3 and blockchain in iOS development are as diverse as they are exciting, from decentralized applications (<em>DApps</em>) revolutionizing finance and gaming to <strong>NFT</strong> marketplaces redefining digital ownership.</p><p>This initial article serves as an <strong>introductory</strong> guide, outlining the essential components of blockchain technology and how they can be utilized in iOS environments. As we delve deeper into this series, I will provide practical examples involving NFTs and showcase a real-world application to demonstrate how these technologies can be innovatively applied in iOS apps. This sequence aims not only to educate but also to inspire iOS developers to explore the burgeoning possibilities of blockchain technology in their projects.</p><p>Stay tuned for <strong>part two</strong>, where we turn theory into practice with engaging, hands-on demonstrations.</p><p>Whether you’re a seasoned iOS developer or a newcomer eager to explore the cutting-edge of technology, this exploration of Web3 and blockchain in Swift &amp; iOS development promises to ignite your creativity and propel you towards the forefront of digital innovation.</p><h3><strong>Key definitions</strong></h3><p><strong>Web3</strong> - Web3 refers to the next generation of the internet, characterized by decentralized protocols and applications that prioritize user sovereignty and data ownership. Unlike Web2, which relies heavily on centralized platforms and intermediaries, Web3 aims to empower individuals by enabling direct <strong>peer-to-peer</strong> interactions and fostering trust through cryptographic principles. In essence, Web3 represents a shift towards a more open, transparent, and inclusive internet where users have greater control over their digital identities, assets, and interactions.</p><p><strong>Blockchain -</strong> Blockchain is a distributed ledger technology that enables the secure and transparent recording of transactions across a network of computers. At its core, a blockchain consists of a chain of blocks, each containing a list of transactions cryptographically linked to the preceding block. This immutable structure ensures that once a transaction is recorded, it cannot be altered or tampered with, thus providing a high degree of trust and security. Blockchains can be public, allowing anyone to participate in the network (e.g., Bitcoin), or permissioned, where access is restricted to certain entities (e.g., enterprise blockchains). Blockchain technology finds applications in various fields, including finance, supply chain management, voting systems, and decentralized applications (DApps).</p><p><strong>Decentralization -</strong> Decentralization refers to the distribution of power, authority, or control across a network of nodes or participants, rather than concentrating it in a single central authority or entity. In decentralized systems, decision-making processes and resource allocation are distributed among multiple participants, often through consensus mechanisms, without relying on a central intermediary. Decentralization can foster transparency, resilience, and democratization by reducing single points of failure, mitigating censorship, and empowering individuals to have greater autonomy and sovereignty over their data and interactions. This concept is fundamental to various technologies and movements, including blockchain, Web3, decentralized finance (<strong>DeFi</strong>), and decentralized autonomous organizations (<strong>DAOs</strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TgCqsXUHJO3cjOusSjRsaA.jpeg" /><figcaption>Centralized vs decentralized visualisation</figcaption></figure><p><strong>Smart contracts </strong>- Self-executing contracts with the terms of the agreement directly written into code. They automatically execute and enforce the terms of the contract when predefined conditions are met, without the need for intermediaries.</p><p><em>Worthy mentions: </em><br><strong>Non-Fungible Tokens (NFTs) -</strong> Unique digital assets stored on a blockchain, representing ownership of a specific item, artwork, or collectible. Unlike cryptocurrencies such as Bitcoin or Ethereum, NFTs are not interchangeable, as each token has its own distinct value and properties.</p><p><strong>Decentralized Finance (DeFi)</strong>: A financial system built on blockchain technology that aims to recreate traditional financial services (such as lending, borrowing, trading, and investing) in a decentralized manner, without relying on intermediaries like banks or brokerages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*OeYNjJmye3T2KiF9Q477HQ.jpeg" /><figcaption>Bored Ape Yacht Club, infamous NFT collection</figcaption></figure><h3>Web3 in iOS apps</h3><p>By leveraging blockchain technology, iOS apps can offer <strong>decentralized</strong> and <strong>transparent</strong> solutions that do not rely on <strong>central authorities</strong>. This enhances trust among users by ensuring that data and transactions are immutable and verifiable.</p><p>Next to that, blockchain technology provides robust <strong>security</strong> features such as cryptographic encryption and decentralized consensus mechanisms. This helps in safeguarding user data and preventing unauthorized access or tampering, which is crucial for maintaining <strong>user privacy</strong> and <strong>protecting sensitive information</strong>.</p><p>Web3 and blockchain iOS apps empower users by giving them greater control over their digital assets, identities, and interactions. Through features like self-sovereign identity and ownership of digital assets (such as NFTs), users can have more <strong>autonomy</strong> and agency in the digital realm.</p><p>Building blockchain and Web3 iOS apps opens up opportunities for <strong>innovation</strong> and <strong>disruption</strong> across various industries. From a decentralized finance (<strong>DeFi</strong>) to supply chain management, gaming, healthcare, and beyond, these apps can revolutionize traditional systems and create new paradigms of interaction and value exchange.</p><p>Embracing blockchain and Web3 technologies in iOS app development helps future-proof apps against evolving technological trends and user preferences. As the Web3 ecosystem grows and matures, iOS apps that integrate these technologies will remain <strong>relevant</strong> and <strong>competitive</strong> in the rapidly changing digital landscape.</p><blockquote><strong>Q: </strong>How do I use Web3 in Swift?</blockquote><p>Here’s an overview of key concepts and components related to implementing Web3 in Swift:</p><p><strong><em>Blockchain Networks</em></strong> - Web3 in iOS allows developers to connect and interact with various blockchain networks such as <em>Ethereum</em>, <em>Bitcoin</em>, or other blockchain platforms that support the Web3 standards.</p><p><strong><em>Wallet integration</em></strong> enables users to manage their cryptocurrencies and interact with decentralized applications securely. Developers can implement features like creating wallets, importing/exporting wallets, and signing transactions within their iOS applications. This includes transactions for transferring cryptocurrencies, interacting with smart contracts, and executing other blockchain operations.</p><p><strong><em>Smart Contract Interaction</em></strong> - Web3 libraries enable iOS developers to interact with smart contracts deployed on blockchain networks. This includes functionalities like deploying smart contracts, calling methods, and listening to events emitted by smart contracts. They also handle communication with blockchain nodes and APIs. This includes sending and receiving transactions, querying blockchain data, and subscribing to real-time updates from the blockchain network.</p><h3>Libraries</h3><p>In iOS development, leveraging Web3 technologies is made accessible through libraries such as <strong>Web3.swift</strong>, <strong>EthereumKit</strong>, and <strong>web3swift</strong>.</p><blockquote><strong>Web3.swift<br></strong><a href="https://github.com/Boilertalk/Web3.swift">https://github.com/Boilertalk/Web3.swift</a></blockquote><p>With <strong>Web3.swift</strong>, developers gain a powerful toolkit for seamlessly integrating Ethereum-based functionalities into their iOS applications. Offering an intuitive interface and robust functionalities, Web3.swift empowers iOS developers to effortlessly engage with Ethereum-based blockchains. This library encompasses a wide array of capabilities, spanning transaction management, blockchain data querying, smart contract interaction, and Ethereum wallet management</p><blockquote><strong>EthereumKit<br></strong><a href="https://github.com/yuzushioh/EthereumKit">https://github.com/yuzushioh/EthereumKit</a></blockquote><p>Meanwhile, <strong>EthereumKit</strong> is a Swift framework designed to simplify the integration of Ethereum blockchain functionality into iOS applications. Tailored to streamline complex tasks, EthereumKit offers a range of features essential for iOS developers entering the realm of blockchain development. It facilitates seamless interaction with Ethereum nodes and smart contracts, enabling tasks such as transaction signing, data retrieval, and smart contract interactions. With EthereumKit, developers gain access to a suite of tools that streamline development, empowering them to create robust and efficient Ethereum-enabled iOS applications.</p><blockquote><strong>web3swift<br></strong><a href="https://github.com/web3swift-team/web3swift">https://github.com/web3swift-team/web3swift</a></blockquote><p>Additionally, <strong>web3swift</strong> provides a comprehensive solution for Ethereum wallet management, transaction handling, and smart contract interaction, empowering iOS developers to easily build decentralized applications.</p><p>Whether it’s interacting with smart contracts, sending transactions, or managing Ethereum wallets, these libraries offer essential building blocks for crafting innovative Web3 experiences within iOS environments.</p><p>Keep in mind that the Web3 ecosystem in Swift is still evolving, so you may need more support in these libraries. It’s essential to review the documentation, community support, and updates before integrating any library into your iOS project.</p><h3><strong>Web3 Platforms &amp; Data Providers</strong></h3><p>Exploring alternative avenues, iOS developers can effectively leverage blockchain technology by utilizing <strong><em>Web3 platforms and data providers</em></strong><em>.</em> These tools provide a robust foundation for seamlessly incorporating blockchain capabilities into iOS applications, enhancing functionality and user experience.</p><p>Integrating blockchain technology into iOS applications requires a robust infrastructure that can handle the unique complexities of blockchain data. Web3 data providers like <strong>Alchemy or Infura </strong>are pivotal in this integration, providing APIs that facilitate a seamless connection to blockchain networks. These providers enable iOS developers to implement a wide range of blockchain functionalities, including but not limited to, managing user wallets, executing smart contracts, and accessing detailed transaction histories.</p><p><a href="https://medium.com/alchemy-api/getting-started-with-ethereum-development-using-alchemy-c3d6a45c567f">🚀 Getting Started with Ethereum Development Using Alchemy</a></p><p>Furthermore, the use of these data providers not only enhances the functionality of iOS applications but also <strong>scales</strong> with the application as user <strong>demand</strong> increases. Providers like Alchemy boast high-performance <strong>node infrastructure</strong> which can handle increased queries as blockchain usage grows, without compromising the speed or reliability of the application.</p><blockquote><strong>Q: </strong>How to integrate data providers?</blockquote><p>Integrating blockchain technology into iOS applications can be achieved through the strategic use of Web3 providers by embedding them into the networking layer or the backend endpoints of the app. This approach enables iOS developers to harness the full potential of blockchain functionalities while ensuring the app remains responsive and user-friendly.</p><p>By incorporating Web3 data providers into the <strong>networking layer</strong> of an iOS app, developers can establish a <strong>direct line of communication</strong> with blockchain networks. This integration allows for real-time data retrieval and interaction with blockchain services, such as executing transactions or querying blockchain states, directly from the user’s device. Implementing Web3 at the networking layer means that blockchain data can be processed and handled at the same level as other network operations, ensuring that the data handling is seamless and efficient. It allows the application to maintain a consistent performance standard, managing blockchain interactions as part of its native network operations.</p><p>Alternatively, integrating Web3 functionalities at the <strong>backend</strong> allows for more complex operations and enhanced security measures. By handling blockchain interactions server-side, sensitive data and blockchain logic can be managed away from the client side, minimizing security risks associated with client-side exposure. Backend integration involves setting up endpoints that interact with the blockchain, processing requests such as wallet management, smart contract deployment, and other blockchain-specific actions. These endpoints then serve the processed data to the iOS app as needed, similar to any other API service. This method not only secures the blockchain operations but also offloads the computational burden from the user’s device, leading to better app performance and lower latency in user interactions.</p><ul><li><a href="https://medium.com/alchemy-api/what-is-a-node-provider-and-why-do-i-need-alchemy-16e89b43bfda">What is a Blockchain Node Provider? Why Do I Need One?</a></li><li><a href="https://medium.com/what-is-infura/what-is-infura-59dbdd778455">What is Infura</a></li></ul><h3><strong>Ethereum transaction fundamentals</strong></h3><p>Understanding the key elements of Ethereum transactions can provide insight into how Ethereum operates and how it supports more complex operations like smart contracts. Here are the crucial components used in Ethereum transactions:</p><p><strong>Nonce</strong> - The nonce is a unique number assigned to each transaction sent from a specific Ethereum address. It serves as a way to ensure that each transaction is processed only once and in the correct order. The nonce starts at zero for each address and increments by one for each subsequent transaction sent from that address. This prevents replay attacks and ensures the integrity and order of transactions on the Ethereum blockchain.</p><p><strong>Gas Price</strong> - Gas is a unit used to measure the computational work required to execute operations on the Ethereum blockchain. Gas price refers to the amount of Ether (ETH) a user is willing to pay per unit of gas to have their transaction processed by miners. It essentially represents the <strong>transaction fee</strong> paid to incentivize miners to include the transaction in a block and process it. Transactions with higher gas prices are typically processed more quickly, as miners prioritize transactions with higher fees.</p><p><strong>Gas Limit</strong> - Gas limit specifies the maximum amount of gas that a sender is willing to consume for a transaction. It represents the upper bound on the computational resources (gas) that can be utilized to execute the transaction. If the execution of a transaction exceeds the specified gas limit, the transaction will fail, and any unused gas will be refunded to the sender. Setting an appropriate gas limit ensures that transactions do not exceed the sender’s resource constraints and protects against potential infinite loops or other resource-intensive operations.</p><p><strong>v, r, s (Signature Fields</strong>) - These fields make up the cryptographic signature generated from the private key of the sender, which is used to verify the authenticity of the transaction. The signature ensures that the transaction cannot be altered by anyone once it has been issued.</p><p><strong>Chain ID</strong> - Introduced in EIP-155 to prevent replay attacks across different Ethereum-based chains, the chain ID indicates which Ethereum network the transaction is intended for (e.g., mainnet, testnet).</p><p><strong>ABI Contract transaction - </strong>In the context of Ethereum, an <strong>ABI</strong> contract refers to the contract’s Application Binary Interface, which specifies the methods and parameters that can be used to interact with the contract.</p><p>An ABI contract essentially serves as a communication interface between Ethereum smart contracts and external applications or clients. It defines the structure of the contract, including its functions, inputs, outputs, and events. By adhering to the ABI specification, developers can ensure that their smart contracts can be properly understood and interacted with by external parties.</p><p>ABI contracts are typically generated from Solidity or other smart contract programming languages during the compilation process. They provide a standardized way for applications to interact with Ethereum smart contracts, enabling seamless integration and interoperability across the Ethereum ecosystem.</p><p><strong>Dynamic contracts - </strong>In blockchain terminology, dynamic contracts are smart contracts that possess the capability to adapt or modify their code or behavior over time. Unlike static contracts, which are fixed and unchangeable once deployed, dynamic contracts incorporate features that enable adjustments based on specific conditions or triggers.</p><p>Dynamic contracts often utilize functionalities such as upgradeability, allowing certain sections of the contract’s code to be substituted with new implementations, or parameterization, which enables flexible adjustments to behavior without altering the underlying code.</p><h3><strong>Real-World Example: Dynamic Leasing Agreements in Real Estate</strong></h3><p>Imagine a commercial real estate platform built on the Ethereum blockchain, designed to manage lease agreements dynamically. This platform caters to various properties — offices, retail spaces, and warehouses. Each property has different leasing terms and conditions, which can change based on market demand, duration of the lease, and specific tenant requirements.</p><p>Every time a property is listed for lease, a new smart contract for that particular lease agreement is <strong>dynamically</strong> generated. This is essential because each property might have unique terms based on its size, location, and the tenant’s business type. For instance, a warehouse might require different lease terms than retail space in a city center. By using dynamic contracts, the platform can create customized contracts on the fly, ensuring that all specific terms agreed upon between the landlord and the tenant are legally binding and automatically enforced via the blockchain.</p><p>Once these contracts are created, they must be managed and interacted with by various stakeholders, including property owners, tenants, maintenance services, and regulatory bodies. Here, the <strong>ABI</strong> comes into play. The ABI defines how interactions with these contracts occur, allowing software to understand how to read from and write to the contracts. For example, a tenant might need to verify terms, make a payment, or even terminate the lease. The ABI makes these interactions straightforward and standardized, ensuring that all actions are executed according to the underlying smart contract provisions.</p><h3>Thanks for reading!</h3><p>In summary, the incorporation of Web3 and blockchain technologies into iOS development represents a groundbreaking frontier for application advancement. Through the capabilities offered by Web3.swift and its seamless integration with Ethereum and other blockchain networks, iOS developers now have unparalleled opportunities to craft decentralized applications, integrate blockchain features, and engineer innovative solutions that redefine various sectors. By leveraging decentralized finance (DeFi), non-fungible tokens (NFTs), smart contracts, and beyond, iOS developers stand at the forefront of shaping the digital landscape. As we delve deeper into the potentials of Web3 and blockchain in iOS development, we embark on a journey toward a more decentralized, transparent, and interconnected digital realm.</p><p>The current article serves as an introductory piece, laying out the essential components of Blockchain and Web3 to equip iOS developers with the necessary theoretical knowledge. Upcoming in the series, <strong><em>Part 2</em></strong> will delve deeper, featuring hands-on examples involving <strong>Non-Fungible Tokens (NFTs)</strong> and a detailed case study on a real-world application. This progression from theory to practice aims to provide a comprehensive understanding and inspire innovative uses of blockchain technology in iOS app development.</p><h4><strong><em>Explore These Resources Before Our Next Deep Dive</em></strong></h4><p><em>GitHub Libraries</em></p><ul><li><a href="https://github.com/Boilertalk/Web3.swift"><em>web3.swift</em></a></li><li><a href="https://github.com/argentlabs/ethers.swift"><em>Ethers.swift</em></a></li><li><a href="https://github.com/ethereum/go-ethereum/tree/master/mobile"><em>Geth.swift</em></a></li><li><a href="https://github.com/apple/swift-crypto"><em>SwiftCryptoTokenKit</em></a></li></ul><p><em>Forums and communities</em></p><ul><li><a href="https://ethereum.stackexchange.com/"><em>Stack exchange: Ethereum</em></a></li><li><a href="https://ethereum-magicians.org/"><em>Ethereum Magicians Forum</em></a></li><li><a href="https://www.reddit.com/r/ethereum/"><em>r/ethereum</em></a></li><li><a href="https://www.reddit.com/r/ethdev/"><em>r/ethdev</em></a></li></ul><p><em>Educational</em></p><ul><li><a href="https://cryptozombies.io/"><em>CryptoZombies</em></a></li><li><a href="https://www.coursera.org/specializations/blockchain"><em>Blockchain Specialization</em></a></li><li><a href="https://www.investopedia.com/terms/b/blockchain.asp"><em>Investopedia</em></a></li><li><a href="https://www.edx.org/learn/blockchain/ibm-introduction-to-blockchain"><em>edX Blockchain course</em></a></li></ul><p><em>Dino is our valuable team lead.</em><br><em>At Azikus, we design and develop top notch mobile and web apps.</em><br><em>We are a bunch of experienced developers and designers who like to share knowledge, always staying up to date with latest and newest technologies.</em><br><em>To find out more about what we do, feel free to check our </em><a href="https://www.azikus.com/"><em>website</em></a><em>.</em></p><p><a href="https://azikus.com">Azikus</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e990ae04eb44" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azikus/unleashing-the-power-of-web3-and-blockchain-in-ios-part-1-e990ae04eb44">Unleashing the Power of Web3 and Blockchain in iOS — Part 1</a> was originally published in <a href="https://medium.com/azikus">Azikus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[High-end transitioning in iOS]]></title>
            <link>https://medium.com/azikus/high-end-transitioning-in-ios-ec4e9a383c4f?source=rss-e26c12d2644------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec4e9a383c4f</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Dino Bozic]]></dc:creator>
            <pubDate>Mon, 28 Feb 2022 14:39:52 GMT</pubDate>
            <atom:updated>2022-02-28T14:39:52.294Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IFL8Q97t353VQeEwm9im3Q.jpeg" /></figure><blockquote>“Wow, how does Instagram make their screens animate like that?”<br>“Amazing animations, I wish I could do that.”<br> — an iOS developer who hasn’t read this article</blockquote><p>In this article, a few techniques that are making a difference for those high-end projects and applications will be presented. An important mention is that we are doing everything programmatically using UIKit, without the usage of storyboard/.xib files.</p><p>What exactly constitutes a high-end application? The answer usually lies in additional attention to detail and perfecting every user <strong>interaction</strong> inside the application. High-end applications usually contain a lot of “<em>natural</em>” user interactions with incredible smoothness and fluidness. The application should pay attention to “<em>how it feels</em>”. That’s why, for example, Instagram is one of the most popular apps today.</p><p>Applications that are considered to be top-notch use cutting-edge technology when it comes to the tools used in their development. Alongside advanced technological techniques,<strong> </strong>there is a delicate sense of design to ensure the best possible application “<em>feel</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*dSGrJ-qe6vlw-egDJEpxKw.gif" /></figure><p>Upper interaction, taken from Instagram, is the one that is going to be reproduced and explained in this article. The general idea with this interaction is how the flow feels <strong>unified</strong> — two screens share an image of the selected item. Additionally, we have terrific feedback on our finger moving. The screen follows our finger and dismisses depending on our movement rather naturally. Instagram uses this interaction both on the shop screen and on the user profiles screen to generate the selected item details screen.</p><h3>Animation implementation</h3><p>These animations require a pretty complex set of techniques to be implemented. It takes quite a bit of time for it to be perfect and detailed to the wanted behavior.</p><p>Our transitioning example consists of implementing animations for a screen <strong>presenting</strong> and a <strong>dismissal</strong> with a <strong>gesture</strong> in-between which decides if the screen should be dismissed based on the user’s behavior. The screens share an image that resizes accordingly to each screen’s needs.</p><p>The initial step of the animation is to implement the presentation. The wanted behavior includes that the presentation and the next screen involve the exact image we tapped on. That is going to be done by implementing a <strong>custom presentation animation</strong> from the starting screen to the one with an enlarged image and details. Similar to this technique, we will also implement the dismissal of the screen which will return the image to its previous location. To complete the screen dismissal behavior, we will also add a gesture which is taking care of the user’s finger interaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*EdIbgHJ-J-EHeVq6JA6iEQ.gif" /></figure><h3>Transitioning</h3><p>Usually, every iOS project consists of multiple screens. Those screens need to be shown somehow, right? Well, in iOS screens are shown by either pushing a <em>ViewController</em> on the stack or by presenting a <em>ViewController</em> on top of the parent one.</p><p>Pushing and popping <em>ViewControllers</em> usually notes a flow inside an application. A flow needs to have its <em>Navigation</em> controller, which as its name explains, handles navigating screens. Pushing is the action of showing a screen — putting a screen on top of the stack. Popping a <em>ViewController</em> means hiding a screen, removing it from the top. Basic examples are shown below.</p><pre>navigationController?.pushViewController(ShowingViewController(), animated: <strong>true</strong>)</pre><pre>navigationController?.popViewController(animated: <strong>true</strong>)</pre><p>Another way of showing a <em>ViewController</em> is by modally presenting it. It is usually used when you want to interrupt the current flow by an action. Modal screens are widely used for showing error and info messages. Also, they can start a new flow, but by preserving a current flow in the background. Present action shows the modal <em>ViewController</em> while a dismiss action hides the top presented <em>ViewController</em>.</p><pre>present(UIViewController(), animated: <strong>true</strong>, completion: <strong>nil</strong>)</pre><pre>dismiss(animated: <strong>true</strong>, completion: <strong>nil</strong>)</pre><p>There are various ways of exploiting native functions for navigation and those methods are thoroughly covered in blogs and <em>StackOverflow</em>.</p><h3>Transitioning delegation</h3><p><a href="https://developer.apple.com/documentation/uikit/uiviewcontrollertransitioningdelegate">https://developer.apple.com/documentation/uikit/uiviewcontrollertransitioningdelegate</a></p><p>Apple provided a way to enable custom animation creation by adding a <strong>transitioning delegate</strong> to appropriate <em>ViewControllers</em>. That is our first way of creating a custom high-end transitioning behavior between screens. There are two protocols that are available: <strong><em>UIViewControllerAnimatedTransitioning</em></strong><em> </em>and <strong><em>UIViewControllerInteractiveTransitioning</em></strong>. Animated transitioning is used for basic operations like presenting and dismissing while interactive transitioning is used to implement the behavior of updating the animation while happening. Alongside implementing one of the transitioning delegates, a <em>ViewController</em> must also conform to <strong><em>UIViewControllerTransitioningDelegate</em></strong>. This <em>ViewController</em>, as shown in the code below sets the animated transitioning delegate to itself for the present and dismiss actions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f9fd275e4a6ea49901e8039fd862262/href">https://medium.com/media/2f9fd275e4a6ea49901e8039fd862262/href</a></iframe><p>The next task is the conformation to the <strong><em>UIViewControllerAnimatedTransitioning</em></strong> delegate. This conformation determines the duration of the animation and sets the methods responsible for handling the presenting and dismissal animation. Methods are selected based on the transition context which holds the necessary data about the animation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f555dbffe0000b2491d651e6ed73914/href">https://medium.com/media/7f555dbffe0000b2491d651e6ed73914/href</a></iframe><p>While instancing our presented view controller we have to set the <em>modalPresentationStyle</em> property to <em>custom</em> which denotes that we will have a <strong>custom handle</strong> for its presentation. Next to that, we have to set the <em>transitioning delegate</em> of a newly created <em>ViewController</em> to its presenting one. Of course, we have to note that we are using the animated presentation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/15198281b38e57cf03eb58ca3cf757d3/href">https://medium.com/media/15198281b38e57cf03eb58ca3cf757d3/href</a></iframe><p>Now, we have all our transitioning delegates set and we are ready to start implementing our custom animation. As we see from the .gif with our finished animation at the top, we are using the same image on both the presenting and the presented <em>ViewControllers</em> — which is exactly the main piece in our animation puzzle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*pbOdetCnSYp2xp2_p7S_6w.gif" /></figure><p>The definition of our <em>animatePresent</em> function which handles this screen showing includes the transition context, the presented <em>ViewController,</em> and UI elements that are used in the animation. Here we have an imageView which we are transitioning to the presented screen, <em>sizeView</em> which helps us get the frame of the shown image, and <em>dimmingView</em> which produces a shadow on the parent screen.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c2b5340c4865b13f9cc3a0cb1bb7eb1/href">https://medium.com/media/9c2b5340c4865b13f9cc3a0cb1bb7eb1/href</a></iframe><p>To start with the animation, we should prepare our “<em>canvas</em>”. Generally, that means we have to use additional views that are exclusively used in the animation process. Canvas creation starts by defining the global transition <em>containerView</em> — the <em>containerView</em> of the <strong>transition context</strong>. This view will hold all of the necessary subviews used in the animation. We should be careful and hide our presented screen until it is time for it to become visible. That is being done by setting the <em>alpha</em> to 0 for its main view.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c7fd94bf2868634adaae862b3edaf1e/href">https://medium.com/media/4c7fd94bf2868634adaae862b3edaf1e/href</a></iframe><p>The next part is the creation of the views we will use in our animation. The animation will have an image transforming from its current location and size to the new one defined on the new screen. Additional attention should also be granted to animating the rest of the new screen. The rest also appears from the starting image enlarging and moving downwards as the animation progresses. In the code snippet above, we have an initialization of those elements with its <em>frame</em> set to be the same as on the starting screen.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b93932fb7fb4fcb6d325cb3f2187605/href">https://medium.com/media/8b93932fb7fb4fcb6d325cb3f2187605/href</a></iframe><p>The final part of presenting the screen is the <strong>animation</strong>. Firstly, we are enlarging the image and relocating it simultaneously. That is being done by animating the <em>imageView’s</em> frame to the one on the new screen. Alongside the image, we are resizing the frame of the <em>contentView</em> to acquire the size of the newly made screen. After the size animation finishes, the key elements should be set in place and then we can animate showing the rest of the presenting screen.<br>Finally, we are removing temporary views from the container views, adding the dimming view to the presenting screen, and completing the transition. With that, our custom presenting animation is finished.</p><p>Next up, we have the <strong>dismissal</strong> of our presented screen. The very noticeable thing is that our screen moves with our behavior before its being dismissed. That’s gesture handling which will be explained later on. The current focus is the dismissal animation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*Ia7AxZihkMBPEl8Ku3ImWQ.gif" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f1c51268108bd79beec5efa4c1ed9bf/href">https://medium.com/media/5f1c51268108bd79beec5efa4c1ed9bf/href</a></iframe><p>The dismissal animation implementation has a similar logic. As with the presenting, dismissal also requires the same definition with UI elements that participate in the animation. In this instance, we are initializing a new <em>imageView</em> element which will transition an image from the presenting screen to its parent. We are taking the current frame of the <em>imageView</em> and converting the frame to the <em>sizeView</em> in the parent screen so we “<em>return</em>” the image in its place. With the image been set in its place, the next thing to do is remove the mocked imageView from our views and complete the transition in the transition context.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/269daca53fa2f2a0956d0bdcdd8772d5/href">https://medium.com/media/269daca53fa2f2a0956d0bdcdd8772d5/href</a></iframe><h3>Gesture handling</h3><p><a href="https://developer.apple.com/documentation/uikit/uigesturerecognizer">https://developer.apple.com/documentation/uikit/uigesturerecognizer</a></p><p>Gesture recognizers are the object used to capture and handle the user’s input in the applications. Apple’s gesture support includes taps, swipes, pinches, and others.</p><p>For our purpose, we will use <em>PanGestureRecognizer</em> which is used to capture and handle the dragging of the user’s finger over the screen.</p><p>The initial important thing is<strong> view hierarchy</strong>. We should use an additional containerView on top of the ViewController’s default view to enable this kind of animation. This enables us to “move” the <em>containerView</em> around the screen with its content on it and maintain the view of the top <em>ViewController</em> intact.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ffa140f5e617a6d8c67856d12dfe7b82/href">https://medium.com/media/ffa140f5e617a6d8c67856d12dfe7b82/href</a></iframe><p>The handle of our movement starts with adding our pan gesture to the <em>containerView</em> and initializing a function that will run after a gesture trigger. As it could be seen from the snippet, two variables are prepared — view which is being dragged by the pan gesture and general translation in the <em>superView</em>. The rest of the handle consists of two parts: the change handle and the ending handle.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/124372cbc26df35c26f1de87c5eb4fb5/href">https://medium.com/media/124372cbc26df35c26f1de87c5eb4fb5/href</a></iframe><p>Change handle begins with determining the starting point of the <strong>translation</strong>. This case right here enables the gesture only to be handled when the drag is going to the right. According to that, we are saving the initial and every other subsequent transition so we can precisely determine the data about our next transition. The most crucial part of the gesture animation is the next part — to determine the <strong>translation</strong> of the <em>containerView</em> and to <strong>scale</strong> it. The translation is done by setting its center with the desired offset. In the snippet, it is done by offsetting the center by translation value multiplied by a constant of 0.35. To determine a wanted scale, we conducted a small algorithm that calculates the scale and then is applied using the <em>CGAffineTransform</em>. With those methods we get the screen moving and resizing smoothly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a5d0054476124d9fd0b79e86f05a0144/href">https://medium.com/media/a5d0054476124d9fd0b79e86f05a0144/href</a></iframe><p>This snippet contains an ending phase of our gesture. This chunk of code fires when the pan gesture ends — that can happen when the user reaches the edge of the phone or he lifts his finger from the screen. Based on the velocity of the user’s finger, the algorithm determines whether the screen should dismiss or return to its initial state.</p><h3>Room for upgrades</h3><p>Just as any other software development element we can also enhance the behavior of explained techniques. The upgrades might consist of remodeling the animations — using more views or more complex animation patterns. Space for imagination is unlimited so any element transition with explained patterns is possible. It is worth mentioning that one can also try implementing interactive transitions — usually used in push/pop transitions.</p><p>Those interactive transitions as their name suggests are consumed while the user is <strong>interacting</strong> with the application. That means that screens are showing or hiding parts of their content while the user is deciding his next action with his gesture.</p><h3>Last call</h3><p>Combining mentioned techniques makes transforms a basic screen transition into a <strong>high-class </strong>one. These techniques are used by top-notch applications with unlimited budgets. Both the discovery and the implementation of those transitions are rather costly and complicated actions. They are, however mandatory for a supreme iOS developer if he wants to compete with the big-game players. Complex and costly actions are usually the elements that make the difference in the end considering the application’s overall performance and user experience.</p><p><em>Dino is a valuable member of our iOS team.<br>At Azikus, we design and develop top-notch mobile and web apps.<br>We are a bunch of experienced developers and designers who like to share knowledge, always staying up to date with the latest and newest technologies.<br>To find out more about what we do, feel free to check our </em><a href="https://www.azikus.com/"><em>website</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec4e9a383c4f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azikus/high-end-transitioning-in-ios-ec4e9a383c4f">High-end transitioning in iOS</a> was originally published in <a href="https://medium.com/azikus">Azikus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps in iOS]]></title>
            <link>https://medium.com/azikus/devops-in-ios-f6b9b26aec9d?source=rss-e26c12d2644------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6b9b26aec9d</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Dino Bozic]]></dc:creator>
            <pubDate>Fri, 04 Dec 2020 17:00:25 GMT</pubDate>
            <atom:updated>2021-02-19T17:47:37.759Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M4XMvjsiBHp6RNPqI9zsLQ.png" /></figure><h3>The State of the Art of iOS DevOps</h3><p>One of the main aspects of software development is software quality. Products with high quality tend to go closer to the top in different statistics charts, especially financially oriented ones. Thanks to DevOps, applying the best software development practices and techniques has never been easier.</p><p>The definition of DevOps (Development and Operations) has never been clearly defined. Its meaning combines multiple aspects of each software product life-cycle. The main goal which every DevOps engineer tends to achieve is to ensure continuous and fast product delivery with the highest possible quality.</p><p>Nowadays, mobile development companies and clients are focused on fast product delivery where quality is often neglected. DevOps is a good solution for those fast, agile product developments since it unites the need for speed and final product quality.</p><p>Things covered by DevOps usually involve:</p><ul><li>Project startup — Xcode, package management</li><li>Code management — keeping your code clean and well-formatted</li><li>Automated testing</li><li>iOS code signing</li><li>Deployment — App Store Connect, CI</li></ul><h3><strong>The new beginnings</strong></h3><blockquote><em>“The early bird catches the worm”</em></blockquote><p>Every high-quality project starts with a high-quality start. It is important to invest time into the initial setup to make the future development process easier. That means spending resources to choose an appropriate architecture, set up a project structure, and select required tools.</p><p>This results with less bugs, a high stability rate, easier development for the engineers, and overall fewer resources being unnecessarily spent.</p><h3><strong>Xcode</strong></h3><p>Every iOS project starts with Xcode, an IDE developed by Apple, containing all the required toolset to create apps for Mac, iPhone, iPad, Apple Watch, and Apple TV. This is the ultimate root of creating a high-quality app. With the initial app setup in Xcode, you can save yourself a lot of time in future app deployments.</p><p><strong>Targets</strong></p><p>Xcode setup begins with managing your project targets. Each target represents a product to build. That being said, there are multiple ways you can distinct your targets. The most obvious one is the distinction between app types based on the device — the target can represent an iOS app, watchOS app, or OS X app. Another important distinction is another one widely used — test/production distinction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFb-VO-uxr1dGFIZAk-Etg.png" /><figcaption>Xcode target settings</figcaption></figure><p>A target is defined by its own bundle identifier, which is used as an identification to the operating system and App Store. It is also commonly used as an asset to connect with different services, like Facebook, Google, Firebase, etc. With different targets you can adjust their settings and with their references you can produce code run only by the desired target. This way, you can separate your test/production API calls, adjust UI and do whatever is needed in each environment. Often, this target distinction is usedAlso, targets are a great way to manage whitelabel apps with said possibilities.</p><p><strong>Xcode configuration</strong></p><p>An elegant alternative to the multiple target creation is managing your build configuration settings with xcode configuration file (.xcconfig). Xcode offers “Debug” and “Release” configurations by default when we create a new project. You can additionally add your own personalized configurations which are further configurable via .xcconfig files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDmm3W51wBDVPxKePZtnKA.png" /><figcaption>Xcode configurations</figcaption></figure><p>Xcode configuration file (.xcconfig) is a simple key-value based file where you store your build settings. For each configuration you create you can set a belonging configuration file which then dictates build behaviour.</p><p>More on this: <a href="https://www.appcoda.com/xcconfig-guide/">https://www.appcoda.com/xcconfig-guide/</a></p><p><strong>Schemes, build phases, build settings</strong></p><p>Schemes are used to build and run apps from Xcode. They are usually closely connected to targets — each target has its own running scheme. However, you can create additional schemes for additional purposes, like running different scripts before building the same codebase or running with memory management diagnostics. Scripts are managed in the build phases section of Xcode project settings. For each different script you have to add the new phase to the build. These sections also manage compile sources and bundle sources for each target. Finally, duty of build settings sections is to handle different types of application settings, like supported architectures, code signing, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RXz7W_U8t2MLGsDHbIJFYw.png" /><figcaption>Xcode scheme management</figcaption></figure><h3>Package managers</h3><h4>CocoaPods</h4><p><a href="https://github.com/CocoaPods/CocoaPods">GitHub - CocoaPods/CocoaPods: The Cocoa Dependency Manager.</a></p><p><a href="http://cocoapods.org">http://cocoapods.org</a></p><p>CocoaPods is a tool which manages dependencies for Xcode projects. The secret lies in its simplicity, where all your dependencies are specified in a simple text file called Podfile. CocoaPods simplifies the usage both for library authors as for library users. It is personally my favorite tool to use. It is easy to install via sudo or command line and it’s also really intuitive to use. You just have to add the library you desire to install into Podfile, optionally you can add the version of the library and that’s it. Eventual updates are managed quite easily with pod install or pod update commands. The downsides of CocodaPods are increasing the value of build time and hard process of making the code work if something goes wrong with the imported library. Also, since CocoaPods are implemented in Ruby, an additional language knowledge is mandatory to introduce new libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*-y36dgcnIuSAeltFonAfHw.png" /><figcaption>Podfile example</figcaption></figure><p><strong>Carthage</strong></p><p><a href="https://github.com/Carthage/Carthage">https://github.com/Carthage/Carthage</a></p><p>Just as CocoaPods, Carthage is also a tool to simplify dependency management for an iOS application. Dependencies are also stored in a special file which is then used for framework installations and updates. Carthage is also written in Swift which means that iOS developers can be easily familiar with the Carthage implementation and further development. One of the best benefits that Carthage offers is it being flexible and it is easy to integrate it in big and ongoing projects, as opposed to Cocoapods. It can also be easily integrated into a CI server. However, Carthage currently supports only dynamic frameworks without any support for static libraries. And since Carthage is a relatively new tool, some important libraries may not be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etKuX-45tKx5_C8KEmIJlA.png" /><figcaption>Cartfile example (Carthage github documentation)</figcaption></figure><p>Generally, both Carthage and CocoaPods are more than advisable to use in your projects. On one hand, Carthage is preferable because of its Swift origin and it excels with bigger projects, since only one build is required for libraries to be integrated. CocoaPods on the other hand increases overall build time since the tools has to build pods on every clean build. But it excels in its simplicity and wide-range of supported libraries. Technically, you can use both tools in your project and divide the work based on their adaptability to the problem.</p><p><strong>Swift package manager</strong></p><p>Swift package manager is a tool integrated with the Swift build system, used for managing distribution of Swift code. Swift organizes its code into modules, which are then reusable for any other wanted purpose. Dependencies are also represented by modules, with their known source and requirements for the package version. Package manager recursivelly runs the automated process of downloading and building all of the project dependencies.</p><h3><strong>Code clean as a whistle</strong></h3><blockquote>“It is not enough for code to work.” ― <strong>Robert C. Martin</strong></blockquote><p>In my engineering career, I don’t think i have heard a syntagm being said more than “clean code”. The importance of clean code is probably known to any decent mobile developer. It is a must have for a quick and successful product development. Clean code is primarily important to enable future product improvements and deployments. DRY (Don’t repeat yourself), KISS (Keep it simple stupid) and YAGNI (You ain’t gonna need it) are just some of the numerous clean code principles which are hardcoded in the successful developer’s minds.</p><p>There are a few tools to assist with the clean code management in the iOS world, besides handling indentations with Ctrl+I.</p><p><strong>SwiftLint</strong></p><p><a href="https://github.com/realm/SwiftLint">https://github.com/realm/SwiftLint</a></p><p>SwiftLint is a rule-based tool for Swift code management. It is easy to install and easy to maintain. After an easy integration with the project and Xcode, developer has to choose the set of rules to help him format the code. There are over 100 available rules, thanks to SwiftLint community. Everyone can participate in the future development with their own pull requests on the SwiftLint’s github. Rules can be optional — warning will pop up in the Xcode editor, or they can be mandatory — Xcode would throw an error. Additionally, you can create your custom rules. Also, there is an option to “break” the rule in the editor if that’s really necessary.</p><p>All in all, SwiftLint is an all-around tool considering code cleanliness and trivial to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPjPjZ40H4ehF9dC0I_yow.png" /><figcaption>SwiftLint file example</figcaption></figure><p><strong>SwiftFormat</strong></p><p><a href="https://github.com/nicklockwood/SwiftFormat">GitHub - nicklockwood/SwiftFormat: A command-line tool and Xcode Extension for formatting Swift code</a></p><p>Just as the name suggests, SwiftFormat is a tool to format Swift code. SwiftFormat thanks its success to its versatility — it is used in 4 different ways: As a manually ran command tool, as a source editor extension, as a build phase in Xcode project and as a Git pre-commit hook. Next to standard formatting, SwiftFormat handles additional Swift clean code problems, like implicit self, redundant parentheses and other code deviations. It also enables a developer to customize a set of rules and option used to format the final code product. A difference to SwiftLint is that a SwiftFormat fixes the deviant code, rather than telling you to do so.</p><h3>Testing, attention please</h3><blockquote>“One test a day keeps the doctor away”</blockquote><p>As you already know, tests are the only sufficient way of making sure your code works as it is imagined. For sure, you have crossed paths with some edge cases ending up on your beta test. Testing is a reliable way to detect your logic failures, double-check your UI and acquire performance data.</p><p>Xcode offers testing tools within its XCTest framework. Probably the most important and time investing part of testing is Unit testing. Each unit test should assert the expected behaviour of a method or a function in your code. Ideally, one test is required for every scenario a method or a function offers. One should especially identify and cover all the edge cases with the highest quality test writing. Similar type of tests are Integration tests. Instead of covering a small logic part, integration tests cover the behavior of larger systems of functions. These tests are used to make sure that the components/modules work together. Other than Unit and Integration testing, XCTest is able to produce UI testing. UI testing compares recorded state of the UI with the state produced by a more recent build. That means that there are two modes to pay attention to — recording mode and testing mode. Finally, there are Performance tests where user can measure performance information, like time taken or memory used.</p><p>Testing in Xcode is done by importing XCTest and subclassing XCTestCase. When you add a new testing class, Xcode kindly offers you a template to fill your testing needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwakV_B4XzO3U69YzMVF8Q.png" /><figcaption>Xcode test example on XCTestCase template</figcaption></figure><p>More on native Apple testing on: <a href="https://developer.apple.com/documentation/xcode/testing_your_apps_in_xcode">https://developer.apple.com/documentation/xcode/testing_your_apps_in_xcode</a></p><p><strong>Testing coverage</strong></p><p>Code/Test coverage is a measure that quantifies the amount of code covered by existing tests. It is a measure that allows the identification of chunks of codes that are left untested. It, however, does not include the test quality.</p><p>You can enable code coverage in Xcode by going into test options and marking the Code coverage checkbox. Coverage report is then generated for every subsequent testing session in the <em>Report navigator</em>. Newly retrieved coverage data can then be shown inline by checking on the<em> Code coverage</em> option in the <em>Adjust Editor Option</em> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDLWt5Qux598nk_2n4P1Wg.png" /><figcaption>Enabling code coverage while testing</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exptUldOwrE-QfCVJ4nexg.png" /><figcaption>Enabling code coverage information inline</figcaption></figure><p><strong>Codebeat</strong></p><p><a href="https://codebeat.co">https://codebeat.co</a></p><p>Code review is an important part of any product development since it combines more viewpoints on the same codebase with an extra pair of eyes to capture mistakes. Codebeat is a tool that automates the process of code review. There is a certain amount of things we always check when reviewing code, like coding style, coding practices or outdated APIs.</p><p>Codebeat offers an automated code analysis when ran. It marks occurrences of well known code imperfections, for example code duplication. Similar to SwiftLint, Codebeat also supports customizable rules where you adjust your code review to your personal liking. That being said, during the process of code review, you can pay attention to things that lint or code format ignored. That includes cyclomatic complexity, block nesting or other generic limitations you require.</p><h3>Signature here, here and here please</h3><blockquote>“Finish strong.”</blockquote><p>After your code is clean, your bugs are resolved, features working, tests are successful and the QA has given you a green light, it is time to deploy your application.</p><p><strong>iOS code signing</strong></p><p>One of the things Apple requires from you is code signing. Code signing is Apple’s way to make sure applications are signed by trusted developers with valid certificates. Various security elements are involved in the process and the final outcome is making sure that the code wasn’t changed or corrupted after it had been signed.</p><p>To start with the code signing process, you will need a certificate signing request, created from your own Keychain Access. This is used to confirm developer’s identity in the process.</p><p>There are two types of certificates you need to worry about. Development certificates are used for internal deployment. They are necessary for testing your application on internal devices. On the other hand, when you’re ready to publish your app, you will need a distribution certificate which is necessary to run your app on any device.</p><p>More on certificates on: <a href="https://developer.apple.com/support/certificates/">https://developer.apple.com/support/certificates/</a></p><p>Along with certificates, you need to take care about provisioning profiles. Just like the case is with certificates, you have both development and distribution provisioning profiles. Once again, development profiles are used for internal app testing, while distribution profile is needed to publish your app on the AppStore. Provisioning profiles are a combination of the app data, like app ID and the belonging certificates.</p><p>More on provisioning profiles: <a href="https://developer.apple.com/documentation/appstoreconnectapi/profiles">https://developer.apple.com/documentation/appstoreconnectapi/profiles</a></p><p>After you’ve acquired all needed certificates and provisioning profiles, you need to import them into the Xcode. You can then select whether you want Xcode to automatically manage your code signing, where you just have to select your team, or you want to manually upload the provisioning profiles.</p><p>A great read which explains code signing in detail: <a href="https://blog.codemagic.io/how-to-code-sign-publish-ios-apps/">https://blog.codemagic.io/how-to-code-sign-publish-ios-apps/</a></p><h3>Deployment</h3><blockquote><em>“It is time to meet the world”</em></blockquote><h3><strong>App Store Connect</strong></h3><p>App Store Connect is an Apple’s service to upload, submit and manage your applications. It is necessary to create a new application for every build you want to test (if you are testing through Apple services) or deploy. For example, if you want to deploy the build of every of your project’s targets, you’ll have to create an application for every target with its own bundle ID.</p><p>After creating your App Store Connect, it is time to return to Xcode. There, you can upload your app via “Archive” option. Xcode then automatically checks all your signatures, profiles, app versioning and other important settings. After the checks have passed and upload finished, you will have a build uploaded to the App Store Connect.</p><p>Apple offers TestFlight as a solution to internally test your apps on real devices. You just have to send invites to testers and they will be able to test every uploaded build. They will be able to send you feedback with screenshots and the service will register crashes. Additionally, TestFlight offers Beta testing, with external groups option.</p><p>App Store Connect also offers enabling in-app purchases and subscription methods. It also covers app privacy settings, ratings and reviews.</p><p>Finally, your application has to pass a review. You have to provide crucial information about your application — Final name, app screenshots, review information, etc. Apple personnel will carefully go through your app and inform you about eventual tweaks you have to make to publish the app. If everything goes smoothly, you’ll get a green light and showcase your app to the world (Or part of it, depending on your settings).</p><p>More on App Store Connect: <a href="https://developer.apple.com/app-store-connect/">https://developer.apple.com/app-store-connect/</a></p><h3><strong>Continuos integration (CI)</strong></h3><p>Continuous integration is an automated process of testing and deploying new builds of an application. It is an elegant way to reliably test new code updates and deploy builds once the application is ready to update. A good CI tool will help you save time on the monotonous repeating actions of producing application versions.</p><p>Using native Apple developer tools for CI has always been a secure way to handle the deployment process. They can’t be manipulated by third-party frameworks and they are well documented by Apple. Some of the major tools include xcodebuild, altool, agvtool, codesign and security. You can already realize that these tools are used via command line, so you will have to spend some time to understand what each of these tool’s possibilities are. All of the tools produced by companies are using the native Apple developer tools for testing and deployment under the hood.</p><p><strong>Fastlane</strong></p><p><a href="https://fastlane.tools">fastlane - App automation done right</a></p><p><a href="https://github.com/fastlane/fastlane">https://github.com/fastlane/fastlane</a></p><p>Fastlane is one of the most popular choices for a CI. It is an open-source platform based on Ruby, and its functionality is defined in a configuration file called Fastfile. Fastfile is structured from lanes where each lane represents one process which is being automated. Those lanes help the developer to run desired commands in order every time a new build is introduced. Fastlane offers over 170 actions which are available for Android, iOS and Mac platforms.</p><p><strong>Bitrise</strong></p><p><a href="https://www.bitrise.io">Bitrise - Mobile Continuous Integration and Delivery</a></p><p>Next to Fastlane and native development tools, there are a lot of cloud-based paying options which handle your integration process. There are Nevercode, CircleCI, there used to be BuddyBuild and there is Bitrise. Bitrise is really hot right now, and one of the most favorite developer selections for CI. Bitrise supports a wide range of technologies, from iOS and Android to React Native or Flutter. It also includes a large number of services available to automatically connect your application with (Firebase, Slack, Github, …). Bitrise is very well documented so its usage is quite easy to handle.</p><h3>Long story short</h3><p>All these tools and techniques mentioned are just a fraction in the overall DevOps possibilities. There are a countless possible ways to combine stages of the development and deployment process and it all unites under the DevOps term.</p><p>It is definitely smart to invest into DevOps which is supported by a recent surge in DevOps engineer position openings on the market. For a big company with complex products, DevOps engineer is a must have to handle and simplify the overall production process.</p><p><em>Dino is a valuable member of our iOS team.<br>At Azikus, we design and develop top notch mobile and web apps.<br>We are a bunch of experienced developers and designers who like to share knowledge, always staying up to date with latest and newest technologies.<br>To find out more about what we do, feel free to check our </em><a href="https://www.azikus.com/"><em>website</em></a><em>.</em></p><p><a href="http://azikus.com/">AZIKUS - full service digital agency</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6b9b26aec9d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azikus/devops-in-ios-f6b9b26aec9d">DevOps in iOS</a> was originally published in <a href="https://medium.com/azikus">Azikus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>