Code below 👇🏿
lazy var testTextfied: UITextField = {
let testTextfield = UITextField(frame: CGRect(x: 50, y: 150, width: 300, height: 40))
testTextfield.placeholder = "Amount"
testTextfield.font = UIFont.systemFont(ofSize: 15)
testTextfield.borderStyle = UITextField.BorderStyle.roundedRect
testTextfield.clearButtonMode = UITextField.ViewMode.whileEditing
// Left View ‼️✅
let leftVeiwView = UIView(frame: CGRect(x: 10, y: 0, width: 40, height: 40))
testTextfield.leftView = leftVeiwView
testTextfield.leftViewMode = .always
let iconImage = UIImageView(frame: CGRect(x: 10, y: 5, width: 30, height: 30))
iconImage.image = UIImage(named: "liberia")
leftVeiwView.addSubview(iconImage)
return testTextfield
}()

Github: https://github.com/mdrame/UITextfieldLeftView


🤷🏿‍♂️

We’re all aware of this statement that money can’t buy you happiness. Yet, the reality is that our entire livelihood is surrounded around money. Money Money Money, that all we think about. The truth of the matter is that money is something that we all need to survive!. The sole purpose of this blog is to provide you the reader with sufficient evidence that proof’s indeed money can buy happiness.

Let’s first of all look at this on a bigger scale, and find our way down. The chart below depicts most happiness nation, in terms of its citizens.

source: https://www.vox.com/xpress/2014/10/31/7132465/2-charts-that-show-money-really-does-buy-happiness

According…


Change image on UIButton when click

This what you trying to do?

Github repo

Code explanation at the bottom:

import UIKitclass ViewController: UIViewController {// ---------------------------------- //
// - - - - - - - VARS - - - - - - - //
// ---------------------------------- //
var isOn: Bool = false// ---------------------------------- //
// - - - - - - - OUTLETS - - - - - - //
// ---------------------------------- //
// ---------------------------------- //
// - - - - - - - ACTION - - - - - - - //
// ---------------------------------- //
@IBAction func buttonPress(_ sender…


  • Multiple Custom UITextField PlaceHolder with color in Custome class.

I assume you already have your custom UITextField class and Outlets set up, if not here’s a link on how to. I will be here waiting just for you.

I made some changes in this code to avoid the DRY principle. First, we create our textFieldPlaceHolder function with two parameters ‘text’ of type string and ‘color’ of type UIcolor and pass in those parameres as we create our placeholder.

func textFieldplaceHolder(text: String, color: UIColor) {
let placeholderString = NSAttributedString(string: text, attributes: [NSAttributedString.Key.foregroundColor: color])
self.attributedPlaceholder = placeholderString
}

In our HomeViewController, we…


  • Custom UITextField PlaceHolder with color in Custom class.

We will be creating our textField through our storyBoard. For programmatic code check my other post here. Completed code can be found at the bottom of this page.

StoryBoard:

First of all, you will want to make sure that you click on the storyBoard before clicking the Libary ( + ) button. This should be your result.


Aligning Image In Github Readme

Aligning images in a Github README.md file is as simple as writing some HTML code.

Right alignment

<img src=”https://images-na.ssl-images-amazon.com/images/I/51IpDJdKg3L._SY355_.jpg" align=”center” >
<img src=”https://images-na.ssl-images-amazon.com/images/I/51IpDJdKg3L._SY355_.jpg" align=”center” >
<img src=”https://images-na.ssl-images-amazon.com/images/I/51IpDJdKg3L._SY355_.jpg" align=”right” >

( Drinking towards a greener planet)

You never had to settle down for one drink.

Are you the type that drinks your pre workout 30 minutes before you go to the gym and have to go to the water fountain each time you finish a set? Perhaps you are out hiking and thirsty for your favorite drink but cannot access it because two bottles can be way too excessive for most situation especially when working out? You probably live 15 minutes away from the gym and have to wait until you get home to drink your favorite “strawberry swirl paradise banana climate sakeWhey” ProteinShake after an…

Mohammed Drame

SoftWare Engineer (iOS / Backend )

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store