Skip to content

Commit 1c9e1e8

Browse files
committed
Minor update support for objc
1 parent dbeaeb2 commit 1c9e1e8

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Demo/QRCodeView Demo/macOS/QRCodeView ObjC Demo/AppDelegate.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ - (void)doTests {
9696

9797
doc.design.shape.onPixels = [QRCodePixelShapeRazor new];
9898

99+
doc.design.shape.pupil = [QRCodePupilShapeKoala new];
100+
99101
NSError* error = NULL;
100102
CGImageRef image = [doc cgImageWithDimension:600 error:&error];
101103
assert(error == nil);

Sources/QRCode/QRCode+Types.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public extension QRCode {
4242

4343
public extension QRCode {
4444
/// Flip
45-
@objc enum Flip: Int {
45+
@objc(QRCodeFlip) enum Flip: Int {
4646
/// No Flip
47-
case none
47+
case none = 0
4848
/// Flip along the horizontal axis
4949
case horizontally = 1
5050
/// Flip along the vertical axis

Sources/QRCode/styles/pupil/QRCodePupilShapeKoala.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ public extension QRCode.PupilShape {
3636
@objc public var flip: QRCode.Flip = .none
3737

3838
/// Create a koala-node style pupil generator
39+
@objc public override init() {
40+
self.flip = .none
41+
super.init()
42+
}
43+
44+
/// Create a koala-node style pupil generator with a transform
3945
/// - Parameter flip: The flip transform to apply to the pupil
40-
@objc public init(flip: QRCode.Flip = .none) {
46+
@objc public init(flip: QRCode.Flip) {
4147
self.flip = flip
4248
super.init()
4349
}

0 commit comments

Comments
 (0)