Hi, Moughees. This mailing list is for issues found developing with the
Swift language and not for help with third party frameworks such as Vapor.
Looking at the page for Vapor at https://github.com/vapor/vapor it seems
that they use a Slack channel for support. I would suggest you install a
Slack
Thanks, Slava!
On Tue, Oct 24, 2017 at 3:05 PM, Slava Pestov wrote:
>
>
> On Oct 24, 2017, at 3:05 PM, Nate Birkholz via swift-users <
> swift-users@swift.org> wrote:
>
> Doing a tutorial from RayWenderlich. https://www.
> raywenderlich.com/125313/make-game-like-candy
Doing a tutorial from RayWenderlich.
https://www.raywenderlich.com/125313/make-game-like-candy-crush-spritekit-swift-part-4
I have four bool values: topLeft, bottomLeft, topRight, and bottomRight
the following line throws an error:
let value = Int(topLeft.hashValue) | Int(topRight.hashValue) << 1
If I use these two classes:
class MotionManager {
class func doTheThing(completionHandler: @escaping (CMDeviceMotion?)->()
) {
print("in")
let manager = CMMotionManager()
manager.deviceMotionUpdateInterval = 0.01
manager.startDeviceMotionUpdates(to: .ma
d errors
>>>>
>>>> On Jun 3, 2017, at 9:38 PM, Geordie Jay wrote:
>>>>
>>>> I am dealing with a variant of this on Android right now. I have just
>>>> subclassed e.g. UITapGestureRecognizer to perform the 2nd variant above and
>>>> externally accept a closure
rrors
>>>>
>>>> On Jun 3, 2017, at 9:38 PM, Geordie Jay wrote:
>>>>
>>>> I am dealing with a variant of this on Android right now. I have just
>>>> subclassed e.g. UITapGestureRecognizer to perform the 2nd variant above and
>>>> exter
onTap: (() -> Void)?) {
>> self.onTap = onTap
>> super.init(target: self, action: #selector(internalTapHandler))
>> }
>>
>> @objc private func internalTapHandler() {
>> onTap?()
>> }
>> }
>>
>> class Baz: Foo {
>> init() {
>>
ate func internalTapHandler() {
> onTap?()
> }
> }
>
> class Baz: Foo {
> init() {
> let tapRecognizer = TapGestureRecognizer(onTap: self.bar)
> }
> }
>
>
> Cheers,
> Geordie
> On Sat 3. Jun 2017 at 16:53, Nate Birkholz via swift-users <
> swift-users@swift
(onTap: self.bar)
> }
> }
>
>
> Cheers,
> Geordie
>> On Sat 3. Jun 2017 at 16:53, Nate Birkholz via swift-users
>> wrote:
>> Thanks, the second had occurred to me, but felt a little too much like in
>> practice it would make the code harder to understan
az: Foo {
>
> init() {
>
> let tapRecognizer = UITapGestureRecognizer(target: self, action:
> #selector(delegate))
>
> }
>
>
>
> @objc func delegate() {
>
> bar()
>
> }
>
> }
>
>
> Zhao Xin
>
>
>
>
>
>
protocol Foo: class {
func bar()
}
extension Foo {
func bar() {
print("bar")
}
}
class Baz: Foo {
init() {
let tapRecognizer = UITapGestureRecognizer(target: self, action:
#selector(bar))
}
}
the #selector tells me: "Argument of '#selector' refers to instance
Classes and structs are different things. Classes are passed by reference,
structs are passed by value with copy on write.
Strings and Arrays are structs, not classes.
On Sat, May 6, 2017 at 10:24 PM, Kelvin Ma wrote:
> I hear that a lot but why do all the official sources sound like
> copy-on-
Relatively straightforward to write this, which usually has meant "no" to
adding something to the standard library. (Not that I agree with that measure.)
Sent from my iPhone, please excuse brevity and errors
> On Apr 26, 2017, at 11:13 AM, Ole Begemann via swift-users
> wrote:
>
> On 26.04.20
I'm not sure exactly how class declarations interact with the scope of a
do{ } statement. I declare a new static function inside your do{ } scope
and it works fine, but something about the mapping of `==` and `!=` to
`isEqual` in NSObject seems to be confused by the scope of the do{ } block.
I'm n
Your issue seems to be that you created a custom implementation for the
`==` operator but not one for the `!=` operator. If I add a custom
implementation for `!=` I get the results you expected. Tthe default
implementation of NSObject's `isEqual` is a test for identity, like the
`===` in Swift. So
Never mind, .dynamicType works, it just doesn't autocomplete any more.
/facepalm
On Thu, Nov 10, 2016 at 11:54 AM, Nate Birkholz wrote:
> self.dynamicType doesn't work any more, but type(of: self) is just Swift
> 3.0 So how do i get the class?
>
> Use case in a unit test:
>
> let bundle = NSBund
self.dynamicType doesn't work any more, but type(of: self) is just Swift
3.0 So how do i get the class?
Use case in a unit test:
let bundle = NSBundle(forClass: type(of: self))
--
Nate Birkholz
___
swift-users mailing list
swift-users@swift.org
https:
I did it then you'd never hear when it was fixed, and wouldn't get
> the chance to test it on your own code and say "no, you fixed the wrong
> thing". :-)
>
>
>> On Oct 3, 2016, at 10:12, Nate Birkholz via swift-users
>> wrote:
>>
&g
Then Jordan Rose closed it as not a Swift bug. :)
On Mon, Oct 3, 2016 at 2:03 AM, Alex Blewitt wrote:
> On 30 Sep 2016, at 19:30, Nate Birkholz via swift-users <
> swift-users@swift.org> wrote:
>
> I found a bug in Swift 2.3 migration in the XCUITests, not sure if the bug
>
https://bugs.swift.org/browse/SR-2837
On Mon, Oct 3, 2016 at 2:03 AM, Alex Blewitt wrote:
> On 30 Sep 2016, at 19:30, Nate Birkholz via swift-users <
> swift-users@swift.org> wrote:
>
> I found a bug in Swift 2.3 migration in the XCUITests, not sure if the bug
> goes to
I found a bug in Swift 2.3 migration in the XCUITests, not sure if the bug
goes to swift.org or to Apple.
UI test generator uses the syntax (XCUIElement).children(matching: .other)
but the compiler only recognizes childrenMatchingType(.Other), and you have
to manually change the instances. Makes g
Is this a change to NSThread in the release, or to the language, dropping
empty () when calling methods? If the latter, what proposal is it? i can't
find it.
On Wed, Jul 13, 2016 at 12:41 AM, Jose Cheyo Jimenez via swift-users <
swift-users@swift.org> wrote:
> //swift 2.2+
> NSThread.isMainThread
gt;> On Fri, Jul 08 2016 at 11:11:04 AM, Nate Birkholz via swift-users
>> wrote:
>> > This gives an error, expecting a colon (:) after object on every case.
>> >
>> > I wanted to be sure I wasn't missing something in my syntax (nor some
>>
> default:
>
> break
>
> }
>
> }
>
> On Fri, Jul 8, 2016 at 10:11 AM, Nate Birkholz via swift-users <
> swift-users@swift.org> wrote:
>
>> This looks like it doesn't work (swift 2.x), but wanted to be sure it's
>> no
This looks like it doesn't work (swift 2.x), but wanted to be sure it's not
supported:
class Superclass {}
class Subclass1 : Superclass {}
class Subclass2 : Superclass {}
class Subclass3 : Superclass {}
let sc1 = Subclass1()
let sc2 = Subclass2()
let sc3 = Subclass3()
let objects : [Superclass]
pipermail/swift-evolution/Week-of-Mon-20151214/003748.html
>
> Cheers,
>
> — A
>
> On May 16, 2016, at 12:43 PM, Nate Birkholz via swift-users <
> swift-users@swift.org> wrote:
>
> Well that was where I was going next, heh.
>
> On Mon, May 16, 2016 at 9:
Well that was where I was going next, heh.
On Mon, May 16, 2016 at 9:41 AM, Jens Alfke wrote:
>
> On May 16, 2016, at 9:37 AM, Nate Birkholz via swift-users <
> swift-users@swift.org> wrote:
>
> I understand how @noescape works, and some of its benefits, I *think*, but
I understand how @noescape works, and some of its benefits, I *think*, but
if I am correct, it almost seems like it should be added automatically to
my closure definitions until it becomes clear that the closure has to
escape its context, much like I tend to declare variables as `let` until it
beco
That's correct.
On Fri, Apr 29, 2016 at 8:52 AM, David Sweeris via swift-users <
swift-users@swift.org> wrote:
> Yep, declare it like this:
> public private(set) var lastUpdated: NSDate?
>
> At least I’m pretty sure that’s the syntax. I don’t have Xcode in front of
> me to double-check.
>
> HTH
>
;
> let layers = myView.layer.sublayers?.flatMap({ $0 as? CAShapeLayer }) //
> sublayers?. instead of sublayers.
>
> should fix the problem :)
>
> - Dennis
>
> On Apr 21, 2016, at 9:53 PM, Nate Birkholz via swift-users <
> swift-users@swift.org> wrote:
>
&g
myView.layer.sublayers returns an array of CALayer objects. Some of my
sublayers are CAShapeLayers. I want to act on the CAShapeLayer objects.
Shouldn't flatMap allow me to conditionally cast CALayers to CAShapeLayers?
i.e.
let layers = myView.layer.sublayers.flatMap({ $0 as? CAShapeLayer })
The
31 matches
Mail list logo