#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):

https://codereview.adblockplus.org/29530611/

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.

Change History (13)

comment:1 Changed 19 months ago by dzhang

  • Blocking 5551 added

comment:2 Changed 19 months ago by dzhang

  • Description modified (diff)
  • Keywords app delegate added; ios removed

comment:3 Changed 19 months ago by dzhang

  • Description modified (diff)

comment:4 Changed 19 months ago by dzhang

  • Description modified (diff)

comment:5 Changed 19 months ago by dzhang

  • Description modified (diff)

comment:6 Changed 19 months ago by dzhang

  • Blocking 5594 added

comment:7 Changed 19 months ago by dzhang

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:8 Changed 19 months ago 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 19 months ago 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 19 months ago by dzhang

  • Cc mario tiago ashephard CraftyDeano added

comment:11 Changed 19 months ago by dzhang

  • Blocked By 5619 added

comment:12 Changed 19 months ago by dzhang

  • Blocked By 5620 added

comment:13 Changed 17 months ago by dzhang

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.