Tag: swift
-
Adjust Baseline of Text Using NSAttributedString
Fix Urdu font issues in iOS
-
URL Encode only Unicode Characters
Make your URLs readable by the Framework SDK
-
Get device token for remote push notifications in Swift 3
When registering device to receive remote notifications, we can use device token to uniquely identify each device and even send the token to our server. Consider the following code Here is gist for the example Source: RayWenderlich
-
Custom Sorting an Array in Swift
Let’s assume we have following Business struct And we have following data set for business with left value being businessId and right being rating We should sort businesses in descending order of rating. For the businesses that have same rating, the original order of business should remain same. To solve this, we can have following…
-
Configure Audio Session for background audio mode (iOS Project)
We use AVPlayer from AVFoundation to play audio in our applications. The moment we send the application to back ground mode, audio stops playing. To fix this, we will need to configure AVAudioSession properly. We start by importing AVFoundation in AppDelegate or our iOS Project. Next, add the following code in application didFinishLaunchingWithOptions: Finally, enable…
-
Working with live views in Swift Playground
Prototype faster in Swift Playground without Projects
-
Generate Random Colors in Swift
Randomize UIColor