EasySocialButton 1.0.2

EasySocialButton 1.0.2

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2017年11月
SwiftSwift 版本4.0
SPM支持 SPM

Antonio Zaitoun 维护。



  • Antonio Zaitoun

EasySocialButton

一种创建美丽社交认证按钮的简单方法

屏幕截图

安装

Cocoa Pods

pod 'EasySocialButton'

手动

AZSocialButton.swift 拖放到您的项目中。

用法

界面构建器

简单地添加一个 UIButton,然后在 Identity Inspector 中将类更改为 AZSocialButton

编程方式

let socialButton = AZSocialButton(frame: CGRect(x: 20, y: 20, width: 200, height: 40))

socialButton.animateInteraction = true
socialButton.useCornerRadius = true
socialButton.cornerRadius = 5
socialButton.highlightOnTouch = false
socialButton.image = #imageLiteral(resourceName: "ic_google")
socialButton.setTitle("Sign in with Google", for: [])
socialButton.setTitleColor(.black, for: [])
socialButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)

socialButton.onClickAction = { (button) in
    print("do social login stuff")
}

view.addSubview(socialButton)