Hi,
        So, yesterday I took a look at Nic’s new code and compared it to the 
last code that I had worked on which turned out to be back in Dec. It seems 
that a lot of our code may be complimentary to each other!  :)  So, this is 
good news. I need to dig in some more, but it looks like we focused on 
different parts of the code. The majority of differences that I saw was that I 
1)  focused on the Sword engine being more 64 bit compliant, so I have a more 
recent version of the Sword engine which is more 64 bit compliant (which makes 
Xcode happier). And 2) also, it looks like I focused more on fixing the search 
downloader using Apple’s newer API. Apple deprecated the class NSURLConnection 
which is what PocketSword normally used to download modules from servers. You 
can see here:

https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/WorkingWithHTTPAndHTTPSRequests/WorkingWithHTTPAndHTTPSRequests.html

Here’s the part in specific from the website:
"If you just need to retrieve the contents of a URL and do something with the 
results at the end, in OS X v10.9 and later or iOS 7 and later, you should use 
the NSURLSession <https://developer.apple.com/reference/foundation/urlsession> 
class. You can also use the NSURLConnection 
<https://developer.apple.com/reference/foundation/nsurlconnection> class for 
compatibility with earlier versions of OS X and iOS."

So, I added/modified a lot of code using NSURLSession. The file 
PSIndexController in specific has most of these changes. The text of the file 
is now a lot longer since the NSURLConnection class involved a lot of 
methods/functions and the newer version NSURLSession sorta has equivalents. 
Also, offhand I believe that Apple’s new API and maybe one of the libraries 
being used changed how threading was done as well. PocketSword normally 
downloads modules on the main thread and I seem to recall that it can not be 
done that way any more. So, I had to write a lot of new code to manage the 
threads so that the downloads don’t download on the main thread anymore. I’m 
guessing that this was done so that long downloads could not block the main 
thread and effectively cause an app to get stuck on a download window. Then I 
had to do some adjusting so that the MBProgressHUD would work right and show a 
progress display to the user.

So, what this means is that normally PocketSword would stay on the download 
window while downloading whereas now, the user can actually go back to a 
different screen during the download. That’s what happened during my testing at 
least which makes sense since the main thread isn’t doing the download. More 
work needs to be done though since it’s right now not very clear to the user 
that the download is happening “in the background”.

        It seems that Nic focused mostly on code specific to PocketSword. A lot 
of 64 bit changes that I had no idea that they needed to be done as well as 
some other specific iOS code that I didn’t know needed updating.

        Regarding my code though, there currently is a problem. I only got far 
enough to code and do some testing for the newer API. I didn’t get far enough 
to code and test for backwards compatibility. :(    Offhand, I think it just 
requires code to be written in the PSIndexController file to test for which 
version of iOS is being used and then for it to use the right methods/functions 
accordingly. The code for showing the download progress might need adjustments 
too accordingly. I’m going to try working on the code this week to see about 
the backwards compatibility and to try getting it going.

        The code that I mentioned that I last worked on back in Dec. that I’m 
using for comparison I’ll upload to my account on bitbucket so that Nic and/or 
whoever can take a look at it. Also, just a note, one of the reasons why my 
code in the past wasn’t put into Nic’s repo was because when I joined 
Bitbucket, they seemed to be going through a major overhaul of their software 
and their instructions didn’t match anymore to the software. So, between that 
and other things going on in life, it just became easiest to just do an upload 
to my own account as opposed to troubleshooting and trying to figure out how 
their software was suppose to work. I am curious though about how the merging 
process is suppose to work so I do plan to learn about it.

        In side news, I  think I also ran across a problem with “find all” for 
Strong’s numbers and fixed that.
        
        
-TS


> On Apr 22, 2017, at 6:54 AM, Nic Carter <niccar...@mac.com> wrote:
> 
> Hi all,
> 
> So, I have tried to play around with PS to get it happy with all the hoops it 
> needs to jump through for it to work again on iOS. This incorporates some 
> hard work done by Manfred & TS.
> 
> Changes:
> - enhancement: 64-bit
> - FIX: search downloader (??)
> - FIX: “find all” for Strong’s Numbers
> - updated: to KJV v2.9 (& now includes the search index in the app bundle)
> - updated: Strongs Greek to the latest Xiphos repo version (v1.5)
> 
> If anyone still uses PS & would like to beta test, please privately email me 
> with your AppleID and I’ll add you to the TestFlight list and you can see if 
> you can break it! :)
> 
> As usual, the src is at https://bitbucket.org/niccarter/pocketsword
> 
> 
> Thanks,
> Nic.
> 
> 
> <<---------------
> "I can't believe that!" said Alice.
> "Can't you?" the Queen said in pitying tone.  "Try again: draw a long 
> breath, and shut your eyes."
> Alice laughed.  "There's no use trying," she said.  "One can't believe 
> impossible things."
> "I daresay you haven't had much practice," said the Queen.
> -----"Through the Looking-Glass" by Lewis Carroll------------->>
> 
> 
> _______________________________________________
> sword-devel mailing list: sword-devel@crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to