xcode8-beta6

Closure use of non-escaping parameter may allow it to escape

≯℡__Kan透↙ 提交于 2019-11-28 04:48:04
I have a protocol: enum DataFetchResult { case success(data: Data) case failure } protocol DataServiceType { func fetchData(location: String, completion: (DataFetchResult) -> (Void)) func cachedData(location: String) -> Data? } With an example implementation: /// An implementation of DataServiceType protocol returning predefined results using arbitrary queue for asynchronyous mechanisms. /// Dedicated to be used in various tests (Unit Tests). class DataMockService: DataServiceType { var result : DataFetchResult var async : Bool = true var queue : DispatchQueue = DispatchQueue.global(qos:

xcode 8 push notification capabilities and entitlements file setting

喜你入骨 提交于 2019-11-27 19:50:58
问题 when using xcode 8 doing the push notification setting, unlike xcode 7 , xcode 8 need developer turn on push notifications capabilities switch ( located at TARGETS -> AppName -> Capabilities as following pic ), then it will generate AppName.entitlements file as following //AppName.entitlements <key>aps-environment</key> <string>development</string> but for production version App, if we change the string to //AppName.entitlements <key>aps-environment</key> <string>production</string> then the

Xcode 8 beta 6: main.swift won't compile

只愿长相守 提交于 2019-11-27 11:56:58
We have a custom UIApplication object, so our main.swift was import Foundation import UIKit UIApplicationMain(Process.argc, Process.unsafeArgv, NSStringFromClass(MobileUIApplication), NSStringFromClass(AppDelegate)) and that didn't work in Xcode 8 beta 5 so we used this //TODO Swift 3 workaround? https://forums.developer.apple.com/thread/46405 UIApplicationMain( Process.argc, UnsafeMutablePointer<UnsafeMutablePointer<CChar>>(Process.unsafeArgv), nil, NSStringFromClass(AppDelegate.self)) On Xcode 8 beta 6 we get Use of unresolved identifier 'Process' What do we need to do in Xcode 8 beta 6

Swift 3 UnsafePointer($0) no longer compile in Xcode 8 beta 6

江枫思渺然 提交于 2019-11-27 11:51:47
问题 My code snipet as follows …: let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) { SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0)) } … does no longer compile with the following error which I don't understand: "'init' is unavailable: use 'withMemoryRebound(to:capacity:_)' to temporarily view memory as another layout-compatible type." What to do to fix it? 回答1: From the Release Notes of Xcode 8 beta 6: An Unsafe[Mutable]RawPointer type has been introduced,

Xcode 8 does full project rebuild

非 Y 不嫁゛ 提交于 2019-11-27 11:18:32
Having updated Swift + ObjC project to Xcode 8 (Swift 2.3) I found 50% or more of the time Xcode does a full rebuild of the project instead of an incremental build. The changes made are adding simple print statements. There seems to be no logic as to when it performs a full rebuild. It appears in the "Check dependencies" phase it decides this. On Xcode 7 this did not seem to be a problem. Has anyone else encountered this? I have found this works consistently, it will however compile swift files if you modify a header included in the bridging header. It will also do full compile if you switch

Xcode 8 simulator ios 8 image get distorted

依然范特西╮ 提交于 2019-11-27 08:06:30
问题 I just get this bug,some images on the iOS 8 simulator get distorted.iOS9,and iOS10 don't have this bug. I'm not sure that this is a Xcode 8 bug,or this is my problem. 回答1: Same here, this seems to be a valid Xcode-issue. It is only happening on iOS 8 sims and only with the latest Xcode 8 Beta 6. We should file a bugreport for this. 来源: https://stackoverflow.com/questions/38972093/xcode-8-simulator-ios-8-image-get-distorted

Closure use of non-escaping parameter may allow it to escape

六眼飞鱼酱① 提交于 2019-11-27 00:40:49
问题 I have a protocol: enum DataFetchResult { case success(data: Data) case failure } protocol DataServiceType { func fetchData(location: String, completion: (DataFetchResult) -> (Void)) func cachedData(location: String) -> Data? } With an example implementation: /// An implementation of DataServiceType protocol returning predefined results using arbitrary queue for asynchronyous mechanisms. /// Dedicated to be used in various tests (Unit Tests). class DataMockService: DataServiceType { var

Xcode 8 beta 6: main.swift won&#39;t compile

爷,独闯天下 提交于 2019-11-26 15:46:58
问题 We have a custom UIApplication object, so our main.swift was import Foundation import UIKit UIApplicationMain(Process.argc, Process.unsafeArgv, NSStringFromClass(MobileUIApplication), NSStringFromClass(AppDelegate)) and that didn't work in Xcode 8 beta 5 so we used this //TODO Swift 3 workaround? https://forums.developer.apple.com/thread/46405 UIApplicationMain( Process.argc, UnsafeMutablePointer<UnsafeMutablePointer<CChar>>(Process.unsafeArgv), nil, NSStringFromClass(AppDelegate.self)) On

Xcode 8 does full project rebuild

ぐ巨炮叔叔 提交于 2019-11-26 15:31:55
问题 Having updated Swift + ObjC project to Xcode 8 (Swift 2.3) I found 50% or more of the time Xcode does a full rebuild of the project instead of an incremental build. The changes made are adding simple print statements. There seems to be no logic as to when it performs a full rebuild. It appears in the "Check dependencies" phase it decides this. On Xcode 7 this did not seem to be a problem. Has anyone else encountered this? 回答1: I have found this works consistently, it will however compile

AnyObject not working in Xcode8 beta6?

混江龙づ霸主 提交于 2019-11-26 11:22:36
In Xcode8 beta6, the following code will cause a warning: 'is' test is always true. But it won't print pass. struct TestStruct { } //warning: 'is' test is always true if TestStruct() is AnyObject { print("pass") } And the following code will cause a warning: Conditional cast from 'T' to 'AnyObject' always succeeds public static func register<T>(_ protocolType: T.Type, observer: T) { //Warning: Conditional cast from 'T' to 'AnyObject' always succeeds guard let object = observer as? AnyObject else { fatalError("expecting reference type but found value type: \(observer)") } //... } dfri The