good point - type safety would prevent it from compiling.
also, the controllers are subclasses of
NSFetchedResultsController
but the delegate method takes a different type:
NSFetchedResultsController
NSManagedObject != NSFetchRequestResult
--
C. Keith Ray
Senior Software Engineer / Traine
nope. it's the same as this example:
func funny() -> Int {
return 1
}
func funny() -> String {
return "2"
}
print(funny()) // the compiler doesn't know which one you want.
// the above doesn't compile.
// error: forloop.playground:8:1: error: ambiguous use of 'funny()'
You have to have some
You need to know that the NAME of a method or function isn't just outside the
parenthesis.
The name of
func IsTextEmpty(foo : String?) -> Bool?
is
"IsTextEmpty(foo:)"
and the name of
func IsTextEmpty(text : String?) -> Bool
is
"IsTextEmpty(text:)"
The argument labels ar
try "\u{1b}"
--
C. Keith Ray
Senior Software Engineer / Trainer / Agile Coach
* http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
> On Nov 2, 2017, at 8:39 AM, 李某某 via swift-users wrote:
>
> With Objective-C I can simple make it.
> [button setKeyEquivalent:"\E"];
>
> However s
In the code below, I'm trying to store a reference to a function with any
number of arguments, with any return type. And I want to be able to invoke it.
Help?
See the comments with "***"
typealias Void = ()
func equalTypes(_ me: [Any.Type], _ other: [Any.Type]) -> Bool {
guard me.coun
handling the common cases of no arguments, 1
> argument, 2 arguments, etc up to some fixed number of arguments that you
> consider “enough”. Use a switch on the type of the function.
>
> Slava
>
>> On Nov 3, 2017, at 2:21 PM, C. Keith Ray via swift-users
>> mailto:swift-
spes...@apple.com>> wrote:
>>>
>>> Unfortunately we don’t have a way to invoke a function with a runtime
>>> argument list because that would require runtime code generation in the
>>> most general case.
>>>
>>> I would hack arou
Should these be consistent?
All crashing or none crashing?
print(abs(Int8.min)) // crash
print(abs(Int16.min)) // crash
print(abs(Int32.min)) // prints -2147483648
print(abs(Int64.min)) // crash
Should this be reported by Radar or another mechanism?
I'm using this as a replacement:
func sa
what are your system settings for Language & Region?
> On Jan 2, 2018, at 10:10 AM, David Wood via swift-users
> wrote:
>
> In XCode, I’ve built a little …mathematical utility program for my own use.
> It’s a Swift 4, Cocoa & Foundation-based program targeted at High Sierra. But
> it’s doing
A simple mutation counter works in the single-threaded case
for i in x {
print(i)
if middle_of_x { x.add(y) } // bang!
}
The add while enumerating should change the mutation counter, and the implicit
getting of next value for the for-loop should see the current mutation counter
doesn't equa
It's up to the programmer-user to impose thread-safety around an array or
other data structure. The compiler doesn't know if you want to allow multiple
threads to write and read multiple array members, or prevent all but one thread
to read and write multiple array members, or allow multiple rea
I think the advice is really to avoid unnecessary "helper" words in the names
let foreground = Color(havingRGBValuesRed: 32, green: 64, andBlue: 128)
"Having" and "and" are unnecessary... Should be
let foreground = Color(red: 32, green: 64, blue: 128)
let newPart = factory.makeWi
12 matches
Mail list logo