Questions tagged [snapkit]

A Swift Autolayout DSL for iOS & macOS. Use if you have questions about the library and not about Snapchat or similar services.

SnapKit is a DSL to make Auto Layout easy on both iOS and macOS.

GitHub Page

239 questions
0
votes
2 answers

Snapkit and UILabel's rotation

I have: UIView (container) UIView. subview of (1) - Dark blue in the image below UIView. subview of (1) - Purple in the image below UILabel. edges.equalToSuperview() What I'm trying to accomplish: The thing is, I want the UILabel to be rotated…
0
votes
2 answers

UICollectionViewCell layout with SnapKit

I have a simple UICollectionViewCell which is full width and I'm using SnapKit to layout its subviews. I'm using SnapKit for my other view and it's working great but not within the collectionViewCell. This is the layout I'm trying to…
Dennish
  • 116
  • 2
  • 8
0
votes
1 answer

Erratic error in SnapKit

The following is my viewDidAppear() method with which I'm trying to prototype a feature for my app. The graphicsView instance variable is bound via the storyboard to an instance of a subclass of NSView I've written that in turn is enclosed in an…
Feldur
  • 1,121
  • 9
  • 23
0
votes
1 answer

Snapkit constants to replace deprecated .priorityMedium() .priorityHigh() .priorityLow()?

Does Snapkit provide constants to replace the deprecated functions .priorityMedium() .priorityHigh() and .priorityLow() ? The suggested replacement is to use .priority(amount), but I can't find anywhere that mentions how the numbering works - is a…
Nico teWinkel
  • 870
  • 11
  • 19
0
votes
0 answers

Why there is a memory leak using SnapKit?

I'am using SnapKit 3.2.0. When I use snapkit in my project, it shows a memory issue in the Memory Graph of Xcode. I created a very simple project at here. let cell = UITableViewCell() let label = UILabel() label.text = "Hello…
Vitreous-Flower
  • 257
  • 3
  • 18
0
votes
1 answer

How do I animate a sliding UIView from the right side of a host UIView?

Scenario: I've created an 'attributeView' (UITableView) that is a subview (i.e., a member UIViewController's view of a container UIViewController's view) to be displayed along the right corner of the parent view. It is activated by a contextual…
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
0
votes
2 answers

Why label's height is zero?

contentLabel.preferredMaxLayoutWidth = kScreenWidth - 20 contentLabel.numberOfLines = 0 I use SnapKit to set top and left. contentLabel.snp.makeConstraints { (make) in make.top.equalTo(topView.snp.bottom) …
duguyihou
  • 33
  • 3
  • 9
0
votes
1 answer

ios autolayout: dynamic width should push down 2nd label with SnapKit, proper way

I have 2 UILabels. lbl1's text can change, while lbl2's text is static. They are both initially set on the same line. I have lbl1's numberOfLines set to 0 (infinity). I would like lbl2 to push down and align its top to lbl1's bottom when lbl1's…
mcm
  • 655
  • 9
  • 10
0
votes
1 answer

UINavigation titleView bug

if I set a search bar to the navigation titleView, like navigationController?.navigationBar.topItem?.titleView = self.searchBar , but I set it's frame by using autolayout like: self.searchBar.snp_makeConstraints { make in …
dyljqq
  • 41
  • 3
0
votes
1 answer

Snapkit 3.0 can't get correct frame after call layoutIfNeeded

I updated Xcode 8 and SnapKit 3.0 to test auto layout. I can get frame correct after call layoutIfNeeded before i update to SnapKit 3.0. But i get frame.origin.x and .y both negative value now under SnapKit 3.0. example: let signUpView =…
William Hu
  • 15,423
  • 11
  • 100
  • 121
0
votes
1 answer

UIScrollView breaks gesture recognizers in subviews

What is the correct way to allow scrollview to pass gestures to the subviews?
Fdr
  • 3,726
  • 5
  • 27
  • 41
0
votes
1 answer

When using Computed variable and Snapkit: No common superview between views

So here's the thing, I'm declaring a property like this: var aNameLabel: UILabel { guard let foo = Applicant.sharedInstance.realName else { return UILabel(text: "获取姓名失败", color: .whiteColor()) } return UILabel(text: foo, color:…
Allen
  • 189
  • 2
  • 11
0
votes
1 answer

'Cannot Install Constraint', reason: 'No common superview between views

import UIKit import SnapKit class RecordButton: UIView { let box = UIView() let container = UIView() required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setup() } override init(frame:…
0
votes
1 answer

Error swift2 constraints SnapKit

I 'm using SnapKit to add constraints to a picture I have a UIViewController I have this code: imagenPrincipal.contentMode = .ScaleToFill let URL = NSURL(string: oferta!.imagen)! let placeholderImage = UIImage(named:…
Alberto Mier
  • 206
  • 1
  • 3
  • 16
0
votes
2 answers

Cannot import Snapkit into KeyboardViewController

I cant import SnapKit to KeyboardViewController (UIInputViewController) class, it says no such module SnapKit.
Arkalyk Akash
  • 211
  • 2
  • 11
1 2 3
15
16