My iOS app

Unwarranted costs for iOS app development

UnReleased: Clouds of Thought iOS app

My money-minded friend - Apple

I thought to utilize by practising iOS app development. I thought what better than making my app for that. Before my spark went out, I quickly opened Xcode on FB provided MacBook and was able to integrate an iOS app which has a webview for these blogs. Yay, feeling accomplished today!

Following are my learnings:

  • Found it easier to follow iOS app development via ViewController.swift for which I found tons of resources. This was my first ever shot at iOS development so I am not sure whether there’s an easier way to get ViewController from AppDelegate, maybe there is! I just created the User Interface: Storyboard project, to avoid seeing AppDelegate.swift files coz I got lost from there only to come back to a Storyboard app.

  • Used WKWebView to call web URLs inside the iOS app:

private let webView: WKWebView = WKWebView()

override public func viewDidLoad() {
    super.viewDidLoad()
    
    webView.navigationDelegate = self
    webView.isUserInteractionEnabled = true
    
    let myURL = URL(string:"https://vishwarajanand.com/blog/")
    let myRequest = URLRequest(url: myURL!)
    webView.load(myRequest)
    
    view = webView
}
  • Restrict user-flows to websites not in my control:
extension ViewController: WKNavigationDelegate {
    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction,
                 decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
        
        guard
            let url = navigationAction.request.url,
            let scheme = url.scheme else {
                // fallback to safari if no url scheme is specified
                decisionHandler(.cancel)
                return
        }
        
        // open in default mail application if mailto link is clicked
        if (scheme.lowercased() == "mailto") {
            UIApplication.shared.open(url, options: [:], completionHandler: nil)
            debugPrint("Safari can open this => \n" + scheme.lowercased())
            decisionHandler(.cancel)
            return
        }
        
        // pass through if dependencies
        if url.absoluteString.range(of: "disqus.com") != nil
            || url.absoluteString.range(of: "accounts.google.com") != nil
        {
            decisionHandler(.allow)
            return
        }
        
        // open in safari if not root website
        if url.absoluteString.range(of: "vishwarajanand.com") == nil
        {
            UIApplication.shared.open(url, options: [:], completionHandler: nil)
            decisionHandler(.cancel)
            debugPrint("Safari can open this => \n" + url.absoluteString)
            return
        }
        decisionHandler(.allow)
    }
}
  • Testing CloudsOfThought app on my iPhone was a bit tricky because I had to got to Settings -> General -> Device Management -> Trust the developer app else it won’t launch

Linked iPhone in Xcode

  • Adding icons was a charm for me coz I already had that the 1024 res banner image from my android app and I used [AppIcon.co website][https://appicon.co/] to generate all the iOS specific icons for me and upload to the Assets.scassets file in Xcode.

Uploading assets

  • At the last step of publishing the app, I was badly disappointed by Apple’s money-minting mindset. It asked me to pay a whopping ~100 USD [148 SGD] as a yearly subscription fee to keep my apps on the iOS platform. Utter sadness! By reading that yearly fees, I was so disgusted that my urge to publish the iOS app on the App Store had died. I see there’s some respite for students and needy folks, good luck to those who still have the enthusiasm to use that! I will still try to keep my test build on my phone and see how long it lasts, I fear Apple will give some random security concerns and force me to delete the app or do it by themself.

Apple Developer Program Pricing

Lastly, I would leave you all with some screenshots of the iOS app that I had made. Cheers!

Notes:

  1. I thought of considering Flutter as well, given I am making mostly the same webview based app for both Android and iOS. But given the massive size of it’s executable - ~1Gb, I lost motivation to try that out. I felt scared to even start exploring what goes inside a flutter app.

  2. I wish Apple changes their pricing policy or there’s a test build sharing app. Not sure whether there’s is one. FB uses TestFlight internally though.

  3. I have open sourced this code on GitHub repo mysiteapp_ios.

Dialogue & Discussion