iOS Tutorial

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 Change Swift Constraints To Make Autolayout Programmatically

In the previous article, we have learned how to change swift constraints use the auto-layout toolbar visually ( How To Add Constraints In Xcode 10 To Implement Auto Layout ). In this article, I will show you an example of how to use class UIKit.NSLayoutConstraint, UIKit.NSLayoutAnchor and Visual Format Language to add constraints to the

How To Change Swift Constraints To Make Autolayout Programmatically Read More »

How To Fix Swift Fatal Error: Unexpectedly Found Nil While Unwrapping An Optional Value

Swift optional variable is a variable that can have nil ( same to null ) value. And you do not need to initialize an optional variable before using it. If not initialized, the optional variable value is nil. It does not like none optional variable which you must assign an initial value before using it.

How To Fix Swift Fatal Error: Unexpectedly Found Nil While Unwrapping An Optional Value Read More »