Category: iOS Swift
-
Git Submodule Adding To Existing Git Project
Tidy way of adding 3rd part frameworks in your project is; First, go into project folder clon the 3rd part frameworks in this with git command below. It will create a Frameworks folder and sub folder for the desired repository. #example below for adding SwiftyJSON git submodule add https://github.com/SwiftyJSON/SwiftyJSON.git Frameworks/SwiftyJSON #example below for adding Alamofire git…
-
Playing YouTube Videos In iOS Device
Playing a YouTube video in the app is very easy with UIWebView Here is a snippet // YouTube video @IBOutlet weak var webView: UIWebView! // MARK: – Embed Video Player // id is like: xjr89789234 (grab this from youtube url) func loadYoutube(_ videoID:String) { guard …
-
iOS Swift Detecting Device Rotation
How to detect device rotation event in iOS Swift 3: Detecting device rotation is not a big secret but doing this in a clean way is important. I mean adding and removing the observers in correct time/place. Many developer are adding observers without removing with exit. This leads memory leaks and performance issues. override func…
-
UIView With Rounded Background Designable In Storyboard
This class can be inherited as a base class for having any time a framed background behind the UIView. It is also designable in the Storyboard. I’ve used it in UITableViewCell for my customCell view.
-
iOS Swift Programming Patterns: Singleton
What is Singleton Pattern? The Singleton pattern is class which initiated once itself and give global access to this created instance. As it has a unique instance, class variables and methods are shared in entire application/namespace. To understand better let’s check where we can use this pattern.