☕️A custom button just like the system AssistiveTouch ☕️
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
CocoaPods 0.39.0+ is required to build AssistiveTouch 3.0.0+.
To integrate AssistiveTouch into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>'
pod 'AssistiveTouch'
Then, run the following command:
$ pod install
let assistiveTouch = AssistiveTouch(frame: CGRect(x: 10, y: 100, width: 56, height: 56))
assistiveTouch.addTarget(self, action: #selector(tap(sender:)), for: .touchUpInside)
assistiveTouch.setImage(UIImage(named: "AsstisTouch"), for: .normal)
view.addSubview(assistiveTouch)
🔑 Basics Swift 3.0