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.
229
questions
0
votes
0
answers
33
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
42
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 ...
1
vote
1
answer
150
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
0
answers
45
views
How to using Snapkit in Appkit embedded in SwiftUI a view?
My code does not display bview properly,If it is normal on AppKit, this should be the SwiftUI view causing it not to display properly.
Does anyone know what the cause is?
My code:
struct AView: View {
...
0
votes
0
answers
30
views
Adjust embedded view controllers size in a tab bar view controller
I have a tab bar view controller subclass which has tabs and also has a view above those tabs that it keeps persistent between switching tabs. I'd like to resize the view controllers that are embedded ...
0
votes
2
answers
144
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
92
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
119
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
87
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
111
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
114
views
iOS Tabman Custom Title
The top is the tab bar I made and the bottom is the tab bar I want to make.
Here is my code:
func barItem(for bar: TMBar, at index: Int) -> TMBarItemable {
switch index {
case 0:
...
0
votes
1
answer
37
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
46
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
81
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 ...
2
votes
1
answer
2k
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
63
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
330
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.
...
0
votes
0
answers
121
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
0
answers
23
views
SnapCreativeKitApi always leads to the playtore in android 11
however when I tried it on android 10, SnapCreativeKitApi worked and snapkit app immediately opened and showed Augmented Reality lens. Why when on android 11, when pressing the button for ...
0
votes
1
answer
42
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
50
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
151
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
0
answers
48
views
Bitmoji web sdk integration in Vuejs
I'm trying to integrate bitmoji inside my vuejs app and this is how it works:
I click on the bitmoji icon and click on the login with snapchat button. it opens another tab and displays the snapchat ...
0
votes
1
answer
76
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
109
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: ...
0
votes
0
answers
21
views
Why view with animatedPropery has wrong position at start?
I have animator view, which I init in viewDidAppear
self._view.actionView.layoutIfNeeded()
self._view.actionView.remakeConstaints()
actionAnimator = UIViewPropertyAnimator(duration: 0....
1
vote
2
answers
306
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
433
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
237
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 ...
1
vote
1
answer
972
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
557
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
30
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
746
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
312
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
93
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
72
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
134
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
441
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 ...
0
votes
2
answers
302
views
MkMapView Crash iOS
I am using SnapKit and programmatically adding a MkMapview. Every time i background the application it is crashing with this exception -
std::__1::system_error: mutex lock failed: Invalid argument
I ...
0
votes
1
answer
220
views
Swift: Estimated Height Not Working for UICollectionView
My problem is that setting the estimated height for my collection view layout does not work. Specifically, the cell does not resize dynamically.
My hypothesis is my AutoLayout constraints are not set ...
0
votes
1
answer
101
views
Swift: AutoLayout acting weird
Below is my dilemma and the steps I took to arrive at my situation.
My First Step
I create a class called BubbleView:
import UIKit
import SnapKit
class BubbleView : UIView {
var label:...
0
votes
1
answer
100
views
Swift: AutoLayout constraints not behaving correctly when device rotates?
I am trying to make constraints for a "chat bubble-esque" view.
My problem is the view doesn't expand to 70% of the device's width, when the device is rotated.
Here is a picture to ...
0
votes
0
answers
123
views
How to delete view constraints of xib in code?
There is a view in xib with it's constranits, I want to remake it's constranits with SnapKit:
self.redView.snp.remakeConstraints { (make) in
make.left.equalToSuperview()
make.top.equalTo(300)
...
0
votes
0
answers
40
views
How to constrain a view to keep it's intrinsic width but make keep it constrained to the right
I should first mention I'm using SnapKit for constraints, but I'm looking for an idea for the solution. I've been scratching my head at this problem for a couple days now. I've created a pretty little ...
0
votes
1
answer
390
views
Width constraint change with UIView animation
I have width constraint which I update through SnapKit. Expanding animation:
self.snp.updateConstraints({(make) in
make.width.equalTo(150.0)
})
Collapsing animation:
self.snp.updateConstraints({(...
0
votes
2
answers
1k
views
How to put two labels horizontally by aligning their top edges in iOS?
I want to create custom view like below.
As you see, it consists from title and price labels. Title can have million number of lines, but its top edge should be aligned with price label. It seems ...
3
votes
0
answers
143
views
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 ...
1
vote
2
answers
72
views
Constraints are broken after pushing VC again
My constraints are broke when I pop VC. I have table view, when I firstly push table view, constraints are work perfectly, but after poping and pushing again they are broke. First image are working ...
1
vote
2
answers
511
views
iOS Auto Layout keeps the minimum gap when the space is not enough, and takes up as much space as possible when the space is enough
This is the layout. The top Label text may get very long, and I expect the Label selected at the bottom to be at least 40 pt from the bottom button when there is enough space at the moment, and at ...
-1
votes
1
answer
137
views
Android Creative SnapKit: Photo with attachment Url pop-up opens twice
I am trying to share Image on SnapChat with attached URL generated from Branch IO. For that I have used Creative SnapKit.
When I clicked on the attached link, it gives me two pop-ups.
First pop-up ...