Swift

How To Fix Warning Attempt To Present UIAlertController On ViewController Whose View Is Not In The Window Hierarchy

I want to implement an effect that when the iOS app starts, it popup an alert dialog on the screen and displays some messages. But during the process, I meet an error message like below, and the alert dialog is not displayed as I want. This article will tell you how to fix this issue.

How To Fix Warning Attempt To Present UIAlertController On ViewController Whose View Is Not In The Window Hierarchy Read More »

How To Fix Xcode Not Automatically Creating Bridging Header File Issue

If you want to import objective-c class’s .h and .m file into the swift project, Xcode will create an Objective-C Bridging Header file in the swift project automatically. But sometimes you will find it does not create the objective-c bridging header file, so you need to create and configure it manually. This article will tell

How To Fix Xcode Not Automatically Creating Bridging Header File Issue Read More »

How To Add iOS App Icon, Image, Color Set To Xcode Project Assets Catalog Correctly

Xcode project organizes project resource files use Asset Catalog. Each asset catalog can contain multiple asset sets such as app icon set, image set, color set, etc. When you create an Xcode project use one project template such as Single View App, it will create a default asset catalog file Assets.xcassets in the project files

How To Add iOS App Icon, Image, Color Set To Xcode Project Assets Catalog Correctly Read More »

How To Create, Align And Wrap Label Text Programmatically In Swift iOS App

UIKit.UILabel class is used to create a label in iOS swift source code programmatically. You can change label text, label text color, label background color, label border width, label border color by setting it’s properties. You can also change the label text alignment by change the UILabel object’s textAlignment property value t0 NSTextAlignment.left, NSTextAlignment.center or NSTextAlignment.right.

How To Create, Align And Wrap Label Text Programmatically In Swift iOS App Read More »

How To Connect Storyboard UI Component To ViewController Class Code

When we develop iOS app use Xcode, we design the app GUI ( graphical user interface ) in Main.storyboard file. And the swift source code is edited in ViewController.swift file. But how to use swift source code in ViewController.swift file to modify storyboard UI component’s attributes or process UI component’s action event? This article will

How To Connect Storyboard UI Component To ViewController Class Code Read More »