Opened on 08/21/2017 at 03:19:22 AM
Closed on 10/14/2017 at 03:06:25 AM
#5550 closed change (fixed)
Convert app delegate to Swift while separating app logic from it
Reported by: | dzhang | Assignee: | dzhang |
---|---|---|---|
Priority: | Unknown | Milestone: | Adblock-Plus-for-iOS-next |
Module: | Adblock-Plus-for-iOS/macOS | Keywords: | swift, app delegate |
Cc: | mario, tiago, ashephard, CraftyDeano | Blocked By: | #5619, #5620 |
Blocking: | #5551, #5594 | Platform: | iOS |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by dzhang)
Background
To kick off Swift development, I've determined that converting the app delegate to Swift is a good place to start. The Swift version will be 4.0.
Since the overall transition will require many new Swift data structures to replace the legacy key-value based implementation, conversion will take place in an incremental manner where some code may be left in OC but made accessible from Swift.
Eventually, all or nearly all code will be transitioned to Swift.
What to change
Convert the app delegate to Swift along with modifying the project as needed to support Swift development.
Separate ad blocking logic from the app delegate implementation using OC or Swift as needed. This is to reduce tight coupling of app operations with SDK requirements, eg app delegate, that can interfere with refactoring like that which is taking place with the transition to Swift.
Next Steps
Following its successful conversion, the primary class for filter list updating, AdblockPlusExtras, will be converted to Swift with RxSwift used for the network operations.
There are some glaring naming issues and the following classes will be renamed for the included reasons.
AdblockPlusExtras is the class responsible for downloading filter lists - the class name bears no indication of its function - something like FilterListsUpdater is more appropriate.
Appearence is spelled wrong. It will be corrected to Appearance.
Goals
- Have a minimal Swift app delegate while maintaining equivalent app functionality.
- Eliminate the OC app delegate and main.m.
- Either rewrite existing functions in Swift or separate them into a temporary OC class.
Attachments (0)
Change History (13)
comment:1 Changed on 08/21/2017 at 03:41:40 AM by dzhang
- Blocking 5551 added
comment:2 Changed on 08/26/2017 at 01:19:45 AM by dzhang
- Description modified (diff)
- Keywords app delegate added; ios removed
comment:6 Changed on 08/30/2017 at 03:25:53 AM by dzhang
- Blocking 5594 added
comment:7 Changed on 08/30/2017 at 04:17:32 AM by dzhang
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:8 Changed on 08/30/2017 at 04:28:04 AM by dzhang
- Summary changed from Convert App Delegate to Swift to Convert App Delegate to Swift while separating app logic from it
comment:9 Changed on 08/30/2017 at 04:28:56 AM by dzhang
- Summary changed from Convert App Delegate to Swift while separating app logic from it to Convert app delegate to Swift while separating app logic from it
comment:10 Changed on 09/02/2017 at 12:17:15 AM by dzhang
- Cc mario tiago ashephard CraftyDeano added
comment:11 Changed on 09/05/2017 at 04:38:59 AM by dzhang
- Blocked By 5619 added
comment:12 Changed on 09/05/2017 at 04:41:43 AM by dzhang
- Blocked By 5620 added
comment:13 Changed on 10/14/2017 at 03:06:25 AM by dzhang
- Resolution set to fixed
- Status changed from reviewing to closed