Convert to Swift 4.0 syntax
This commit is contained in:
@@ -248,7 +248,7 @@
|
||||
0C3CAEA31C3350C800B856AD = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
DevelopmentTeam = F7W5R35V7L;
|
||||
LastSwiftMigration = 0810;
|
||||
LastSwiftMigration = 1010;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -428,7 +428,7 @@
|
||||
PRODUCT_NAME = XION;
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "XIONControlPanel/SupportingFiles/XIONControlPanel-Bridging-Header.h";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -447,7 +447,7 @@
|
||||
PRODUCT_NAME = XION;
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "XIONControlPanel/SupportingFiles/XIONControlPanel-Bridging-Header.h";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
|
||||
@@ -14,10 +14,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate
|
||||
var window: UIWindow?
|
||||
var mainViewController: MainViewController = MainViewController()
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
|
||||
func application(_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
|
||||
{
|
||||
application.isStatusBarHidden = true
|
||||
|
||||
self.window = UIWindow(frame: UIScreen.main.bounds)
|
||||
self.window?.rootViewController = self.mainViewController
|
||||
self.window?.makeKeyAndVisible()
|
||||
@@ -35,7 +34,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate
|
||||
self.mainViewController.viewDidDisappear(false)
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask
|
||||
func application(_ application: UIApplication,
|
||||
supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask
|
||||
{
|
||||
var mask: UIInterfaceOrientationMask = .portrait
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ class MainViewController: UIViewController, SwitchesViewControllerDelegate
|
||||
|
||||
self.view.backgroundColor = UIColor.black
|
||||
|
||||
self.addChildViewController(_visualizationController)
|
||||
self.addChild(_visualizationController)
|
||||
self.view.addSubview(_visualizationController.view)
|
||||
|
||||
_switchesController.delegate = self
|
||||
self.addChildViewController(_switchesController)
|
||||
self.addChild(_switchesController)
|
||||
self.view.addSubview(_switchesController.view)
|
||||
|
||||
self.view.addSubview(_headerView)
|
||||
|
||||
@@ -213,7 +213,7 @@ class SwitchesViewController: UIViewController,
|
||||
|
||||
for i in ActionCell.count ..< collectionView.numberOfItems(inSection: indexPath.section) {
|
||||
if let cell = collectionView.cellForItem(at: IndexPath(item: i, section: indexPath.section)) as? WemoDeviceCellView {
|
||||
let animOptions = UIViewAnimationOptions([.allowUserInteraction])
|
||||
let animOptions = UIView.AnimationOptions([.allowUserInteraction])
|
||||
|
||||
UIView.animate(withDuration: 0.3, delay: currentDelay, options: animOptions, animations: {
|
||||
cell.toggled = (tappedActionCell == .allOn)
|
||||
|
||||
@@ -179,7 +179,7 @@ class VisualizationViewController: UIViewController
|
||||
|
||||
internal func _setupModel()
|
||||
{
|
||||
_cubletsNode.enumerateChildNodes { $0.0.removeFromParentNode() }
|
||||
_cubletsNode.enumerateChildNodes { (child, _) in child.removeFromParentNode() }
|
||||
_cublets.removeAll()
|
||||
|
||||
let sz = Float(VisualizationViewController.cubletsSize)
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
@@ -36,6 +46,16 @@
|
||||
"filename" : "Icon-60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
@@ -77,6 +97,11 @@
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-167@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -46,7 +46,7 @@ extension NSError
|
||||
|
||||
class func xionError(_ code: XIONErrorCode, userInfo: [AnyHashable: Any]?) -> NSError
|
||||
{
|
||||
return NSError(domain: XIONErrorDomain, code: code.rawValue, userInfo: userInfo)
|
||||
return NSError(domain: XIONErrorDomain, code: code.rawValue, userInfo: userInfo as? [String : Any])
|
||||
}
|
||||
|
||||
var xionErrorCode: XIONErrorCode
|
||||
|
||||
@@ -46,7 +46,7 @@ open class WemoCellView: UICollectionViewCell
|
||||
if (self.isHighlighted) {
|
||||
_selectionOverlayView.backgroundColor = UIColor(white: 0.8, alpha: 1.0)
|
||||
} else {
|
||||
let animOptions = UIViewAnimationOptions([.allowUserInteraction])
|
||||
let animOptions = UIView.AnimationOptions([.allowUserInteraction])
|
||||
UIView.animate(withDuration: 1.0, delay: 0.0, options: animOptions, animations: {
|
||||
self._selectionOverlayView.backgroundColor = UIColor.clear
|
||||
}, completion: nil)
|
||||
|
||||
Reference in New Issue
Block a user