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
4
votes
0 answers

Is there a way to get a Users Username (not Display Name) with Snapchats Login Kit?

I am developpong a new app for which it could be helpful to get a Users Snapchat Username from the Login Process provided by Snapchats Login Kit. Getting the Display name and an external ID seems to be possible, but I am interested in finding a way…
4
votes
1 answer

iOS 11, Status bar, Navigation Bar and UIScrollview

I was making some updates to an app for iOS 11 and have run into something I cannot make sense of. My view controller creates all of its subviews programmatically. The first child is an Imageview. On top of that I add a UIScrollView. Within the…
E-Madd
  • 4,414
  • 5
  • 45
  • 77
4
votes
1 answer

Modify constraint programatically using SnapKit in Swift 3 to remove one UIView

I'm modifying the constraint of UIView height consist of nameTextField and its superView inputContainerView using SnapKit. I arrange the height of nameTextField is equal to one-third of the inputContainerView's height. My purpose is to remove the…
rony
  • 500
  • 1
  • 6
  • 21
4
votes
1 answer

What advantages does SnapKit have over using autolayout in Interface Builder?

I've been using Interface Builder almost exclusively ever since Apple introduced autolayout for iOS. I recently came across SnapKit but I don't see any immediate advantage this has over using constraints in IB. The only thing it's got going for it…
Sid
  • 9,508
  • 5
  • 39
  • 60
4
votes
0 answers

How to change height of container based on the views inside it in SnapKit?

I am using SnapKit to make layouts in Swift 3. I have a UIView container which can contain 1 or multiple UIViews. I want to change its height according to views present inside it, much like wrap_content in android. Following is my…
vishalaksh
  • 2,054
  • 5
  • 27
  • 45
4
votes
2 answers

Custom TableViewCell triggers NSLayoutConstraint error 'UIView-Encapsulated-Layout-Height'

I use Automatic Height for cells. And each time I want to update my cell with new data (model variable here) I updated my autolayout constraints and I get an error. Here just to show the issue, I don't even change the constraints. I simply ask to…
Mikael
  • 2,355
  • 1
  • 21
  • 45
3
votes
2 answers

snapkit login kit not working Swift Xcode 11.3.1

I am using Xcode 11.3.1 and try to login with snapchat with loginkit I add the add information in info.plist and my code is SCSDKLoginClient.login(from: self, completion: { success, error in if let error = error { …
balkaran singh
  • 2,754
  • 1
  • 17
  • 32
3
votes
1 answer

How to use AccessToken received from Snapchat to fetch UserData?

Following snapkit Login Documentation (WEB), I implemented server side code and am able to obtain Access Token for the user (Section 2.5 at https://docs.snapchat.com/docs/tutorials/login-kit/web/ ). How do I use this token to actually get user data?…
sudcha
  • 623
  • 6
  • 18
3
votes
2 answers

How to create programatically UITableViewCell using SnapKit that autoresized its height?

Something seemingly simple turned out to be really hard. I have browsed already multiple topics here and on SnapKit GitHub but failed to solve my issue. I want to have UITableViewCell with a label that is positioned in the middle let's say both 50…
theDC
  • 6,364
  • 10
  • 56
  • 98
3
votes
1 answer

SnapKit and Dynamic UITableViewCell not being laid out correctly

I'm currently building a reusable view that takes advantage of the dynamic resizing that UITableView has on offer with its cells. What I'm trying to achieve is to give a view within the cell a width and a height depending on the size it has been…
Tunds
  • 1,804
  • 2
  • 15
  • 30
3
votes
2 answers

Why there is no `self` in the closure in the function `makeConstraints` by SnapKit?

starLabel.snp.makeConstraints { make in make.left.equalTo(starImageView.snp.right).offset(5) make.centerY.equalToSuperview() } The starImageView and starLabel are the properties of current view controller. But, why can I ignore the…
Desgard_Duan
  • 659
  • 1
  • 6
  • 12
3
votes
1 answer

How can I make SnapKit constrain the left and right edges?

Right now if I want to set the margin equally on the left and right side, it requires two lines: label.snp.makeConstraints { make in make.left.equalTo(Constants.margin) make.right.equalTo(-Constants.margin) } The API also allows me to set…
subjective_c
  • 282
  • 2
  • 10
3
votes
1 answer

Adding Snapkit to xcode manually

How to add Snapkit in xcode manually without using cocoapods or carthage ?
Koustov Basu
  • 82
  • 13
3
votes
1 answer

Equal Spacing for several views using SnapKit

How can I use snap kit to achieve the same spacing between views (and the superview for firstSubview.left and lastSubview.right) like for the bars in the picture below (and using SnapKit instead of stack view or so)? Thanks!
Pascal
  • 2,590
  • 3
  • 21
  • 46
3
votes
1 answer

Can two views be spaced using each other in SnapKit?

I want to space an unknown amount of buttons equally across the screen horizontally. I was wondering if I could create their spacing based off each other. For example will the code below work? let button1 = UIButton() let button2 =…
KevinZ
  • 756
  • 1
  • 12
  • 26
1
2
3
15 16