My iOS app

Unwarranted costs for iOS app development

UnReleased: Clouds of Thought iOS app

My rich 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!

Screenshots

This is how this blogging website looks in an app build over WebView:

Implemntation Details

Following are my learnings:

  1. 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.

  2. 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
     }
     
  3. 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)
         }
     }
     
  4. 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

  5. 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

  6. At the last step of publishing the app, I was badly disappointed that I cannot share iOS app for free. It asked me to pay a whopping ~100 USD [148 SGD] as a yearly subscription fee to keep my apps on the iOS platform. On a human level, I understand that its there for maintaining apps quality on my iPhone. But I was utterly sad! By reading that yearly fees, 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 money to use that! I will still try to keep my test build on my iPhone and see how long it lasts, I fear Apple will have enough security concerns to ask me delete the test build of my app in a few days time.

    Apple Developer Program Pricing

My Take Away

I did not feel 148 SGD is the value of hosting an app to App Store, especially when my website is free. I really believe that building and posting apps in App Store is very costly and not something where I look forward to for learning purposes. I have decided to keep my app private and not pay - hence the title of the blog is also UnReleased.

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. Facebook uses TestFlight internally though.

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

Dialogue & Discussion