diff --git a/FlyingSwallow/Controller/HudViewController.h b/FlyingSwallow/Controller/HudViewController.h index f1c867e..2df0a52 100755 --- a/FlyingSwallow/Controller/HudViewController.h +++ b/FlyingSwallow/Controller/HudViewController.h @@ -30,7 +30,7 @@ typedef enum{ ViewBlockViewMAX }HudViewBlockView; -float accelero_rotation[3][3]; +extern float accelero_rotation[3][3]; @interface HudViewController : UIViewController{ IBOutlet UILabel *batteryLevelLabel; diff --git a/FlyingSwallow/Controller/HudViewController.m b/FlyingSwallow/Controller/HudViewController.m index 0f9de96..42a18cf 100755 --- a/FlyingSwallow/Controller/HudViewController.m +++ b/FlyingSwallow/Controller/HudViewController.m @@ -29,6 +29,7 @@ #import #import +float accelero_rotation[3][3]; @@ -1883,3 +1884,4 @@ - (void)updateJoysticksForAccModeChanged{ @end + diff --git a/FlyingSwallow/Controller/SettingsMenuViewController.h b/FlyingSwallow/Controller/SettingsMenuViewController.h index 37d804f..b0516fd 100755 --- a/FlyingSwallow/Controller/SettingsMenuViewController.h +++ b/FlyingSwallow/Controller/SettingsMenuViewController.h @@ -22,6 +22,7 @@ #import "FSSlider.h" #import "Settings.h" #import "ChannelSettingsViewController.h" +#import #define kNotificationDismissSettingsMenuView @"NotificationDissmissSettingsView" @@ -48,7 +49,7 @@ enum ChannelListTableViewSection { }; -@interface SettingsMenuViewController : UIViewController { +@interface SettingsMenuViewController : UIViewController { IBOutlet UILabel *pageTitleLabel; IBOutlet UIView *peripheralView; @@ -97,7 +98,7 @@ enum ChannelListTableViewSection { IBOutlet UILabel *rudderDeadBandTitleLabel; IBOutlet FSSlider *rudderDeadBandSlider; IBOutlet UILabel *rudderDeadBandLabel; - IBOutlet UIWebView *aboutWebView; + IBOutlet WKWebView *aboutWebView; IBOutlet UITableView *peripheralListTableView; IBOutlet UIButton *peripheralListScanButton; @@ -138,3 +139,4 @@ enum ChannelListTableViewSection { + diff --git a/FlyingSwallow/Controller/SettingsMenuViewController.m b/FlyingSwallow/Controller/SettingsMenuViewController.m index 2f8010b..d27def1 100755 --- a/FlyingSwallow/Controller/SettingsMenuViewController.m +++ b/FlyingSwallow/Controller/SettingsMenuViewController.m @@ -25,6 +25,7 @@ #import "BleSerialManager.h" #import "Transmitter.h" #import "OSDCommon.h" +#import #define kAileronElevatorMaxDeadBandRatio 0.2 #define kRudderMaxDeadBandRatio 0.2 @@ -40,7 +41,7 @@ settings_alert_dialog_calibrate_acc }settings_alert_dialog; -@interface SettingsMenuViewController (){ +@interface SettingsMenuViewController (){ UITableViewCell *reorderTableViewCell; NSMutableArray *pageViewArray; @@ -57,6 +58,8 @@ @interface SettingsMenuViewController (){ CBPeripheral *selectedPeripheral; BOOL isTryingConnect; + + WKWebView *_realWebView; } - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil; @@ -191,7 +194,21 @@ - (void)viewDidLoad } NSURLRequest *request = [NSURLRequest requestWithURL:aboutFileURL]; - [aboutWebView loadRequest:request]; + // Remove existing UIWebView from its superview if any + [aboutWebView removeFromSuperview]; + WKWebView *webView = [[WKWebView alloc] initWithFrame:aboutWebView.frame]; + webView.navigationDelegate = self; + [aboutPageView addSubview:webView]; + webView.translatesAutoresizingMaskIntoConstraints = NO; + // Pin all edges to superview + [NSLayoutConstraint activateConstraints:@[ + [webView.topAnchor constraintEqualToAnchor:aboutPageView.topAnchor], + [webView.bottomAnchor constraintEqualToAnchor:aboutPageView.bottomAnchor], + [webView.leadingAnchor constraintEqualToAnchor:aboutPageView.leadingAnchor], + [webView.trailingAnchor constraintEqualToAnchor:aboutPageView.trailingAnchor], + ]]; + [webView loadRequest:request]; + _realWebView = webView; [self updateSettingsUI]; @@ -414,6 +431,7 @@ - (void)dealloc { [beginnerModeTitleLabel release]; [headfreeModeTitleLabel release]; [headfreeModeSwitchButton release]; + [_realWebView release]; [super dealloc]; } @@ -453,18 +471,6 @@ - (void)updateAileronElevatorDeadBandSlider{ } -#pragma mark UIWebViewDelegate Methods -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { - if (navigationType == UIWebViewNavigationTypeLinkClicked) { - [[UIApplication sharedApplication] openURL:[request URL]]; - return NO; - } else { - return YES; - } -} -#pragma mark UIWebViewDelegate Methods end - - #pragma mark UITableViewDelegate Methods - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { @@ -920,4 +926,15 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto } #pragma mark UIAlertViewDelegate Methods end + +- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { + if (navigationAction.navigationType == WKNavigationTypeLinkActivated && navigationAction.request.URL) { + [[UIApplication sharedApplication] openURL:navigationAction.request.URL]; + decisionHandler(WKNavigationActionPolicyCancel); + } else { + decisionHandler(WKNavigationActionPolicyAllow); + } +} + @end + diff --git a/FlyingSwallow/RCTouch-Info.plist b/FlyingSwallow/RCTouch-Info.plist index 25c67df..062c906 100755 --- a/FlyingSwallow/RCTouch-Info.plist +++ b/FlyingSwallow/RCTouch-Info.plist @@ -51,7 +51,7 @@ CFBundleIdentifier - com.hexairbot.hexmini + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/RCTouch.xcodeproj/project.pbxproj b/RCTouch.xcodeproj/project.pbxproj index b19fa63..d1d81bc 100755 --- a/RCTouch.xcodeproj/project.pbxproj +++ b/RCTouch.xcodeproj/project.pbxproj @@ -3,10 +3,11 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ + 61BED65C2EE5C20E00BF005D /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61BED65B2EE5C20E00BF005D /* WebKit.framework */; }; E00891C417FAC4E500D7081D /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E00891C317FAC4E500D7081D /* CoreMotion.framework */; }; E0142F08174DBFC300C5A9E1 /* SettingsMenuViewController_iPhone_tall.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0142F07174DBFC300C5A9E1 /* SettingsMenuViewController_iPhone_tall.xib */; }; E0142F0A174DC18800C5A9E1 /* Background_Settings_RETINA_TALL.png in Resources */ = {isa = PBXBuildFile; fileRef = E0142F09174DC18800C5A9E1 /* Background_Settings_RETINA_TALL.png */; }; @@ -18,7 +19,6 @@ E01CC8C416F4D9260006921B /* drone.png in Resources */ = {isa = PBXBuildFile; fileRef = E01CC8C216F4D9260006921B /* drone.png */; }; E01CC8C516F4D9260006921B /* world.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E01CC8C316F4D9260006921B /* world.jpg */; }; E01D3474171E707D00618DC0 /* BleSerialManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E01D3473171E707D00618DC0 /* BleSerialManager.m */; }; - E05AA5E5169B4152009DA2A7 /* RCTouch-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E05AA5E4169B4152009DA2A7 /* RCTouch-Info.plist */; }; E05AA5E7169B4227009DA2A7 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = E0E3D35A169B2AE300DC30C6 /* Default.png */; }; E05AA5E8169B42C3009DA2A7 /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = E0E3D364169B31AE00DC30C6 /* Default-Portrait~ipad.png */; }; E05AA5F3169B494B009DA2A7 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E0E3D358169B2A9000DC30C6 /* Default@2x.png */; }; @@ -139,6 +139,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 61BED65B2EE5C20E00BF005D /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; E00891C317FAC4E500D7081D /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; E0142F07174DBFC300C5A9E1 /* SettingsMenuViewController_iPhone_tall.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SettingsMenuViewController_iPhone_tall.xib; sourceTree = ""; }; E0142F09174DC18800C5A9E1 /* Background_Settings_RETINA_TALL.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Background_Settings_RETINA_TALL.png; sourceTree = ""; }; @@ -298,6 +299,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 61BED65C2EE5C20E00BF005D /* WebKit.framework in Frameworks */, E00891C417FAC4E500D7081D /* CoreMotion.framework in Frameworks */, E01CC375171E4FFB008CA464 /* CoreBluetooth.framework in Frameworks */, E0E55A971691CB6100EE25B6 /* MediaPlayer.framework in Frameworks */, @@ -358,6 +360,7 @@ E0DDF9BD1684698500F2A21E /* Frameworks */ = { isa = PBXGroup; children = ( + 61BED65B2EE5C20E00BF005D /* WebKit.framework */, E00891C317FAC4E500D7081D /* CoreMotion.framework */, E01CC374171E4FFB008CA464 /* CoreBluetooth.framework */, E0E55A961691CB6000EE25B6 /* MediaPlayer.framework */, @@ -645,7 +648,8 @@ E0DDF9B11684698500F2A21E /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 2600; ORGANIZATIONNAME = www.angeleyes.it; TargetAttributes = { E0DDF9B91684698500F2A21E = { @@ -655,7 +659,7 @@ }; buildConfigurationList = E0DDF9B41684698500F2A21E /* Build configuration list for PBXProject "RCTouch" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -663,6 +667,7 @@ "zh-Hant", "zh-Hans-CN", zh, + Base, ); mainGroup = E0DDF9AF1684698500F2A21E; productRefGroup = E0DDF9BB1684698500F2A21E /* Products */; @@ -769,7 +774,6 @@ E0E3D357169B299400DC30C6 /* Default-Landscape~ipad.png in Resources */, E0E3D35F169B2F4200DC30C6 /* Channel_Settings_Bg.jpg in Resources */, E0E3D36C169B348100DC30C6 /* About.html in Resources */, - E05AA5E5169B4152009DA2A7 /* RCTouch-Info.plist in Resources */, E0AE67C3185EB58800802775 /* help_page_02.png in Resources */, E05AA5E7169B4227009DA2A7 /* Default.png in Resources */, E05AA5E8169B42C3009DA2A7 /* Default-Portrait~ipad.png in Resources */, @@ -852,12 +856,35 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer: yu chuan (A9FQ53NVN8)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -865,11 +892,16 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -878,18 +910,44 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution: Guiyang YiDong Information Technology Co. Ltd."; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Guiyang YiDong Information Technology Co. Ltd."; COPY_PHASE_STRIP = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -898,12 +956,14 @@ E0DDF9D31684698500F2A21E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_IDENTITY = "iPhone Developer: yu chuan (A9FQ53NVN8)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: yu chuan (A9FQ53NVN8)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "FlyingSwallow/RCTouch-Prefix.pch"; INFOPLIST_FILE = "FlyingSwallow/RCTouch-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + PRODUCT_BUNDLE_IDENTIFIER = com.hexairbot.hexmini; PRODUCT_NAME = RCTouch; PROVISIONING_PROFILE = "FFDB58C7-D9B4-42E7-8D98-44635D3A45F7"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; @@ -915,12 +975,14 @@ E0DDF9D41684698500F2A21E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_IDENTITY = "iPhone Distribution: Guiyang YiDong Information Technology Co. Ltd."; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: yu chuan (A9FQ53NVN8)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "FlyingSwallow/RCTouch-Prefix.pch"; INFOPLIST_FILE = "FlyingSwallow/RCTouch-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + PRODUCT_BUNDLE_IDENTIFIER = com.hexairbot.hexmini; PRODUCT_NAME = RCTouch; PROVISIONING_PROFILE = "99E9D8B7-4B47-4715-BCEF-D2A69215E34E"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; diff --git a/RCTouch.xcodeproj/project.xcworkspace/xcuserdata/rlapuente.xcuserdatad/UserInterfaceState.xcuserstate b/RCTouch.xcodeproj/project.xcworkspace/xcuserdata/rlapuente.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..fbb9c22 Binary files /dev/null and b/RCTouch.xcodeproj/project.xcworkspace/xcuserdata/rlapuente.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/RCTouch.xcodeproj/xcuserdata/rlapuente.xcuserdatad/xcschemes/xcschememanagement.plist b/RCTouch.xcodeproj/xcuserdata/rlapuente.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..14f718f --- /dev/null +++ b/RCTouch.xcodeproj/xcuserdata/rlapuente.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + RCTouch.xcscheme_^#shared#^_ + + orderHint + 0 + + + +