Skip to content

Instantly share code, notes, and snippets.

import PlaygroundSupport
import Foundation
let key = "2s7Ymz8gu7_8XuTEeMFVmxJBLmyNNL4n8"
let secret = "8XuXAs8K37ejtYqvsEue2p"
let url = URL(string: "https://api.ote-godaddy.com/v1/domains/available?domain=example.guru&checkType=FULL")
var request = URLRequest(url: url!)
request.addValue("application/json", forHTTPHeaderField: "Accept")
@tranvuhung
tranvuhung / ButtonWithImage.swift
Created October 23, 2018 05:24 — forked from harmittaa/ButtonWithImage.swift
UIButton with label and right aligned image
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)!)
}