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

Social marketing implementation plan

For one event, they are busy for a month, and the...

From an i-person to an e-person, see Oppenheimer's legendary life

In the film "Oppenheimer", Oppenheimer,...

Put music in your pocket: A comprehensive collection of Hi-Fi flagship models

Hi-Fi is the abbreviation of High-Fidelity in Eng...

Pink pineapple! Can I eat it? Is it delicious? Can I afford it? | Nature Trumpet

Welcome to the 43rd issue of the Nature Trumpet c...

Samsung to produce self-driving chips for Tesla

Recently, according to foreign media reports, Sam...

Diao Ye: Solve this O2O equation and you will know who will die

Business has basic laws, so there is an equation ...

Navigation satellites: a compass in space

Since ancient times, how to find the direction ha...