Share Button in Swift

Share Button in Swift

Source code introduction: Share button written in Swift, simple and easy to use

Test environment: Xcode 6.2, iOS 7.0 or above

Source code effect:

Source code snippet:

  1. let deformationBtn = DeformationButton(frame: CGRectMake( 100 , 100 , 140 , 36 ), color: getColor( "e13536" ))
  2. self.view.addSubview(deformationBtn)
  3. deformationBtn.forDisplayButton.setTitle( "Weibo Registration" , forState: UIControlState.Normal)
  4. deformationBtn.forDisplayButton.titleLabel?.font = UIFont.systemFontOfSize( 15 );
  5. deformationBtn.forDisplayButton.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal)
  6. deformationBtn.forDisplayButton.titleEdgeInsets = UIEdgeInsetsMake( 0 , 6 , 0 , 0 )
  7. deformationBtn.forDisplayButton.setImage(UIImage(named: "Weibo logo.png" ), forState: UIControlState.Normal)
  8. deformationBtn.addTarget(self, action: "btnEvent" , forControlEvents: UIControlEvents.TouchUpInside)

Download address: http://download..com/data/2070216

<<:  Parse Tutorial: Network Backend Basics

>>:  Swift version of infinite loop carousel

Recommend

Nokia N9 is not dead: it can boot up three operating systems

As the last champion of Nokia's MeeGo platform...

Three channels for App operation and promotion: online, offline and new media.

App operation is not easy, which depends on produ...

How to carry out fission activities well? Share a routine!

In fact, all fission activities have only one rou...

The computer can now post to Moments! WeChat search on PC has also been updated

The PC version 3.3.0 was officially released and ...

iOS 8.4 third beta released: the new music app is further improved

Apple today released the third beta of iOS 8.4 to...

Don't know what to do with your kids? Why not look for spring bugs?

Audit expert: Li Weiyang Well-known science write...

In 2023, these rockets will be on a mission, come and take a look!

On January 9, the Long March 7A rocket Sent on th...