« first day    last day (38 days later) » 

Rob
Rob
02:47
Yo, what's up man?
 
3 hours later…
Rob
Rob
06:00
@Chris Sorry man, I have no idea how to use your app. Tag me when you're awake. I'll see if I can help.
 
5 hours later…
10:38
@Rob morning
so
Rob
Rob
Oh hi there
oh what time is it for you??
Rob
Rob
It's 3:39 am. But I'm going to be up for a while
you still up or up again ?:D
about the app, you know the main screen right? then you tap on a "Wishist", eg "Main Wishlist"
Rob
Rob
Sure, I'll take a look
10:41
inside there you tap the "+" button in the bottom right corner to add a "wish" and this wish gets inserted in the list
Rob
Rob
Ok I see now
there is something wrong with the height constraint but i have no idea why and where
because in WishlistTableViewController I set:
tableView.estimatedRowHeight = 40
tableView.rowHeight = UITableView.automaticDimension
Rob
Rob
This line is suspicious:
label.topAnchor.constraint(equalTo: mainStackView.topAnchor).isActive = true
ive tried it withouth that, only the height anchor but same problem
there is something wrong the way I constraint MainStackView I think
Rob
Rob
Where are you adding text to the label?
10:54
in wishVIew
wishBUttonTapped, at the bottom
and the delegate function is in WishlistVC
also at the bottom: `AddWishDelegate``
Rob
Rob
I see it
This is suspicious:
"<NSLayoutConstraint:0x600002810410 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7ff070d0ece0.height == 20.3333   (active)>"
yes
Rob
Rob
I'm trying something
what are you thinking ?
Rob
Rob
Why are you doing this?
contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0))
11:07
I think it looks better
you can delete it for now if it simplifies things
Rob
Rob
I think that's messing you up
I wouldn't mess with the contentView frame
but ive tried it withouth that as well and it didnt change things :/
Rob
Rob
I got rid of the warning :)
just by deleting the inset???
Rob
Rob
No
As of iOS 13 I've been seeing these layout warnings all over in my table view cells
11:12
why is that?
Rob
Rob
I think it's an iOS bug
But I'm not 100% sure
When you set up your label constraints, try this:
    let labelHeight = label.heightAnchor.constraint(equalToConstant: 40)
    labelHeight.priority = .defaultHigh
    labelHeight.isActive = true
I only knew to do that because I've done it a million times in my most recent code
1 sec
ok that works
with the label
i guess I have do that with every item?
Never wouldve come up with this...
Rob
Rob
I've noticed it only happens when you have a top constraint, a height constraint, and a bottom constraint within the contentView.
So in your case you have stackView.top, label.height, and stackView.bottom
So what I've done in that case, is to reduce the height constraint priority.
By default the priority is .required. .defaultHight is a little bit lower priority
that doesnt seem very intuitive
Rob
Rob
I googled it
11:23
fair enough :D
ok, have you tried adding an image? thats still buggy
Rob
Rob
Haven't tried that yet
I'll take a look in a sec
so right now if you try to add price/note/link it breaks constrains again. And if you try only adding the label and image, the image is outside the contenView
11:44
pushed another version that got rid of another small issue
Rob
Rob
Ok, I'm looking now
Rob
Rob
11:59
Why do you have this:
    imageContainerView.widthAnchor.constraint(equalToConstant: 80).isActive = true
And this:
    wishImage.widthAnchor.constraint(equalToConstant: 70).isActive = true
to add spacing
i had the actual .spacing before
but when there is no image, i dont want spacing at the beginning because then the items(price/note/label) are not lined up with the label
Rob
Rob
You need this:
    wishImage.bottomAnchor.constraint(equalTo: imageContainerView.bottomAnchor).isActive = true
thats working
well
it fixed one issue but now the next issue comes up :D
the image should scale
like when you add the image inside wishView
actually wait, let me try something
Rob
Rob
You also need to do this for your wishImage height. Remove the old height constraint and use this:
    let imageHeight = wishImage.heightAnchor.constraint(equalToConstant: 70)
    imageHeight.priority = .defaultHigh
    imageHeight.isActive = true
For you wishImage contentMode you may want this:
v.contentMode = .scaleAspectFill
thats what Im trying out at the moment
im not sure what would look best
Rob
Rob
12:18
I'm not sure either. You can always come back to that
Do you see any other constraint warnings?
there are several I have no idea but they seem to be bad:D
Rob
Rob
After updating the wishImage height constraint I didn't see any
<NSLayoutConstraint:0x2817cb5c0 UIView:0x108e25b00.width == - 16 (active)>
this one for example
did you see that as well?
Rob
Rob
Is that when you click on the + button?
Or on the image button I mean?
let me check real quick
yes
when you click the image button
also something I didnt quite get is, when tapping the image button, the keyboard appears. so naturally the wishView should move to the Bottom. But couldnt get that done either..
Rob
Rob
12:22
Ok so the constraint warnings when you click the image button happen when the action sheet appears. I am 99% that's an apple bug. I've been seeing that in my code for a long time.
alright, and did you see the other warning ?
Rob
Rob
Which other warning?
[TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. ...
Rob
Rob
Yes, I have tons of those too
I think that's an apple bug as well
do you know the reason for that or how to fix it? tried googling it but couldnt fix it
:D
aaaah, i am trying to set corner radius for the image in the cell and its not working .. I think i cant set corner radius and aspectFit???
Rob
Rob
12:26
As for the tableView layout warning, I don't know your code well enough to know which tableView it is referring to
the tableView in which I add the WishCells
at least I think :D
but thats not a problem right now
did you see the dropDown bug ?:D if you tap the dropDownButton in WishView(to select the list) and you try to select a list that is oustide the white wishView , it doesnt't recognize the tap and instead dismisses the view
these small bugs are really frustrating..
Rob
Rob
Ok let me try
pushed the latest version
Rob
Rob
Yeah, I see that
How did you implement the drop down list?
inside the dropDown Folder
wasnt me, just followed a tutorial
Rob
Rob
12:35
Ok so what do you want to happen. When the dropDown is showing, and you click outside the white area, you want the list to close?
in the picture "Main Wishlist" is not clickable
Rob
Rob
Oh nevermind
I misunderstood your question
onle "Schuhe" and the other list
Rob
Rob
I get it now
which i dont get because if you look at the view hirarchy its at the top...
Rob
Rob
12:39
Man, that's a tricky one
yes.. Been having this bug for quite some time now.
Rob
Rob
Where is the code for dismissing the wish view?
dropDownTableView
at the bottom
dismissDropDown
Rob
Rob
I was actually looking for this: dismissWishView
oh sorry
thats inside WishlistVC
did you find it?
Rob
Rob
12:49
Yeah, I found it
I am adding the gesture recognizer inside `addWIshButtonTapped``
nvm i dont think thats the problem
Rob
Rob
Add this to DropDownCell:
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    super.touchesBegan(touches, with: event)
}

