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.
240
questions
1
vote
1
answer
26
views
How to get off the floor by half the height of View using a snapkit
'UIView' is displayed using the snapkit (assuming 200 heights)
Use "equalToSuperview" to secure it to the floor
I want to lower the Y axis of the UI view to half the height.
self.tempView....
1
vote
1
answer
111
views
Adjusting ContentView size using SnapKit
When using Auto Layout my code would look like this:
let safeAreaLayoutGuide = contentView.safeAreaLayoutGuide
let bottomAnchor = userImage.bottomAnchor.constraint(equalTo: ...
0
votes
1
answer
55
views
Is using SnapKit causing memory leaks
I am using SnapKit to handle my AutoLayout. I am wondering does this code cause a memory leak because I am capturing self in a closure?
writtenUpSwitch.snp.makeConstraints {
$0.trailing....
0
votes
0
answers
63
views
iOS AutoLayout issue(Tabman & SnapKit): Having trouble aligning the bottom of one container with the top of safe area
I'm having problems with autolayout(I'm using SnapKit).
I use Tabman (Tabman doc is here) to create my Home View.
I use Tabman's API to create custom layout for tabs.
Here is my code:
import UIKit
...
-2
votes
1
answer
29
views
How to maintain other label's position?
I'm building an app that can add UILabel(can move with gesture) on UIView.
First, Add a label and move it to another position.
Second, Add another label.
Then makeConstraints have an effect on first ...
0
votes
0
answers
14
views
How to show SKShapeNode inside another SKShapeNode and separate fields
I want to show circles inside another circles.
I have SKScene with radialGravityField. Big circles (SKShapeNode) have physicsBody.
self.physicsBody = {
let path = SKShapeNode(circleOfRadius: ...
0
votes
0
answers
37
views
How to expand and shrink my ViewControllerCell?
So i have this custom view cell, i want to expand it twice his height without his content getting adjust
this is what i was trying to do
import Foundation
import UIKit
import SnapKit
class ...
1
vote
2
answers
53
views
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 ...
0
votes
0
answers
29
views
Expanding the touch area of navigation button
I am trying to expand the touch area of the filter button. When the green filter indicator appears it reduced the size. How can I fix this?
private func setupView() {
self.snp....
0
votes
0
answers
23
views
How to prevent a text from bouncing in collapsible custom cell?
I'm attempting to create a custom UICollectionViewCell. The cell includes a subtitle label, which should expand and contract in response to the user's interaction with a show more button. However, ...
0
votes
1
answer
226
views
How to stretch cell to full screen?
I have a UIView inside a table cell. I need to stretch my cell on full screen.
In my table view I have this:
table.rowHeight = UITableView.automaticDimension
But now I can't to make this.
My code is:
...
0
votes
2
answers
285
views
UITableView self sizing stackView height Constraints issue
I have a problem Self sizing Cell problem.
I want make layout like Feed Content with attached Image like twitter
Profile Image
-
Nickname Label
-
date Label
-
menuBarButton
Vertical - StackView
ㄴ
...
0
votes
1
answer
131
views
How to give animation when I click button which toggle scope in Fscalendar with snapkit in iOS
I currently, I'd like to change FSCalendar's scope with animation using Snapkit.
The code below can replace scope with week and month. But the animation doesn't work.
func calendar(_ calendar: ...
1
vote
0
answers
71
views
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 ...
1
vote
2
answers
164
views
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, ...
0
votes
2
answers
134
views
How to center elements of a stack view in a scroll view vertically?
I have this code I found to put a stack view with many buttons inside of a scroll view.
import UIKit
import SnapKit
class ViewController: UIViewController {
var scrollView: UIScrollView!
var ...
1
vote
1
answer
591
views
Snapkit LayoutConstraints Unable to simultaneously satisfy constraints
I have simple UITableView and custom UITablViewCell in my project, which created programmatically and use SnapKit for auto layout its.
When I run app, everything work fine and get some ...
0
votes
1
answer
282
views
ImageView + scaleAspectFit in containerView, then in cell
i have a cell, that contains containerView with top and bottom cornerRadius = 8.
Then i have to put UIImageView with contentMode = .scaleAspectFit and corner radius ONLY on the top (cornerRadius = 8)
...
0
votes
0
answers
264
views
UIScrollView excessive content height when setting contentInset
I use following code (AutoLayout, SnapKit) to set up scrollView:
public lazy var contentView = UIView()
public lazy var scrollView = UIScrollView()
func addScrollView(insets: UIEdgeInsets, ...
0
votes
1
answer
397
views
SnapKit and custom gradient button Swift
I use SnapKit in my project and trying to add gradient on my button
I have extension:
extension UIButton {
public func setGradientColor(colorOne: UIColor, colorTwo: UIColor) {
let ...
2
votes
1
answer
759
views
Stretchy Header with UIPageViewController
My problem seems obvious and duplicated but I can't manage to make it work.
I'm trying to achieve the famous stretchy header effect (image's top side stuck to top of UIScrollView when scrolling), but ...
0
votes
2
answers
850
views
UIImageView hugging & compression priority not working properly when new image is inserted
I'm trying to make view like this:
Everything works fine, but when I put image from API to that UIImageView, this happens:
UIImageView is stretching even with some Hugging Priority and Compression ...
0
votes
1
answer
328
views
Custom distribution for UIStackView
I have the following UIStackView.
Here is the pseude-code:
let stack = UIStackView()
stack.axis = .vertical
stack.distribution = .fill
Blue, Yellow, Violet and Green views have their correct sizes (...
0
votes
1
answer
347
views
how to add Images and add constraints in TableCell programmatically?
I want to achieve the effect of the picture below. I wanted to add images(which have been framed by me with red lines) in my cell, and how to achieve this?
I try to do some layout by using ...
-1
votes
3
answers
169
views
why Xcode do not execute the codes in func tableView?
question:
I set several breakpoints inside the function of tableView. However the Xcode didn't execute the code inside the tableView. please tell me how to fix these.
I'm new to learn about IOS ...
2
votes
0
answers
175
views
SnapKit Android - Getting IllegalArgumentException when calling send method [closed]
Calling the SnapCreativeKitApi.send method with Android compile sdk as 31 throws a IllegalArgumentException. Does Anyone know when we will we get a sdk update from snapchat. The latest sdk version(v1....
0
votes
1
answer
53
views
UINavigationBar LargeTitle , searchbar didn't work
enter image description here
enter image description here
I want to make it like the picture below, but it comes out like the picture above.
Here is My Code.
lazy var button = UIDropDownButton().then {...
0
votes
2
answers
552
views
Bottom elements in UIScrollView dont show/scroll when using autolayout
I can not get all the content to show inside my scrollview using autolayout via snapkit library. Tried with different constrants but my buttons on bottom are never shown in full and nothing can be ...
0
votes
1
answer
298
views
Using StickerKit from Snapchat in Swift
I am trying to add a sticker with contents of a url photo to post to snapchat.
snapAPI.startSending(snapContent) shows EXC_BAD_ACCESS
and I get a warning:
warning: could not execute support code to ...
7
votes
1
answer
9k
views
How can I lower the view into the safe area?
I'm practicing using snapkit to place ui of view.
However, I tried many things to move the red box into the safe area under the notch, but I couldn't find a way.
var redView = UIView()
...
1
vote
1
answer
143
views
.equalSpacing in UIStackView not working properly with CustomView
I have created a custom view of checkbox / radio button that animates when checked and unchecked. Problem is when I embed the custom view to a stackView that is .equalSpacing the button cannot be ...
0
votes
1
answer
1k
views
How to set the width of a button in snapkit to be the smallest it can be and not exceed a max width
I have a button and I want it to be as small as possible so it just encloses the text but if the button is too big keep it constrained by the size of the containing view inset by 2 standard units.
...
1
vote
0
answers
459
views
Constraints on view not updating
I'm trying to update the constraints of my view when the keyboard appears and disappears
I have notifications for keyboardWillShow and keyboardWillHide and corresponding functions to call them:
...
0
votes
1
answer
67
views
How to trigger when UITextField in UITableViewCell resignFromFirstResponder
I have two UITextFields in UITableViewCell, I want to check when the secondTextField resignFromFirstResponder and both firstTextField and secondTextField empty, It will show a warning label. Please ...
0
votes
0
answers
93
views
Getting constraints logs when programmatically centering an image inside UIButton
I'm tying to create a UIButton with an image inside and I can say that this is working. Just one thing is bothering me and I can't find how to fix this. I'm having a log about a constraint breaking on ...
0
votes
0
answers
358
views
Swift - pageviewcontroller tableview in scrollview using snapkit
I just faced a really difficult point while making a complicated view that has pageViewController, tableview, and scrollview.
This is what I want to program
case 1) scroll up : button stactview and ...
0
votes
1
answer
320
views
Why the view does not fit on the parent view?
I can't understand that the view does not fit on the parent view ? This screenshot shows problem with green button that button doesn't fit parent view. Red background color it is containerView.
I'm ...
0
votes
2
answers
213
views
Configure automatically components in UIStackView (Programatically)
Hi. As you can see, components are overlapped in a UIStackView and I am struggling with that.
Here are some code snippets
class BottomSheetController: UIViewController {
lazy var headerLabel: ...
1
vote
2
answers
744
views
SnapKit throws an error when you try to give constraints to UIView
I have a UIView that is hooked up to my View Controller as IBOutlet. I assigned an AnimationView class instance to this property in my ViewDidLoad method and set constraints to it with animationView....
0
votes
1
answer
1k
views
How to programmatically align elements in a Stackview using SnapKit?
I'm trying to achieve a specific design inside a custom reusable view.
(Something like this: )
So I pass an URL to retrive the image and I pass a String to add below.
Firstly, I want the entire view ...
0
votes
1
answer
687
views
Snapkit - is there a difference between right.width.center and right, width, center?
make.right.width.center equalTo(superview).offset(-20)
vs
make.right.equalTo(superview).offset(-20)
make.width.equalTo(superview).offset(-20)
make.center.equalTo(superview).offset(-20)
is there a ...
2
votes
1
answer
2k
views
How to account for the height of the navigation bar in SnapKit?
I am fairly new to using SnapKit and I've searched everywhere on the internet but could not find the right resource that answers my question. So here it goes. I have one UIView that is a subview of ...
1
vote
2
answers
2k
views
Updating variable in view constraint (SnapKit)
View is initialized with following constraints
View.snp.makeConstraints { (para) in
View.topConstraint = para.top.equalTo(parentview.snp.top).constraint
View.LeadingConstraint = para....
0
votes
1
answer
38
views
Why label does not fit inside tableviewcell?
I am using SnapKit for autolaoyut.
This is my view:
private func makeIconUI() {
contentView.addSubview(iconView)
iconView.snp.makeConstraints { (make) in
make.leading.equalToSuperview()...
2
votes
1
answer
2k
views
Create ScrollView programmatically using Snapkit
I'm working on making scrollview programmatically using snapkit, it works scroll but the problem is that the last element(systemTeal color tempView) can't see fully.
I create contentView inside ...
0
votes
2
answers
674
views
UITableViewCell remake constraints when reuse problem
I have a problem with reusing a cell.
In my cell there is a view that changes the constraints depending on its state. By default, cell height = 0, when the user clicks on the button, it changes its ...
0
votes
1
answer
355
views
Entire view is animating in from the top-left
Hey there internet reader,
I'm building a small feature where my banner animates in from the top using Snapkit and Combine. In my viewDidLoad, I call setupObservers which creates this publisher below.
...
0
votes
1
answer
197
views
How can I adjust the the size of the circle to dynamically adjust to the width and height of any iPhone?
I am using snap kit to set out constraints. The first image is what I'm trying to achieve with the code below. How can I set the constraints off the circle's width and height to be dynamic on any ...
1
vote
1
answer
407
views
CollectionView cell Snapkit constraints fail when applying offset
I have the follwowing constraints applied to my Cell via SnapKit and they work fine.
self.imageView.snp.makeConstraints { make in
make.leading.top.trailing.equalToSuperview()
make....
4
votes
1
answer
753
views
Integrating Snap-kit in android
I am trying to add snap-kit in my application and I have integrated everything as their documentation. App successfully launched Snapchat app but it's not login it shows an error Something is wrong ...