LoginSignup
12
13

More than 5 years have passed since last update.

二本指(Pinchと回転)で拡縮と回転が出来るUILabel作った

Posted at

iOSでよくある感じなのに実装が難しい操作だと思います。

折角頑張って作ったのでPodにしました。
Swiftで実装したのでCarthageでも使えます。

名前はPinchableLabelです。

Screen Shot

インストール

Podfile
pod "PinchableLabel"
Cartfile
github "malt03/PinchableLabel"

使い方

普通にインスタンス作ってaddSubviewするだけです。
オートレイアウトとか考えだすと面倒なので、Interface Builderからは使えません。

ViewController.swift
let label = PinchableLabel()
label.text = "Label"
label.sizeToFit()
label.center = view.center
view.addSubview(label)

URL

GitHub
CocoaPods

参考

初めてPod作ったのでお世話になりました。
http://qiita.com/makoto_kw/items/edf758a67bd4c2ba5b7a
でも最終的にはやっぱり本家を見た。
https://guides.cocoapods.org/making/using-pod-lib-create.html

12
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
13