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
1 answer

Left-aligning vertical UILabel in Swift

I'm working inside a UICollectionViewCell, trying to get a rotated UILabel to stick to the left of the label at a fixed width. This is what I have been able achieve: As you can see, the label's dimensions seem relative to the length of the text and…
Lucas
  • 153
  • 1
  • 11
0
votes
1 answer

SnapKit Updating Constraint causes conflict

I'm building an iOS app against iOS 12 SDK, Swift 4 and SnapKit 4.2 I want to update a constraint when I tap a button but it creates a conflict with the previous version of the constraint. Here's my code: private var menuConstraint:…
Adam Langsner
  • 1,276
  • 1
  • 15
  • 23
0
votes
1 answer

UIScrollView Item not moving from the background

I setup my constraints so that I would have a chart that takes up the screen when you load in, but you are able to scroll down to see more information. However, I can see the scroll bar moving, and the chart does not move! var scrollView:…
Peter S
  • 827
  • 1
  • 8
  • 24
0
votes
0 answers

Can i get value as number by using heightAnchor?

I am a new iOS programming and I am lack at technical part. I am stuck with one issue, I am creating an app which is programmatically and when I set autoLayout using SnapKit library, I am unable to get the height of my view. Here is my…
Visal Sambo
  • 1,270
  • 1
  • 19
  • 33
0
votes
2 answers

Snapkit for android login

I am using the Snapchat login for my android app. When I already have Snapchat installed on my device it opens up the app and asks me to give permissions as expected. When I give permission from Snapchat it is supposed to redirect me to my app from…
nick.tdr
  • 4,627
  • 4
  • 28
  • 41
0
votes
1 answer

How can I use SnapKit achieve this?

I want is like this: Here is my code: let label1 = UILabel() let label2 = UILabel() label1.textColor = .white label1.backgroundColor = .red view.addSubview(label1) label1.snp.makeConstraints { (m) in …
Lixiang
  • 1,108
  • 1
  • 8
  • 5
0
votes
0 answers

Height of a view, that's inside of a card view, from the bottom of the screen? (Moving view above the keyboard when it opens)

I have a rather complex situation. It has to do with moving a view above the keyboard. I have a chat view, much like the one Apple's Messages app. However, it's inside of a card that does not fill the entire screen. Above and below that card are a…
thorng
  • 93
  • 1
  • 4
0
votes
1 answer

How can I include Firebase and Snap Creative Kit as Gradle dependency

I tried to use the Snap Creative Kit in my android project who is already using Firebase and I can not build due to this error : Program type already present: com.google.protobuf.Any$1 Firebase Firestore uses protobuf-lite while Snap Creative Kit…
0
votes
2 answers

Creating NSScrollView with NSTableView without a nib—missing constraints on the TableView

I'm trying to build an NSScrollView with a NSTableView as the content, but I'm getting an error saying I'm missing constaints on the Table and I'm not sure what it is I'm missing. I'm using SnapKit for the layout, and the error message is Detected…
Socii
  • 535
  • 4
  • 13
0
votes
1 answer

UITableViewCell - unable to simultaneously satisfy constraints

I'm using SnapKit in order to make constraints and am creating views programatically. However, there's one thing I can't grasp. I want to add a child UIView into the content view of a table view cell and set its height. This already causes a…
az4dan
  • 651
  • 2
  • 10
  • 30
0
votes
1 answer

Getting warning when trying to use SnapKit to layout UILabels in a custom UITableViewCell

I'm trying to use SnapKit to layout UILabels in a custom UITableViewCell. If I put in this code: override init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) …
bhartsb
  • 1,316
  • 14
  • 39
0
votes
3 answers

Place a UIButton at bottom of UIScrollView with constraints

I have a view with three textfield/textview fields in it, and in order to make the view scrollable when the keyboard appears, I have put all the elements inside a scrollview. The elements where not outside the frame before, so the contentSize should…
ako89
  • 57
  • 2
  • 11
0
votes
1 answer

SnapKit- Unable to add constraints by looping through UIViews

I have multiple TextFields that I would like to apply similar layout constraints to. Instead of repeating such constraints, I created an array of tuples, of type (UITextField, UIView), where the UITextField is the textfield that I want to add…
mistry
  • 459
  • 1
  • 6
  • 16
0
votes
1 answer

in Snapkit, safeAreaLayoutGuide on tableViewController isn't work

I want to put BlueView under NavigationBar on TableViewController. But it does not work. like [1]: https://i.stack.imgur.com/40Crj.jpg class TableViewController: UITableViewController { private func setupView() { …
QueenaHuang
  • 11
  • 1
  • 2
0
votes
1 answer

UIView wont appear

I have a function in my viewController that lays out my views using SnapKit. The funcion looks like this @objc func setupView(){ //will add the scroll view to the subview view.addSubview(scrollView) …
SJackson5
  • 47
  • 7