Tag: ios8

“stream正在打开之前发送一个事件”

我试图用Swift做一个SOAP请求。 从9/9/14运行最新的Xcode / iOS。 我使用NSMutableURLRequest来添加一个HTTPBody到请求信息。 但是,一旦我开始与请求的NSURLConnection ,我得到一个错误“streamxxxxxxxxx正在发送一个事件之前被打开”。 我没有使用任何networking库,只是一个普通的旧的NSURLConnection 。 有什么想法可能会导致此错误? 谢谢! 相关的使用代码: func createSOAPRequestWithEnvelope(soapEnvelope : String) { //create request var url = NSURL(string: "https://my-service-url") var req = NSMutableURLRequest(URL: url, cachePolicy: NSURLRequestCachePolicy.UseProtocolCachePolicy, timeoutInterval: 5000) req.addValue("text/xml", forHTTPHeaderField: "Content-Type") req.HTTPMethod = "POST" req.HTTPBody = soapEnvelope.dataUsingEncoding(NSUTF8StringEncoding) //begin connection var connection = NSURLConnection(request: req, delegate: self, startImmediately: false) connection.scheduleInRunLoop(NSRunLoop.mainRunLoop(), forMode: […]

iOS 8 PhotoKit。 从iCloud照片共享相册中获取最大尺寸的图像

如何从iСloud获取全尺寸图像? 每次我试图得到这张照片,我得到图像大小256×342。 我也看不到进展。 码: PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[assetIdentifier] options:nil]; PHImageManager *manager = [PHImageManager defaultManager]; [result enumerateObjectsUsingBlock:^(PHAsset *asset, NSUInteger idx, BOOL *stop) { PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init]; options.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat; options.synchronous = YES; options.networkAccessAllowed = YES; options.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) { NSLog(@"%f", progress); }; [manager requestImageForAsset:asset targetSize:PHImageManagerMaximumSize […]

Xcode 6 + iOS 8 SDK,但部署在iOS 7(UIWebKit&WKWebKit)

我们正在iOS 8 SDK上使用Xcode 6 beta 5 + Swift创build应用程序。 我们也想部署到iOS 7。 那可能吗? 当我们将项目的部署目标设置为7.0时,我们得到如下的编译时错误: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_WKPreferences", referenced from: __TMaCSo13WKPreferences in WebViewController.o "_OBJC_CLASS_$_WKWebView", referenced from: __TMaCSo9WKWebView in WebViewController.o "_OBJC_CLASS_$_WKWebViewConfiguration", referenced from: __TMaCSo22WKWebViewConfiguration in WebViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see […]

迅速UIGestureRecogniser跟随

我正在使用Swift制作iOS8应用程序。 我希望用户能够使用手势来揭示界面的某些部分。 因此,例如,用户将手指向上滑动,手指向上滑动的视线沿着手指移动,从而露出另一个视图。 我想要的是一个手势来给出类似于通知框的结果,你可以从屏幕的顶部拉下来。 我一直在看文件,我似乎无法find一个合适的手势。 我看到一个名为UISwipeGestureRecogniser的,但唯一的问题是,它不跟随你的手指,当我滑动手指时,它只是运行一个函数。 以下是文档页面: https : //developer.apple.com/documentation/uikit/uigesturerecognizer

在iOS 8的今天扩展适合宽度

当我制作任何iOS 8 Today扩展时,即使在Interface Builder中我在x = 0的左侧放置了一个标签,左边的空白区域大约为48px。 我已经看到,有些应用程序使用全宽度小部件。 我怎样才能达到类似的东西? 谢谢! 更新:解决 我把这个示例代码放在这里,因为我猜这对别人有用。 正如@ matteo-lallone所build议的,正确的做法是: -(UIEdgeInsets)widgetMarginInsetsForProposedMarginInsets:(UIEdgeInsets)defaultMa‌​rginInsets{ return UIEdgeInsetsZero; }

如何确定一个WKWebView的内容大小?

我正在尝试在iOS 8和更新版本下运行时用WKWebView实例replacedynamic分配的UIWebView实例,而我找不到确定WKWebView内容大小的方法。 我的Web视图embedded在一个更大的UIScrollView容器中,因此我需要确定Web视图的理想大小。 这将允许我修改其框架以显示其所有的HTML内容,而无需在Web视图中滚动,我将能够为滚动视图容器(通过设置scrollview.contentSize)设置正确的高度。 我试过sizeToFit和sizeThatFits没有成功。 这是我的代码,创build一个WKWebView实例,并将其添加到容器滚动视图: // self.view is a UIScrollView sized to something like 320.0 x 400.0. CGRect wvFrame = CGRectMake(0, 0, self.view.frame.size.width, 100.0); self.mWebView = [[[WKWebView alloc] initWithFrame:wvFrame] autorelease]; self.mWebView.navigationDelegate = self; self.mWebView.scrollView.bounces = NO; self.mWebView.scrollView.scrollEnabled = NO; NSString *s = … // Load s from a Core Data field. [self.mWebView loadHTMLString:s baseURL:nil]; […]

window.close()不适用于iOS 8 GM种子

我试图通过使用window.open() ,然后使用window.close()closures,但似乎window.close()在safari(iOS 8 GM种子)中工作,打开新的选项卡。 这里是代码: A.html: <button onclick="window.open('./B.html'); return false;">Open B</button> B.html: <button onclick="window.close();">Close</button> 我尝试了几种方法: setTimeout , window.open()然后closures,但没有帮助。 有这种情况的解决方法吗?

我的iOS应用程序中的键盘在iPhone 6上太高。如何调整XCode中键盘的分辨率?

目前,我正在将我现有的iOS应用程序调整为iOS 8和iPhone 6.目前,iPhone 6上的键盘看起来相当高(如iPhone 6支持更新之前的WhatsApp应用程序)。 有人可以告诉我,我必须做什么,解决这个在我的代码?

以编程方式更改初始屏幕图像

是否允许通过代码设置启动屏幕图像。 因为我需要多次改变它?

的UIWindow? 没有名为bounds的成员

我试图更新PKHUD( https://github.com/pkluz/PKHUD )与Xcode 6testing版5一起工作,几乎通过除了一个微小的细节: internal class Window: UIWindow { required internal init(coder aDecoder: NSCoder!) { super.init(coder: aDecoder) } internal let frameView: FrameView internal init(frameView: FrameView = FrameView()) { self.frameView = frameView // this is the line that bombs super.init(frame: UIApplication.sharedApplication().delegate.window!.bounds) rootViewController = WindowRootViewController() windowLevel = UIWindowLevelNormal + 1.0 backgroundColor = UIColor.clearColor() addSubview(backgroundView) addSubview(frameView) } // […]