2017-06-30 95 views
1

iOSのWKWebViewに問題があります。テーピング要素<input type="file" accept="image/*">の後に、3つのオプションを含むActionSheetが表示されます。フォトライブラリiCloudキャンセルWKWebviewと<input type = "file"

フォトライブラリをタップすると、ActionSheetが表示されなくなり、WebViewは再びActionSheetを開くことを防ぎます。私は、WebView経由で写真をアップロードすることで立ち往生しています。

info.plistファイルにプライバシーを追加しました(プライバシー - フォトライブラリ使用の説明)。ここで私はWebViewの

WKWebViewConfiguration *wkConfiguration = [[WKWebViewConfiguration alloc] init]; 
wkConfiguration.allowsInlineMediaPlayback = true; 
wkConfiguration.mediaPlaybackRequiresUserAction = false; 

self.webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:wkConfiguration]; 

self.webView.scrollView.bounces = NO; 
self.webView.contentScaleFactor = 2.0; 
self.webView.exclusiveTouch = YES; 
[self.webView.scrollView setDelaysContentTouches:NO]; 
[self.webView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal]; 

self.webView.UIDelegate = self; 
self.webView.navigationDelegate = self; 

を作成する方法である最悪の事態は私が入力のタップイベントをキャッチすることができない、ということです。多分誰かに同様の問題がありますか?私はStackフォーラムやAppleフォーラムから他のトピックを検索しましたが、どちらも役に立ちませんでした。私はあなたの助けに感謝します。

編集し

システムログが印刷されています

<Error>: -[NETAWDManager reportStats:metricID:] AWDServerConnection newMetricContainerWithIdentifier failed for metric 2686983, server 0x16d62570, not reporting: 
<AWDLibnetcoreTCPConnectionReport: 0x16e418a0> { 
    cellularFallbackReport =  { 
     dataUsageSnapshotsAtNetworkEvents =   (
         { 
       bytesIn = 1999999; 
       bytesOut = 1600; 
      } 
     ); 
     "fallbackTimer_msecs" = 0; 
     fellback = 0; 
     networkEvents =   (
      "NETWORK_EVENT_DATA_STALL_AT_APP_LAYER" 
     ); 
     "timeToNetworkEvents_msecs" =   (
      5168 
     ); 
    }; 
    clientIdentifier = "com.apple.WebKit.Networking"; 
    connectionStatisticsReport =  { 
     DNSAnswersCached = 0; 
     "DNSResolvedTime_msecs" = 0; 
     RTTvariance = 0; 
     "appDataStallTimer_msecs" = 3; 
     appReportingDataStallCount = 1; 
     "bestRTT_msecs" = 0; 
     betterRouteEventCount = 0; 
     bytesDuplicate = 0; 
     bytesIn = 2700000; 
     bytesOut = 3800; 
     bytesOutOfOrder = 0; 
     bytesRetransmitted = 0; 
     cellularFallback = 0; 
     cellularRRCConnected = 0; 
     connected = 1; 
     connectedInterfaceType = "(unknown: 4)"; 
     "connectionEstablishmentTime_msecs" = 1; 
     connectionReuseCount = 0; 
     "currentRTT_msecs" = 0; 
     "flowDuration_msecs" = 40208; 
     interfaceType = "(unknown: 4)"; 
     kernelReportedStalls = 0; 
     kernelReportingConnectionStalled = 0; 
     kernelReportingReadStalled = 0; 
     kernelReportingWriteStalled = 0; 
     packetsDuplicate = 0; 
     packetsIn = 210; 
     packetsOut = 9; 
     packetsOutOfOrder = 0; 
     packetsRetransmitted = 0; 
     "smoothedRTT_msecs" = 0; 
     synRetransmissionCount = 0; 
     tcpFastOpen = 0; 
     "timeToConnectionEstablishment_msecs" = 2; 
     "timeToConnectionStart_msecs" = 1; 
     "timeToDNSResolved_msecs" = 0; 
     "timeToDNSStart_msecs" = 0; 
     trafficClass = 0; 
    }; 
    delegated = 1; 
    reportReason = "REPORT_REASON_DATA_STALL_AT_APP_LAYER"; 
    sourceAppIdentifier = "com.supermemo.sm-com"; 
} 
Jul 6 10:13:59 iPad-xxx assistantd[268] <Error>: tcp_connection_tls_session_error_callback_imp 7 __tcp_connection_tls_session_callback_write_block_invoke.434 error 22 
Jul 6 10:13:59 iPad-xxx assistantd[268] <Error>: NSURLSessionStreamTask: TCPConnection read invalidated by closed connection 
Jul 6 10:13:59 iPad-xxx networkd[87] <Error>: -[NETAWDManager reportStats:metricID:] AWDServerConnection newMetricContainerWithIdentifier failed for metric 2686980, server 0x16d62570, not reporting: 
<AWDMPTCPConnectionReport: 0x16d3ab50> { 
    "client_id" = assistantd; 
    "establishment_cellular_fallback" = 0; 
    "establishment_failure_error" = 0; 
    "establishment_forced_tcp_fallback" = 0; 
    "establishment_interface_name" = en0; 
    "establishment_success" = 1; 
    "establishment_syn_retransmits" = 0; 
    "establishment_tcp_fallback" = 0; 
    "establishment_time" = "0.0573505"; 
    "interface_reports" =  (
       { 
      "data_in_KB" = 5; 
      "data_out_KB" = 2; 
      "interface_name" = en0; 
      "post_connect_subflow_failure_errors" =    (
      ); 
      "post_connect_tcp_fallback_count" = 0; 
      "secondary_flow_failure_count" = 0; 
      "secondary_flow_success_count" = 0; 
     } 
    ); 
    "post_connect_multi_homed" = 1; 
    "post_connect_session_lifetime" = "42.711159041"; 
    "post_connect_single_homed" = 0; 
    "post_connect_subflow_attempt_count" = 2; 
    "post_connect_subflow_max_subflow_count" = 1; 
    "subflow_switching_count" = 0; 
} 

をWKWebViewはOSからファイルを取得するために、いくつかの安全プロトコルを使用していますか?誰かがこれを処理する方法を知っていましたか?

答えて

2

私はついにそれを解決しました。私はUIViewControllerメソッドを実装しなければならなかった:

-(void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion 
{ 
    if (self.presentedViewController){ 
     [super dismissViewControllerAnimated:flag completion:completion]; 
} 
関連する問題