Created
October 5, 2017 06:18
-
-
Save harmittaa/a5d4ef1cf00cd94e79be1d3b8490021c to your computer and use it in GitHub Desktop.
Revisions
-
harmittaa created this gist
Oct 5, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ import UIKit class ButtonWithImage: UIButton { override func layoutSubviews() { super.layoutSubviews() if imageView != nil { imageEdgeInsets = UIEdgeInsets(top: 5, left: (bounds.width - 35), bottom: 5, right: 5) titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: (imageView?.frame.width)!) } } }