Blog

This blog post will give you a brief introduction to a Test-Driven Development(TDD) in Swift and will demonstrate how you can create a very basic Unit test in Swift to test a User Model Struct that holds the details of the Account Registration form. Assume that you need to follow the Test-Driven development approach to…

Read More Swift Unit Test of User Registration Model

In this tutorial, you will learn how to create UIButton programmatically. You will also learn how to do the basic customization of UIButton like setting button tint color, background color and making your button call a function when tapped. Create UIButton A new UIButton can be created of different types: ButtonType.custom, ButtonType.system, ButtonType.detailDisclosure, ButtonType.infoLight, ButtonType.infoDark,…

Read More Create UIButton in Swift Programmatically

In this tutorial, you will learn how to underline text on UILabel in Swift programmatically. To make the text on UILabel underlined we will need to use the NSMutableAttributedString together with NSUnderlineStyleAttributeName. The Swift code snippet below demonstrates how to create a new UILabel programmatically and then use the NSMutableAttributedString to underline the text on the label. Create a…

Read More Underline Text on UILabel in Swift

In this Spring Security tutorial, you will learn how to use the @PreAuthorize annotation to secure method invocation. You can use the @PreAuthorize annotation to secure either method in a Controller class or a method in a service layer class. There are other useful method-level security annotations like the ones below. It is useful to…

Read More Spring Security @PreAuthorize Annotation Example

If needed, it is possible to make UILabel clickable in Swift although it is recommended to use UIButton instead. To make UILabel clickable in Swift, you will need to create a UITapGestureRecognizer and then add it to a label. In this tutorial, you will learn how to create UILabel in Swift programmatically and how to…

Read More Clickable UILabel in Swift Programmatically

In this tutorial, you will learn how to make Zuul API Gateway pass an Authorization header to a downstream Microservice. To learn how to make Spring Boot Microservice read HTTP Request headers, please read this tutorial: Read HTTP Request Header in Spring MVC. Configure Zuul API Gateway to Forward an Authorization Header By default, Zuul…

Read More Pass Authorization Header to Downstream Microservice

When writing code, we organize functionality into functions and group functions and different properties into classes. In Swift, additionally to creating classes we can also create structures or struct for short. Although very similar, Swift classes are different from swift structures. Comparing Structures and Classes According to Swift documentation, structures and classes in Swift have many…

Read More Swift Struct Tutorial with Code Examples

In this tutorial, you will learn how to create UILabel programmatically using a specific height, width, and position as well as using an auto layout. To write Swift code I will use Xcode Playground and if you are interested to learn how to create a new Xcode Playgrounds project, have a look at this tutorial…

Read More Create UILabel Programmatically in Swift

In this tutorial, I will share how to generate a self-signed certificate and enable HTTPS/SSL support in a Spring Boot application. You will also learn how to configure the RestTemplate HTTP client to use the same self-signed certificate to communicate with your Web Service over HTTPS. Let’s start by generating a self-signed certificate. Generate Self-Signed…

Read More Enable HTTPs/SSL in Spring Boot App

In this Spring Boot tutorial, you will learn how to get the details of the currently authenticated principal user. There is more than one way to get currently authenticated user details and in this blog post, I am going to share with you a few. Most likely you already have Spring Security configured for your…

Read More Spring Security. Get Authenticated Principal Details.