Use different font text in a Label in swift


let secondLabel=UILabel(frame: CGRectMake(0, 16, _screenWidth-2, 20))         secondLabel.textColor=UIColor.whiteColor()         secondLabel.textAlignment=NSTextAlignment.Center         secondLabel.font=UIFont(name: "Arial", size: 12)         bottomView.addSubview(secondLabel)                  let attrSting=NSMutableAttributedString(string: "I agree to the Terms of Service and Privacy Policy.")             ... Continue Reading →

Advertisements

A Quick start with Swift


1.Create UILabel in Swift programmatically var textLabel=UILabel(frame: CGRectMake(15, 5, self.view.frame.size.width-30, 40))         textLabel.text=tableArray[indexPath.row];         textLabel.textColor=UIColor.blueColor()         textLabel.textAlignment=NSTextAlignment.Center         cell.addSubview(textLabel) 2. Add border using Swift textLabel.layer.borderColor=UIColor.orangeColor().CGColor textLabel.layer.borderWidth=2.0 3. Move form one Window to Another window using Swift let challengeTable = self.storyboard?.instantiateViewControllerWithIdentifier("challangeTable")as ChallengeTable     ... Continue Reading →

Blog at WordPress.com.

Up ↑

%d bloggers like this: