var bitfield: UnsafeMutablePointer?
bitfield = UnsafeMutablePointer.allocate(capacity: 888)
> 23. sep. 2016 kl. 10.47 skrev Gerriet M. Denkmann via swift-users
> :
>
> This used to work in Swift 2.2:
>
> var bitfield: UnsafeMutablePointer?
> bitfield = UnsafeMutablePointer( malloc( 888 ) )
>
I usually mark my target-action methods like so:
private dynamic func didTapNext(sender: UIButton)
"dynamic" makes the compiler generate code for dynamic dispatch, that is
runtime message passing, like objc. The "private" part doesn't change that,
it just reduces clutter.
2016-07-22 15:18 GMT+0
2016-06-18 10:23 GMT+02:00 Dmitri Gribenko :
> On Fri, Jun 17, 2016 at 12:37 PM, Svein Halvor Halvorsen
> wrote:
> > Ok. Good to hear that I'm not too far off :)
> >
> > Can you provide me with an example of a sequence type or two that has
> some
> > map or other function that would benefit from
let firstLetter = myString.characters.first
lør. 18. jun. 2016 kl. 04.38 skrev Brent Royal-Gordon via swift-users <
swift-users@swift.org>:
> > I've previously used myString[0...1] to get the first character of a
> string.
>
> I'm not sure how, because this has never worked in Swift. Strings use
i, Jun 17, 2016 at 1:39 AM, Svein Halvor Halvorsen via
> swift-users wrote:
> > I'm sure people here know about the problem that AnySequence,
> AnyGenerator,
> > etc solves.
> > In Swift, a protocol can have an associated type, which is kinda like
> > generics, but
I'm sure people here know about the problem that AnySequence, AnyGenerator,
etc solves.
In Swift, a protocol can have an associated type, which is kinda like
generics, but you cannot declare a variable like this:
let sequence: SequenceType
If you want a sequence, any sequence, over ints you need
This is even worse if I want to create a singleton, and ensure that the
only way to access it, is through a static let on the class:
class Singleton: NSObject {
static let instance = Singleton()
private override init() {
super.init()
}
}
In Swift, I can't instantiate this clas
Hi,
In Objective-C, I've often attributed initializer from super classes as
unavailable. Like this;
@class Dependency;
@interface SomeClass : NSObject
- (nullable instancetype)init __unavailable;
- (nonnull instancetype)initWithDependency:(nonnull Dependency *)dependency;
@end
This makes the