Closed jjeon5 closed 9 years ago
Can you post the snippet of your AppDelegate?
Also are you using Frameworks with pods or a bridging header?
Pods I also commented out the original window.
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
lazy var window: COSTouchVisualizerWindow? = {
COSTouchVisualizerWindow(frame: UIScreen.mainScreen().bounds)
}()
//var window: UIWindow?
Any luck?
Not yet, I was investigating it but I couldn't even get the window to load in Xcode 6.3. I'm getting a compile time error about overriding the getter on window.
What version of Xcode/Swift
Does your Podfile contain the use_frameworks!
declaration ?
I'm using Xcode 6.2 right now.
About the use_frameworks!
, no I am unaware of this. Sorry I'm quite new to Cocoapods.
Okay,
Apple might have changed something in Xcode 6.3 in the Swift formatting that is breaking my project which is why I can't run it right now. I'll have to trouble shoot that first.
As for use_frameworks!
, that takes advantage of Apple's support for having proper bundled packages. Framework support was added in the latest minor release version of Cocoapods (0.36.0). If you're not using frameworks, then you're importing the COSTouchVisualizer through a bridging header.
Once I figure out why I can't use this library in Swift 1.2, I'm going to take a look at whether or not the bridging header makes a difference or not.
I can confirm this issue with the latest swift update. Hope you can find what's going on !
I am having the same issue. Importing COSTouchVisualizer through a Bridging header. The error I'm getting is as follows:
Objective-C method 'window' provided by getter for 'window' conflicts with optional requirement getter for 'window' in protocol 'UIApplicationDelegate'
as well as for the setter
Objective-C method 'setWindow:' provided by setter for 'window' conflicts with optional requirement setter for 'window' in protocol 'UIApplicationDelegate'
I'm getting these both with and without use_frameworks!
Use the following in your AppDelegate
lazy var window: UIWindow? = {
COSTouchVisualizerWindow(frame: UIScreen.mainScreen().bounds)
}()
Then it should work without problems
@krusche thank you, I was trying that but I forgot the step of setting the delegate. I just updated the project with a Swift example and here is the entire AppDelegate
import UIKit
import COSTouchVisualizer
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, COSTouchVisualizerWindowDelegate {
lazy var window: UIWindow? = {
var customWindow = COSTouchVisualizerWindow(frame: UIScreen.mainScreen().bounds)
customWindow.touchVisualizerWindowDelegate = self
return customWindow
}()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
return true
}
func touchVisualizerWindowShouldAlwaysShowFingertip(window: COSTouchVisualizerWindow!) -> Bool {
return true
}
}
After properly adding the pod and putting
There is a segmentation fault