Author: Nafiz

  • Complete Login App in SwiftUI

    Complete Login App in SwiftUI

    This project follows the Swift MVVM design pattern. It also includes API examples and industry-standard project structure.

    It requires a Laravel project to run in the background. The Laravel project is very simple it requires only a few simple steps.

    Clone the Laravel project

    Download the source code

    Spread the love
  • Bring macOS app to front when dock icon gets clicked

    Bring macOS app to front when dock icon gets clicked

    Implement applicationShouldHandleReopen in your AppDelegate

    func applicationShouldHandleReopen(_ sender: NSApplication,
                                           hasVisibleWindows flag: Bool) -> Bool {
            // Bring app window when dock icon gets clicked
            if !flag {
                for window: AnyObject in sender.windows {
                    window.makeKeyAndOrderFront(self)
                }
            }
            
            return true
    }
    Spread the love
  • macOS app basic entitlements file

    macOS app basic entitlements file

    Recently, I have submitted a macOS app on the app store where I used this entitlements file. This uses sandbox, allowing the app to call API to a remote server and select files from the user computer.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>com.apple.security.app-sandbox</key>
    	<true/>
    	<key>com.apple.security.files.user-selected.read-only</key>
    	<true/>
    	<key>com.apple.security.network.client</key>
    	<true/>
    	<key>com.apple.security.personal-information.photos-library</key>
    	<false/>
    </dict>
    </plist>
    
    Spread the love