RSSAmplifier

Blog

en.proft.me - Blog about iOS, Swift, Android, Kotlin and Python

en.proft.me - Blog about iOS, Swift, Android, Kotlin and Python: latest posts

en.proft.meRSS feed ↗10 posts

Latest posts

Modal views in SwiftUI

A modal view is a view that shows up on top of the currently displayed view and that prevents interaction with the underlying view. The modal view is used to capture user input or display additional information without navigating away from the current screen. Once a modal view appears, it needs to be dismissed before interaction is possible with the rest of the application. Showing a modal sheet…

AVFoundation. Capturing photo using AVCaptureSession

UIImagePickerController provides a straight way to take a picture. It supports all the basic features, such as choosing source of camera (front, back), tapping on an area to lock focus and exposure and very simple editing features. However, when direct access to the camera is necessary, the AVFoundation framework gives full control, for example, for changing the hardware parameters…

Working with SwiftData in SwiftUI

SwiftData was announced at WWDC in June 2023. SwiftData simplifies data persistence tasks by using declarative code. Built on top of Core Data , SwiftData is actually a framework designed to help developers manage and interact with data on a persistent store. Main parts of of SwiftData are @Model macro .modelContainer() view modifier @Environment(\.modelContext) property wrapper @Query property…

Simple guide to Apple Core Bluetooth

Core Bluetooth is an iOS Framework to build Bluetooth Low Energy (BLE) applications that communicate with hardware devices. A Bluetooth device can be either a central or peripheral Central ( CBCentralManager ). The object that scan, connect, disconnect from a Bluetooth device. Peripheral ( CBPeripheral ). The Bluetooth device that publishes data to be consumed by other devices. Bluetooth…

Creating Live Activities on iOS 16

Starting from iOS 16.1 Apple provides a framework called ActivityKit which allows to create lock screen live widgets. One of the biggest problems with home screen widgets is that they do not show actual real-time updates. However, with Live Activities, you can provide real-time updates on the lock screen. This is helpful for apps that need to show time-critical information, like an ongoing workout…

Multiple images selector via PHPicker in iOS

The PHPickerViewController class is the new system picker that allows you to get access to images and videos from the user’s photo library. PHPickerViewController is an alternative to UIImagePickerController with ability to select more than one image at once. UIImagePickerController was a good choice before iOS 14.0 as simple image picker. Contrarily to the UIImagePickerController , PHPicker…

Usage of MVVM pattern in iOS development

MVVM – the Model View ViewModel architecture, is a design approach for application to ensure there is no tight coupling between your UI (V), business logic (VM) and the data layer (M). Any future changes of any of these components should not affect one another. Model represents the data from the datasource, which can be from remote URL or local. A Model should just be kept as simple as to reflect…

Using Vision framework for Facial Recognition in iOS

Vision framework can recognize objects in pictures such as faces. Vision API is only available since iOS 11. Some of useful possibilities of that framework: can identify the number of faces in a picture can find position of face First step is drag and drop a picture into the Assets folder. Make sure that picture contains a face. Add some views to the ContentView import SwiftUI import Vision struct…

Working with TabView in SwiftUI

SwiftUI navigation forms two styles: flat and hierarchical . SwiftUI uses TabView to implement a flat hierarchy. A tab bar appears at the bottom of an app screen and let users quickly switch between different functions of an app. SwiftUI's TabView is a container view and consist of a range of child views and is similar to UIKit's UITabBarController . It provides an easy and intuitive way to…

Usage of SOLID principles in iOS development

You can read about SOLID principles with examples in Java . In software engineering, SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible, and maintainable. In short, you should keep in your mind Each class should have only one responsibility. Class should be opened for extension but closed for modification. Child class should not…