default:
>self = .unknown
>}
>}
>
> because there is a `String(_ cocoaString: NSString)` initializer in
> Foundation.
>
> Regards, Martin
>
>
>> Am 05.12.2017 um 10:09 schrieb Dennis Weissmann via swift-users
>> :
>>
&
I found a related bug here: https://bugs.swift.org/browse/SR-6204
> On Dec 5, 2017, at 10:10 AM, Dennis Weissmann via swift-users
> wrote:
>
> Hi swift-users,
>
> I have found another weird behavior (IMO) and wanted to ask for the right way
> to handle this:
>
&g
Hey Charles,
Thanks for going through this with me :)
I'm not sure whether or not this is a compiler bug (that's partially why I
posted it here), although I have the feeling that *something* is definitely
wrong.
Funnily enough, the following code shows 3 compiler warnings which are
incorrect:
> You can delete the default case here, and your switch will still be exhaustive
That's exactly my problem! It is *not*.
When I delete the default clause, the compiler warns that the switch is not
exhaustive and fixits suggest to add the "missing" deprecated cases.
- Dennis
> On Nov 5, 2017, at
Hi Charles,
I do believe you :)
The problem is that this doesn't work without a compiler warning if you switch
over every case except for the deprecated ones because then the compiler warns
that "default will never be executed".
As per my first mail feel free to try this out in a playground:
, which I really want to avoid) đ¤
- Dennis
Sent from my iPhone
>> On 4. Nov 2017, at 10:42 PM, Charles Srstka wrote:
>>
>> On Nov 4, 2017, at 9:38 AM, Dennis Weissmann via swift-users
>> wrote:
>>
>> Hi swift-users,
>>
>> In a project (iOS
Hi swift-users,
In a project (iOS 11 only) we use Touch ID for authentication and handle errors
like so:
private func handleLocalAuthenticationError(_ error: LAError) {
switch error.code {
case .userCancel, .appCancel, .systemCancel:
// Handle cancelation
case .authentication
> On May 1, 2017, at 5:32 PM, Rien wrote:
>
>>
>> On 01 May 2017, at 16:59, Dennis Weissmann wrote:
>>
>>>
>>> On May 1, 2017, at 4:46 PM, Rien via swift-users
>>> wrote:
>>>
>>> In my code I use a lot of queues. And (very often) I will use [weak self]
>>> to prevent doing things when âs
> On May 1, 2017, at 4:46 PM, Rien via swift-users
> wrote:
>
> In my code I use a lot of queues. And (very often) I will use [weak self] to
> prevent doing things when âselfâ is no longer available.
>
> Now I am wondering: how does the compiler know that [weak self] is referenced?
>
> I am
Are you sure that's because it's defined in a protocol and not because it's a
`CGColor`. Can you try it with `UIColor`? I don't think CG types are supported
with `@IBInspectable`.
- Dennis
Sent from my iPhone
> On 19. Apr 2017, at 4:43 AM, Cavelle Benjamin via swift-users
> wrote:
>
> I don
I would love to have that! Unfortunately, I didnât find the time yet to think
it through and write a proposal. I often use enums for modeling server calls in
small apps and prototypes, something along the lines of
public enum Client {
private static let baseURLComponent = URL(string: "")!
I am also interested in the new API and cannot find it on Darwin :(
Will this be available in seed 2?
- Dennis
Sent from my iPhone
> On Jun 18, 2016, at 1:57 PM, Kostiantyn Koval via swift-users
> wrote:
>
> Hi everyone,
>
> In "What's New in Foundation for Swiftâ WWDC session there were ann
Huh! Thereâs a new overload for that initializer:
The one that takes CGFloats is the one that was there before, but the one
taking Floats is new!
You can work around like this:
let color = UIColor(red: CGFloat(0.892), green: CGFloat(0.609), blue:
CGFloat(0.048), alpha: CGFloat(1.000))
or
le
Hi Austin,
I further âswiftyfiedâ the code to this
(swift-DEVELOPMENT-SNAPSHOT-2016-05-03-a):
import Foundation
let N = 1_000_000
func generateTestData() -> [String] {
return (0.. [String] {
return s.characters.split(separator: sep, omittingEmptySubsequences: false)
.m
ts added to Swift
>> it should be a general feature for all functions, not just on closures.
>> There are a lot of design directions and subtleties that would need to be
>> explored. I doubt it is something that will be considered in the Swift 3
>> timeframe.
>>
>>
Thanks Krzysztof, youâre right! I totally forgot about that neat feature.
However, thereâs no way to do this directly in the parameter list, right?
Do you think such feature should exist?
- Dennis
> On May 5, 2016, at 4:19 PM, Krzysztof Siejkowski
> wrote:
>
>>
>> A workaround is to declare
Hi swift-users,
Is it possible to âextractâ the `tuple` tuple in the following code directly
into two `Int` variables (`tuple` is of type `(Int, Int)`)?
let a = [0,1,2,3,4,5,6,7,8,9]
let b = [0,1,2,3,4,5,6,7,8,9]
let c = zip(a,b).reduce(0) { acc, tuple in
acc + tuple.0 + tuple.1
}
Like so (d
Since sublayers are optional youâre calling the the flatMap function on
Optionals, which behaves differently.
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,
Thanks Brent!
This solved my different but related issue on iOS:
Taking the standard template for a Master-Detail Application with Core Data and
making all the changes so that it compiles, leads to
NSFetchedResultsControllerDelegateâs
controller(_:didChange:at:for:newIndexPath:) function not b
Hey Marc,
You didnât explicitly state the problem youâre running into but I assume you
canât build the app.
As others have noticed
(http://comments.gmane.org/gmane.comp.lang.swift.user/1689) the latest
development snapshot is broken.
- Dennis
> On Apr 17, 2016, at 7:18 PM, Marco S Hyman via
20 matches
Mail list logo