override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
    return super.hitTest(point, with: event)
}
Now, typically those methods would get called if you tap on a cell.
For some reason, if the cell is outside of the white area, neither of those get called.
The trick is to figure out why they aren't getting called.
one more thing
inside wishView
in setupView
I add the button to the actual view
because when adding it to itemView , no cell is clickable
not even the ones inside the white view
Rob
Rob
You are referring to dropDownButton
?
yes
Rob
Rob
13:11
You design is a little funky
So what I'm doing is adding this method:
what do you mean ?:D
Rob
Rob
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {

    return super.hitTest(point, with: event)
}
To WishView
In hitTest, you need to determine if the view that was touched was the DropDownView
If it was touched, then you need to return the DropDownView
why does it not work the way you would expect it to wokr?
and how hard is it to fix this?
Rob
Rob
Ok, I'm getting somewhere
tell me
Rob
Rob
13:20
First, is WishView the view that sits on top of the keyboard?
yes
the white view
Rob
Rob
Ok, so now I can detect when the top-most drop down cell is clicked
I just need to figure out how to register the click with the dropDownView
I got it
:)
In DropDownBtn.didMoveToSuperview add this at the top of the function:
    if let wishView = superview as? WishView {
        wishView.dropDown = dropView
    }
In wishView add this:
var dropDown: DropDownView?

override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {

    let newPoint = self.convert(point, to: dropDown!)
    if dropDown?.point(inside: newPoint, with: event) == true {
        print("yes")
        return dropDown?.hitTest(newPoint, with: event)
    } else {
        print("no")
    }
    return super.hitTest(point, with: event)
}
!!
let me try it
wait where exactly did add this:
if let wishView = superview as? WishView {
wishView.dropDown = dropView
}
Rob
Rob
At the top of DropDownBtn.didMoveToSuperview
override func didMoveToSuperview() ?
Rob
Rob
13:30
Yes
but dropdownbtn doesnt know
ah wait, im stupid
Rob
Rob
Yeah, it's a hack
1 sec
Rob
Rob
Right now, just get it to work. Then you can reconsider your design
runnig it now
works like a charm
now
why was this necessary?
Rob
Rob
13:33
Probably because the dropDown extends beyond the bounds of the wishView
In fact, I'm quite certain that's why
ok make sense I guess
nice workaround
Rob
Rob
If I were you, though, I would move the DropDownView from DropDownBtn to WishView
that would make it easier and cleaner youre righ
t
Rob
Rob
DropDownBtn should not have a reference to DropDownView. When DropDownBtn is pressed, WishView should be the class that handles the opening and closing of the dropDown
Anything else?
I have to go soon
but I am using it in MainVC as well
well there still is the issue with the aspect fit and corner Radius
in wishcell
Rob
Rob
13:39
Ok, let me see
i found this extension but its not working for me
let me push the latest version
done
Rob
Rob
13:51
Sorry man, that's all the time I have
Oh I think I got it
deleted the width and changed it to:
wishImage.trailingAnchor.constraint(equalTo: imageContainerView.trailingAnchor, constant: -10).isActive = true
why are you still up anyway???:D
Rob
Rob
I slept in the day :)
lol
thanks again man.. honestly youre motivating me a lot to keep coding
oh and the cornerRadius thing is still not working, what I did didnt really change anything but I will found what the problem is
Rob
Rob
14:08
No problem man. Good luck to you. Hopefully you figure out that cornderRadius issue.
👍🏻👍🏻

« first day    last day (38 days later) »