Published in Better Programming·PinnedMember-onlyHow to Use Web3.swift in iOSFetch data from the Ethereum blockchain using Swift — Ever since the introduction of the Ethereum blockchain in the year 2015, it has revolutionized the entire software development industry. It is the first blockchain that has smart contract capability, allowing developers to create and deploy decentralized applications (dApps) that interact with the Ethereum blockchain. Nowadays most dApps are web-based…Programming5 min readProgramming5 min read
Published in Better Programming·PinnedMember-onlyHandling Actor Reentrancy Problem in SwiftKnow how to safely run concurrent Swift code — When the first time I saw the WWDC presentation about actors, I was thrilled with what it is capable of and how it will change the way we write asynchronous code in the near future. By using actors, writing asynchronous code that is free from data races and deadlocks has…Swift6 min readSwift6 min read
Feb 1Member-onlyHow to Fetch and Show Remote Data on a Widget?When creating widgets for your apps, sometimes it might be sufficient to just display data that is locally generated. However, in most cases, we will want our widgets to display data that is fetched from a remote server. In this article, let’s explore this topic. We will create a sample…Ios Development5 min readIos Development5 min read
Published in Better Programming·Jan 18Member-onlyHow To Update or Refresh a Widget in iOSUpdating widgets with Timeline Provider — Due to the always-on nature of a widget, Apple has introduced a way for developers to refresh a widget to ensure its power efficiency and prevent developers from exploiting the processing power of a device. In this article, I would like to show you what it takes to refresh your…I OS6 min readI OS6 min read
Jan 3Member-onlyHow to Support Multiple Widgets When Using WidgetKit?This article is originally published at swiftsenpai.com Having multiple widgets with various functionalities is quite a common feature for apps nowadays. For example, a shopping app can have a widget that shows today’s promotion and another widget that shows the user’s order status. Apple has given us 2 ways to…I OS App Development3 min readI OS App Development3 min read
Dec 22, 2022Member-onlyHow to Create an iOS Lock Screen Widget?This article is originally published at swiftsenpai.com In iOS 16, Apple has given the Lock Screen a massive overhaul. One of the most anticipated features that come along with the overhaul is the Lock Screen widgets. As the name implies, Lock Screen widgets are widgets that display glanceable content that…Ios Development6 min readIos Development6 min read
Dec 7, 2022Member-onlyGetting Started With WidgetKitAll you need to know to create your first Home Screen Widget — This article is originally published at swiftsenpai.com WidgetKit was first introduced in iOS 14 as a simple framework whereby developers can leverage to create a Home Screen Widget. Since then, it has slowly evolved into a framework that powers some of the most anticipated features in iOS 16, namely Lock…I OS App Development7 min readI OS App Development7 min read
Published in Better Programming·Nov 8, 2022Member-onlyHow to Avoid Thread Explosions With Swift ConcurrencyWhat I discovered is quite fascinating! — A few weeks back, I read an article by Wojciech Kulik, where he talks about some of the pitfalls in the Swift Concurrency framework. …Swift6 min readSwift6 min read
Published in Better Programming·Oct 26, 2022Member-onlyCreate Custom Cell With Placeholder UI Using UIHostingConfigurationIt is easier than you think — Prior to iOS 16, having a collection view or table view that will display placeholder cells while waiting for data to load is somewhat troublesome to implement. We will have to define 2 separate custom cells (the placeholder cell and the actual cell) and manually handle the UI logic based…Programming4 min readProgramming4 min read
Published in Better Programming·Oct 12, 2022Member-onlyHow To Find All Fully Visible Cells in Table and Collection ViewNope… indexPathsForVisibleRows is not the solution — Imagine you are given a task to find out which table view cells are currently fully visible on screen. So you fire up Xcode, access the UITableView’s indexPathsForVisibleRows and expect that to get the job done. Very soon, you will notice that something is not right. The result you get…Programming2 min readProgramming2 min read