13 Apr 2021
These contributions are bug-fixes.
This contribution is composed of two PRs: Open Last Bookmark in 3D-touch and Misaligned texts in History Panel View.
Firefox for iOS offers 3D Touch to help the user access commonly used features. By pressing the app icon on the Home Screen, the user can open the Quick Access menu which lets him quickly perform common app-specific tasks and see interesting information. In our case it has shortcuts to open a New Private Tab, scan QR Code... and open the last bookmark.
This shortcut displays the title and url of the last bookmarked website and open it on user tap.
Currently when a bookmarked site is removed from the bookmark list, the "Open Last Bookmark" value from the Quick Access menu is not updated.
For example, when the user remove the last bookmark, the Quick Access menu keeps displaying it.
When we delete a bookmark, if it was the last one, we remove the shortcut otherwise we update the value of the last bookmark shortcut with the value of the most N - 1 recent one.
In our case a user can directly access the last bookmarked site with
If the bookmark items list response has a length of 0 (we have removed the last bookmarked website) then we remove the openLastBookmark shortcut with
removeDynamicApplicationShortcutItemOfType otherwise we update the last bookmark site with the most recent one (
Here is the code which implement the logic defined above.
Here is an example workflow demonstrating correct working of our logic.
- Add twitter.com to bookmark
- Add facebook.com to bookmark
- Go to bookmark shortcut (showing the facebook.com bookmark)
- Remove the facebook.com bookmark
- Go to bookmark shortcut (showing the twitter.com bookmark)
- Remove the twitter.com bookmark
- Go to bookmark shortcut
- Notice that the bookmark shortcut has disappeared
Firefox for iOS has an History tab where you can find easily access to content you've already viewed.
Currently the Clear Recent History and Recently closed cells have misaligned texts.
The goal of the contribution is to make the UI more consistent by aligning the labels in the cells.
The problem was that the components were using
TwoLineImageOverlayCell (a cell with an image, a label and a description) instead of a
OneLineTableViewCell (a cell which only use an image and a label) which is more appropriate to use in our case as it meets our need and the label is centered by default.
Before implementing our logic, the
TwoLineImageOverlayCell was used with
cell.descriptionLabel.isHidden = true to hide the description as the cells don't have description.
isHidden is a Boolean value that determines whether the view is hidden or not.
The problem was that hidden views still participate in Auto Layout and retain their frames, leaving other related views in their places meaning that the description layout will still affect our cell UI.
As said above, the solution is to use
OneLineTableViewCell when we configure the
Here is the final result showing the History tab with the texts correctly aligned.
The code exploration was the part that took me the most time.
In addition, I'm not accustomed to using XCode in my everyday developer life so I had to adapt to a different IDE than the one I usually use.
This was my first contribution in Swift to an iOS app so it taught me a lot !
Not being an iOS user, I also learned about 3D Touch in its use case in a real app.