New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Notification Refresh] Likes and follows notifications header redesign #23107
Merged
justtwago
merged 11 commits into
feature/notifications_refresh_p2
from
task/redesign-like-detail-header
May 3, 2024
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
972336f
Redesign likes and follows notifications details headers
justtwago fe94674
Replace navigation buttons for notification details
justtwago f0cac5d
Merge branch 'feature/notifications_refresh_p2' into task/redesign-li…
justtwago 8cf6f21
Update the likes header view
justtwago fc52884
Move notifications nav buttons to the design system
justtwago f0d29ad
Improve lifecycle of NoteBlockHeaderTableViewCell
justtwago 1e5b46d
Configure likes notifications avatar using Avatar entity
justtwago 4fe893b
Merge branch 'feature/notifications_refresh_p2' into task/redesign-li…
justtwago 9e3e4cc
Make LikesListController parent fieled unowned to avoid keeping stron…
justtwago b3d1c8c
Replace unowned modifier with weak for LikesListController parent pro…
justtwago eab1dc4
Merge branch 'feature/notifications_refresh_p2' into task/redesign-li…
justtwago File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Modules/Sources/DesignSystem/Foundation/Icons.xcassets/arrow.down.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "arrow-down.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+993 Bytes
Modules/Sources/DesignSystem/Foundation/Icons.xcassets/arrow.down.imageset/arrow-down.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
Modules/Sources/DesignSystem/Foundation/Icons.xcassets/arrow.up.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "arrow-up.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+976 Bytes
Modules/Sources/DesignSystem/Foundation/Icons.xcassets/arrow.up.imageset/arrow-up.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] if the view controller owns this
LikesListController
, that in turns owns the view controller through theparent
property, then this is a reference cycle and it will cause a memory leak. I'd suggest to markparent
asweak
.Then you can safe unwrap the optional
parent
property when configuring the cells:If the
parent
is nil, that means the view controller was deallocated and the screen is no longer visible to the user.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Didn't notice the looped references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is ensured semantically that Child can only exist when Parent exists, you can also use
unowned
that removes the need to unwrap. It is kind of a forced unwrapped weak reference in practice. However it highlights the relationship between the 2 objects.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I prefer using
weak
in all scenarios, as usingunowned
carries the risk of the app crashing if the child’s lifecycle outlives that of its parent. In other word, ifparent
is deallocated and the child attempts to access it, the app will crash.I'm okey with keeping
unowned
, but I just wanted to let you know of the potential risks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I researched the difference between
weak
andunowned
modifiers, and I assume thatLikesListController
cannot naturally exist without the "parent"NotificationDetailsViewController
. Such an incorrect state would lead to crashes and defects by default despite this value. I agree that using this modifier, in this case, more straightly indicates a cycled dependency, which is, in my opinion, more beneficial.