Programmatic scrolling in SwiftUI

Auto-scrolling or Manual scrolling to a particular position using ScrollViewReader in SwiftUI

Auto scrolling in SwiftUI

There are times in development where developers want to programmatically scroll to a particular position Or want the scrolling from bottom to top like in the case of Chat view, Transactions View, etc where we want to display the latest conversations or transactions at the bottom while older at the top for which a user has to scroll up to see the oldest item.

From iOS14, i.e. in SwiftUI 2, Apple provided an API "ScrollViewReader" which can be used to programmatically scroll to a position.


SwiftUI Pagination

Pagination in SwiftUI using ScrollView and LazyVStack with MVVM

Pagination

Pagination is the technique to divide large response into discrete pages with limited data on each page.
For example: Suppose there is an API that returns 1000 records in response. Instead of returning all 1000 records in one go, can divide records into multiple pages say 20 pages in total where each page has 50 records.
In this way, the app is making a request which returns 50 records at a time.

Let’s begin:

In this article, we are going to consume the “LIST USERS” API available at https://reqres.in


The countdown timer using Swift UI

A stepwise guide to create a 24-hour (24:00:00) countdown timer using SwiftUI

24-hour Timer format

In this blog, we will see how to create a simple 24-hour Countdown Timer in the format → hh:mm:ss using SwiftUI.
However, this project can be used to create a 12-hour Timer or for any other time as well.

Create a SwiftUI project

Create a SwiftUI project “CountdownTimer”. For this tutorial, I used XCode 12.2
Make sure you select “SwiftUI” as an interface, Lifecycle as “SwiftUI App.


TESTING FCM PUSH NOTIFICATION (HTTP v1)

Tutorial to test Firebase Cloud Messaging (FCM) Push Notification (HTTP v1) through OAuth 2.0 Playground or Postman or Terminal (curl command)

FCM (HTTP v1)+ Postman / Terminal / OAuth 2.0 Playground → Send Push Notification

In continuation of my previous post ( Testing FCM Push Notification through Postman/Terminal — Part 1 ), in this article, we will explore how to send a Firebase Cloud Messaging (FCM) Push Notification using the latest FCM HTTP v1 API, through OAuth 2.0 Playground or Postman or Terminal (curl command).

If you are new to Firebase Cloud Messaging (FCM) or want to understand other methods (Legacy FCM HTTP Protocol or Notifications composer) of sending Push Notification, then please follow my previous post .

Why use or migrate to FCM HTTP v1 ?

As per the firebase documentation, this is the most up-to-date and flexible approach for sending messages to…


Testing FCM Push Notification

Tutorial to test Firebase Cloud Messaging (FCM) Push Notification through Postman or Terminal (curl command)

Firebase Cloud Messaging (FCM) + Postman / Terminal → Send Push Notification

While implementation of Firebase Cloud Messaging, there is a need to test the functionality during the development /QA phase. So, developers need a way to unit test the functionalities covering all scenarios, which involves sending push notification multiple times.

Before getting in to the details, let’s get into some basic details about FCM notifications which will help in understanding the testing methods.

  • Notification Messages :
    Notification messages are handled by the FCM SDK automatically and displays the message to end-user devices on behalf of the client app. …


In-App Promotions

Discounted price offers for a specific duration for existing or previously subscribed customers

Image Source: Apple

What is In-App Purchase?

An in-app purchase allows customers to buy content, features, or services from within the app by accessing the App Store and securely processing payments from the user.

Each developer account can create up to 10,000 in-app purchase products across all the apps in the account.

There are four in-app purchase types:

  1. Consumable
    Consumable in-app purchases are used once, are depleted, and can be purchased again. Users can purchase different types of consumables, such as lives or gems in a game, to further their progress through an app.
  2. Non-Consumable
    Non-consumables are purchased once and do not expire, such as additional filters in…


Serverless Rest API through Cloud formation template

Advance tutorial to create Serverless Rest API with Lambda, API Gateway through Cloud Formation Template and AWS SAM

In this article, we will learn and explore how to create a Serverless Rest API using AWS API Gateway, AWS Lambda Function, IAM Role and Policies.

Further, we will learn how to deploy the Serverless Rest API through Cloudformation template using AWS Serverless Application Model (SAM)

Problem Statement:

We will be creating a Serverless Rest API endpoint using Cloudformation template with the following details :
1. Method: GET
2. Path parameter : {userId}
3. Query parameter : firstName
4. Endpoint: https://xxxxx.execute-api.us-east-1.amazonaws.com/v2

https://xxxxx.execute-api.us-east-1.amazonaws.com/v2/apoorv487@gmail.com?firstName=apoorv

{
"statuscode":200,
"body" : "{\"message\":\"Hello apoorv, Your userId is apoorv487@gmail.com\"}"
}

Architecture :

Below is the High-Level Architecture of the…

Apoorv Garg

Consultant at GlobalLogic | iOS app developer | AWS Certified Solutions Architect - Associate

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store