To receive Free Weekly Video Tutorials on Mobile App Development with Swift Programming Language, please subscribe to this blog. And yes :), bookmark and share this page with your friends because new swift code snippets are being added every day. Please subscribe, let’s stay in touch!
If you are interested in video lessons on how to write Unit tests and UI tests to test your Swift mobile app, check out this page: Unit Testing Swift Mobile App
Classes in Swift
- Declare a Class
- Implement a Singleton Class
- Class Extension example in Swift
- Comparable protocol. Compare custom objects.
Functions in Swift
- Declare a function in Swift
- Declare a function with default parameter value
- Declare a function with variadic parameters in Swift
Swift Closures
Dictionaries in Swift
- Create an Empty Dictionary
- Add Item to a Dictionary
- Loop Through a Dictionary
- Remove Item From Dictionary
- Remove All Items From a Dictionary
Arrays in Swift
- Create an Empty Array
- Create an Array with Default Values
- Check if Array is empty
- Loop Through Elements in Array
- Loop Over Array of Elements with Index
- Remove all elements from Array
- Remove element from an Array at a specified index
- Sort Array of custom objects in Swift in Ascending and Descending order
Strings
- Case Insensitive Comparison of Strings in Swift
- Check if a String value is Empty
- Compare if two Strings are equal
Storing Data, Writing, and Reading in Swift
- NSUserDefaults – Writing and Reading values of different data types
- Write String value into a File
- Read File content example in Swift
- Read and Write String values into a file
- Check if file exists
- Delete File
- Load content of a property file in Swift
- Download file from a remote URL in Swift
- Load HTML File from App Bundle
Error Handling in Swift
Date and DateComponents
Background Threads in Swift
Buttons in Swift
- Create UIButton Programmatically
- UIButton with background image
- Create UIBarButtonItem Programmatically
- Create UIBarButtonItem with Image
- Disable UIButton example in Swift
Working UITextField in Swift
- Create UITextField programmatically in Swift
- Set UITextField keyboard return key as Done button and dismiss the keyboard
- Check If UITextField Contains Value
UITextView
- Create UITextView programmatically in Swift
- Customize UITextView programmatically in Swift
- Dismiss keyboard when user taps away UITextView
UISwitch in Swift
UISlider
Working with UIView
UIStepper
UISegmentedControl
UINavigationBar
- Customize UINavigationBar Appearance Programmatically via AppDelegate Swift File
- Customize UINavigationBar Appearance Programmatically in UIViewController
UIImageView & UIImage
- Create Circular UIImage programmatically
- Make UIImage Corners Rounded programmatically
- UIImageView and UIImage. Load image from a remote URL.
UIWebView
- Create UIWebView programmatically and load remote web page using NSURL
- Create UIWebView Programmatically and Display HTML Code
- Load HTML file into UIWebView programmatically
WKWebView
UIDatePicker
UIImagePickerController
UIActivityIndicatorView
UITabBarController
UIAlertController or Dialog messages in Swift
- Create UIAlertController with OK Button
- Create UIAlertController with OK and Cancel buttons
- UIAlertController with two buttons and UITextField
- ActionSheet example in Swift
UITableView
UICollectionView
- Create UICollectionView in Swift programmatically
- UICollectionView. Load list of images from remote server url
Presenting ViewController(s)
- Navigate from AppDelegate.swift to a Different ViewController
- Present New ViewController
- Set Window Root View Controller
- Present ViewController in NavigationController
Network Communication
- Send HTTP GET Request. Example in Swift.
- Send HTTP POST Request. Example in Swift and PHP
- Convert JSON String into NSDictionary in Swift
Screen size and device orientation
- Determine main screen bounds, height and width
- Determine device orientation
- Disable Rotation of UIViewController
- Disable Rotation of UIViewController which is embedded into UINavigationController
AVPlayer, AVPlayerItem and AVPlayerLayer. Play Music.
- AVPlayer. Play Music MP3 File From a Remote URL In Swift
- Add Playback Slider to AVPlayer. Example In Swift
- AVPlayer. Add Periodic Time Observer to Update Music Playback Slider
- Determine User’s Current Location Example in Swift
- Create MKMapView in Swift programmatically
- Drop a Pin on a MapView at user’s current location
- MKAnnotationView – Display Custom Pin Image
- didSelectAnnotationView – Handle User Tap Event on MKAnnotationView
Amazon AWS
- Image Upload to Amazon AWS S3 Bucket. Code Example in Swift
- Select image with UIImagePickerController and upload it to AWS S3 bucket
- Delete file from Amazon AWS S3 Bucket
- List objects stored in AWS S3 bucket
Facebook SDK for iOS
- Fetch Facebook user profile details
- Invite Facebook Friends – Code example in Swift
- Facebook Share photo button
- Fetch and Display user’s Facebook photos
- FBSDKGraphRequest. Publish Message to User’s Feed on Facebook.
Touch ID Verification
Regular Expressions
Local and Remote Notifications
Determine Current iOS Device Model Name