Skip to content

Latest commit

 

History

History
54 lines (32 loc) · 2.31 KB

ios_doc.md

File metadata and controls

54 lines (32 loc) · 2.31 KB

Build Application for IOS

To build Sugarizer for ios, first install Cordova as described here and Xcode on your machine.

Then create cordova project name "sugarizer-cordova" at the same location where sugarizer directory is present

cordova create sugarizer-cordova

Go inside sugarizer-cordova directory

cd sugarizer-cordova/

Put make_ios.sh and exclude.ios file in the directory.

Run make_ios.sh script using below command:

For minified version

sh make_ios.sh

For normal version

sh make_ios.sh full

After execution of script, go to "platforms/ios/" directory and open Sugarizer.xcworkspace file in Xcode by double clicking it.

Click on "Sugarizer" title and then click on "build settings"

buildsettings

Scroll down you'll find "Swift Compiler - Language" section. In this section, select "Swift Language Version" as 3 or above

Swift Language Setting

Then go to "platforms/ios/Sugarizer/Plugins/cordova-plugin-file-transfer/" directory and open "CDVFileTransfer.m" file. Comment line 107-110 and save the file.

CDVFileTransfer comment

Then go to "platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/" directory and open "CDVWebViewEngine.m" file. Add following lines after line 205:

WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
// add begin
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
if (@available(iOS 11.0, *)) {
    [wkWebView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
}
#endif
// add end
wkWebView.UIDelegate = self.uiDelegate;

play

That's it. You'll see screen like below.

sugarizer_on simulator