Skip to content

Commit

Permalink
Version 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dungntm58 committed Nov 8, 2018
1 parent 4924bcd commit 8119dec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions Example/RCStickerView/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

let container = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 400))
self.view.addSubview(container)
container.backgroundColor = #colorLiteral(red: 0.501960814, green: 0.501960814, blue: 0.501960814, alpha: 1)
container.center = self.view.center

let testView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 100))
testView.backgroundColor = .red

let stickerView = RCStickerView(contentView: testView)
stickerView.center = self.view.center
stickerView.center = container.center
stickerView.delegate = self
stickerView.outlineBorderColor = .blue
stickerView.set(image: UIImage(named: "Close"), for: .close)
Expand All @@ -28,7 +33,7 @@ class ViewController: UIViewController {
stickerView.handlerSize = 40
stickerView.movingMode = .insideSuperview(ignoreHandler: true)

self.view.addSubview(stickerView)
container.addSubview(stickerView)

let testLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 100, height: 50))
testLabel.text = "Test Label"
Expand Down
2 changes: 1 addition & 1 deletion RCStickerView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'RCStickerView'
s.version = '0.2.0'
s.version = '0.3.0'
s.summary = 'Add label, image, other custom view as a sticker view.'

# This description is used to generate tags and improve search results.
Expand Down
8 changes: 4 additions & 4 deletions RCStickerView/Classes/RCStickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -568,16 +568,16 @@ private extension RCStickerView {
var bottomPadding: CGFloat = 0
if ignoreHandler {
if positionVisibilityMap[.topLeft]! || positionVisibilityMap[.topRight]! {
topPadding = _handleSize
topPadding = _handleSize - view.frame.origin.y
}
if positionVisibilityMap[.topLeft]! || positionVisibilityMap[.bottomLeft]! {
leftPadding = _handleSize
leftPadding = _handleSize - view.frame.origin.x
}
if positionVisibilityMap[.bottomRight]! || positionVisibilityMap[.topRight]! {
rightPadding = _handleSize
rightPadding = _handleSize + view.frame.origin.x
}
if positionVisibilityMap[.bottomRight]! || positionVisibilityMap[.bottomLeft]! {
bottomPadding = _handleSize
bottomPadding = _handleSize + view.frame.origin.y
}
}

Expand Down

0 comments on commit 8119dec

Please sign in to comment.