Swift UIColor utilities : Random Hex colour codes, Random UIColor

Simple to use swift functions which are very useful in development and testing.

1. Generating random UIColor in Swift: Function returns random UIColor each time

func randomUIColor(alpha:CGFloat!)-> UIColor
{
    return  UIColor(red: CGFloat.random(in: 0...1), green: CGFloat.random(in: 0...1), blue: CGFloat.random(in: 0...1), alpha: alpha)
}

2. Random HEX Color code in Swift 3: Function returns random 3 char Hex colour code each time.

Read more

Download Xcode: Download Xcode 15/14/13 xip

Download links for Xcode 10.1, Xcode 10, Xcode 9, Xcode 8, XCode 7, XCode 6 are given below. The list is organized in newest first and a developer account login will be required. Latest Xcode version on top Xcode 15 15.3 15.2 15.1 15.0 Xcode 14 14.3.1 14.3 14.2 14.1 14.0.1 14.0 Xcode 13 13.4 … Read more

Apple into BLE and WiFi aided indoor positioning

In WWDC 2014  session 708 Apple gave a introduction about indoor positioning. The indoor positioning is a area which cannot be covered using GPS as the signals are not expected to be accurate enough inside steal and concrete structure.So the the available signals were WiFi and beacons using BLE.

Read more

UITableView Tutorial : Creating a simple app in swift

This article has been updated for Swift 3

One of the most versatile UI elements which you come across in iOS development is UITableView.With a combination of custom cell and animation its possibilities are endless.From fancy menu to image scroll you must have found it at many places. In fact UITableView is so versatile that you can truly divide UI in two parts those which can be made using UITableView and those which cannot.I must admit in one of my lazy spur i rotated UITableView using CGAffineTransform to implement horizontal scroll.

Read more

Resolving jerky UITableView Scroll

Hi We all have faced situation where scrolling of table view is not smooth.There can be many causes for the same. In order to speedup the scroll we can do a quick check 1.Avoid drawing. 2.Avoid manipulating layers. 3.Try to return cell as quickly as possible.for that you can move the data feeding for the … Read more

Dynamic height UITableViewCell using Auto layouts

How to create dynamic height tableview cell has been a very daunting task especially when you have to calculate and return variable row height in [code]- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;[/code] But with autolayouts its very simple.you just have to make sure that the constraints of the tableview cell subviews are added in such a way … Read more

File Upload using AFNetworking in iOS application.

Hi If developing a app at times you are required to upload files. As i got stuck many times so i thought about writing most common way of uploading. UpDate for AFNetworking 3.0 AFNetworking 3.0 is NSURLSession based. NSMutableURLRequest *upload_request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@”POST” URLString:@”<path_URL>” parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) { [formData appendPartWithFileData:data name:@”upload_file” fileName:@”<your_filename>” mimeType:@”text/plain”] // you … Read more