IOS allows app to refresh it content even when it is sent to background. iOS can intelligently study the user’s behaviour and schedule background tasks to the moment right before routine usage. It is useful for app to retrieve the latest information from its server and display to user right when app is resumed to foreground. Examples are social media app (Facebook, Instagram & WhatsApp) and news app.
AlarmManager is a bridge between application and Android system alarm service. It can send a broadcast to your app (which can be completely terminated by user) at a scheduled time and your app can then perform any task accordingly.
With the help from
Intent, a bundle of information can also be sent together with the system broadcast to your application when alarm goes off.
However, since Android KitKat (API 19) and Android MarshMallow (API 23), Google has added different restrictions on
AlarmManager to reduce the battery usage. Alarm no longer goes off exactly at the assigned time by…
ViewPager2 is introduced in this year 2019 Google I/O and is a replacement of the old ViewPager, which was created in 2011. It includes some new features to enhance UI and coding experience, including:
NFC stands for “Near Field Communication”. Two electronic devices can transmit data through NFC when they are distanced fewer than 4 cm apart. NFC can be used for electronic payment. It was invented many years ago but it has just been introduced by Apple to iPhone series since the launch of iPhone7 in 2016. To test an app with NFC feature, a real device must be used instead of an iOS simulator.
To setup a NFC project, the “NFC Tag Reading” must be enabled in the “App Services” session during registering an App ID in the Apple Developer Console.
Apple releases a lot of new updates to iOS and Swift programming language in the WWDC 2021. One of the eye-catching UI enhancements is the
UISheetPresentationController. It provides a brand new way for presenting an
UIViewController . It can be displayed in either half-screen or full-screen mode. You can also customise the corner radius, grabber visibility and UI shown in compact mode, etc.
During testing with the new
UISheetPresentationController, I encountered two interesting tricky parts about the lifecycle and background of the presented
UIViewControllerand will share them with you in this blog post. Let’s get started.
Sign In With Apple is an authentication system created by Apple. iCloud users can authenticate apps for retrieving their full names and email addresses. Apple provides a proxy email service for users who want to hide their email addresses from app owners who request their email addresses. Under the control of the proxy email system, app owners have to register their domain at the Apple server first in order to send emails to clients.
Apple provides the Authentication Service Framework to provide a simple to use authentication tool for developers to implement into their apps easily. Developers have to first…
Google Sign-In is a famous feature in many modern mobile apps. It provides a neat and easy-to-use API for delegating the authorization procedures to the Google website and server. Google handles the security issues for app developers. Developers just need to follow 7 steps to implement the whole sign-in process.
An interesting trick was found during my last implementation — the
application(_:open:options:) function at the
AppDelegate is never triggered even it is a required setup stated in the official documentation. Why? Let’s see below.
UIPageControl is a control that displays a horizontal series of dots, each of which corresponds to a page in the app’s document or other data-model entity. It usually works with a
UIPageViewController or a paginating
UIScrollView. The default
UIPageControl only shows page indicator as white circles with different opacities.