Author: Sergey Kargopolov

I’m a software developer with a passion for teaching. I’ve written lots of articles for AppsDeveloperBlog.com and made plenty of video tutorials on my YouTube channel(https://youtube.com/@SergeyKargopolov). If you want to dive deeper, I’ve also got some courses on Udemy(https://www.udemy.com/user/sergeykargopolov/) you might like.

When I’m not coding, I love to travel. I also share my travel adventures over at TravelLocalCanada.com. Hope to see you around on one of these platforms!

Web: www.appsdeveloperblog.com

In this short Swift code example, you will learn how to disable rotation of the UIViewController if device is rotated right or left. Note, that if your view is embedded into UINavigationController a different approach is needed. Check Swift Code Examples page to learn how to disable rotation of the view if it is embedded…

Read More Disable Rotation of UIViewController

In this short Swift code example, you will learn how to: Initialize an Array with 5 elements in Swift, Remove an element from an array at the specified index. Create an Array Let’s first create a new array with some elements in it. // Initialize Array with 5 elements var myArray = [1,2,3,4,5] // Print…

Read More Remove Element From an Array at Specified Index in Swift

Lets’ create an Array with three elements first. var myArray = [“Swift”, “Objective-C”, “PHP”] Now we can loop through all elements in Array for arrayElement in myArray { print(arrayElement) } Loop through an array of elements and print out element index as well as element value. for (index, element) in myArray.enumerated() { print(“Element index: \(index).…

Read More Loop Through Array Elements in Swift

This tutorial will teach you how to create a simple Spring Cloud API Gateway Global Pre-filter and Post-filter classes. Global filters are executed for every route defined in the API Gateway. The main difference between the pre-filter and post-filter classes is that the pre-filter code is executed before Spring Cloud API Gateway routes the request to a…

Read More Spring Cloud API Gateway Global Filter Example

In this Swift code example, you will learn how to make the music playback slider smoothly move as the music continues to play so that the user is visually aware of how much of the music file has been already played and how much is left to play. Create AVPlayer and AVPlayerItem Create UIButton programmatically…

Read More AVPlayer. Add Periodic TimeObserver to Update Music Playback Slider

One way to ensure that an HTTP request to a web service endpoint contains an Authorization JWT token is to configure a gateway route to require an Authorization header.  If the HTTP request does not contain an Authorization header, Spring Cloud API Gateway will not even route this request to a destination microservice. We can…

Read More The Header Predicate in Spring Cloud API Gateway

There are a few different ways of how to create an Array with default values in Swift. Below are a few Swift code examples of creating an Array. Each example creates an array with some initial values. Create an Array of Strings var appleProgrammingLanguages: [String] = [“Swift”, “Objective-C”] Thanks to Swift’s type inference, you don’t…

Read More Create an Array with Default Values in Swift

This tutorial will teach you how to configure your Spring Cloud API Gateway to automatically create routes based on services registered with discovery clients like Eureka, Consul, or Zookeeper. For a step-by-step series of video lessons, please check this page: Spring Boot Microservices and Spring Cloud. Enable Discovery Locator A quick way to enable Spring Cloud…

Read More Spring Cloud API Gateway Automatic Mapping of Routes

To present a ViewController in a NavigationController you can wrap ViewController into a NavigationController as it is in the example below. Then present NavigationController which contains ViewController. // Register Nib let newViewController = CustomSignupViewController(nibName: “CustomSignupViewController”, bundle: nil) let navigationController = UINavigationController(rootViewController: newViewController) // Present View “Modally” self.present(navigationController, animated: true, completion: nil)  

Read More Present ViewController in NavigationController