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

Snapkit, stick UILabel to bottom

I have a scrollview with a couple of elements inside. I must set the bottom label to stick to the bottom of the view no matter what but should not overlap with the view on top of it which happens when the screen is small. How do I achieve this in…
dypbrg
  • 725
  • 1
  • 6
  • 16
2
votes
1 answer

Snapkit and multiple custom cells in TableView

I am using UItableView as a base for a user profile page. I have several custom cells. The first custom cell is images wrapped in scrollview. I have this error when I open this…
Kira
  • 1,575
  • 4
  • 26
  • 48
2
votes
2 answers

How to arrange views in the `UIStackView`?

I want to set four views in the UIStackView with the horizontal direction. The four views next to each without space. My code: let arrangeStackView = UIStackView() let followUpActionView = UIView() let developCurriculumView = UIView() let…
jiexishede
  • 2,473
  • 6
  • 38
  • 54
2
votes
1 answer

Swift Nested Stack Views

Came form android background now trying to understand UIStackView in ios with simple login view example but got confused from distorted output. Following are my details: My Login view file: import UIKit import SnapKit class LoginView: UIView { …
Pushpendra
  • 2,791
  • 4
  • 26
  • 49
2
votes
3 answers

Cannot load module 'Snapkit' as 'Snapkit'

I've tried every way of installing 'Snapkit' but so far I'm not having much luck. I'm using the following:- Xcode 8.3.3 So far I've tried following all the documentation online to solve the issue, however it still isn't working. Including following…
rb2030
  • 416
  • 6
  • 20
2
votes
0 answers

dyld: Library not loaded: @rpath/libswiftMetal.dylib on iOS 11(15A5304j) with Xcode 9 beta 6

I'm trying to provide iOS 11 support to my existing project but when I launch my existing project, my app gets crash as soon as it launches with following error at Xcode console dyld: Library not loaded: @rpath/libswiftMetal.dylib Referenced from:…
Suryakant Sharma
  • 3,852
  • 1
  • 25
  • 47
2
votes
1 answer

View not displayed immediately after layoutIfNeeded is called

I'm trying to have a simple slide-down-from-top animation using auto layout (with the help of SnapKit). Below is the code I use to generate a view, set its constraints and force a reload (thus display) of said view. In the same code cope I change…
2
votes
1 answer

Swift SnapKit how to layout UIView with relative position

func setupPosition() { box.snp.makeConstraints{(make)->Void in make.edges.equalTo(view).inset(UIEdgeInsetsMake(64+20, 20, 250, 20)) } textField.snp.makeConstraints{(make)->Void in …
littlebear333
  • 710
  • 2
  • 6
  • 14
2
votes
1 answer

Cannot set backgroundColor of UIView which is a subview of UIScrollView in Swift

I try to add some UIView objects as subviews to a UIScrollView and give them random color. But these UIView objects' backgroundColor are white. Why can't I set their backgroundColor? I run this project on iOS 10.1, Swift 3.0.1 and SnapKit 3.0.2.…
songlebao
  • 73
  • 1
  • 7
2
votes
0 answers

SnapKit 3.0.0 Swift3 error

I get error. when install "SnapKit 3.0.0" Argument labels '(offset:)' do not match any available overloads Argument labels '(inset:)' do not match any available overloads Argument labels '(priority:)' do not match any available overloads
Inna Black
  • 251
  • 3
  • 9
2
votes
2 answers

snapkit autolayout label width with padding

I have a couple of labels That should have the following requirements minimum width of 38px right aligned height of 22px additional padding to the width of 8px on each side so far I managed to get 1, 2 and 3 working (as the image indicates), but…
Andy Jacobs
  • 15,187
  • 13
  • 60
  • 91
2
votes
1 answer

Terminating app due to uncaught exception Cannot Install Constraint, reason: No common superview between views

I am trying to programmatically create a button and apply constraints with SnapKit. Everything works fine, but when i apply constraint as make.center.equalTo(self.view) it crashes giving me this message "Terminating app due to uncaught exception…
1
vote
2 answers

How to push VC from child VC?

I have three UIViewControllers. First one is MainViewController. MainViewController has TabView and, under TabView, childView (UIView). Depending on picked tab, childViewController is opened (on childView). childViewController has TableView. I want…
1
vote
0 answers

How to display image view amongst stack view

I am trying to display an image view to the right side of Root stack view. I have set the size and width but for some reason it’s not showing my guess is because the rootstock is in a vertical position. If I put the rootstock view in a horizontal…
1
vote
2 answers

How should I set constraints to the subviews of my tableHeaderView?

I have this viewController: class CreateSkillGroupViewController: UIViewController { lazy var headerStack: UIStackView = { let stack = UIStackView(frame: CGRect(x: 0, y: 0, width: 20, height: 400)) stack.axis = .vertical …
BigBoy1337
  • 4,735
  • 16
  • 70
  • 138