Giter Site home page Giter Site logo

m13checkbox's Introduction


Banner


Create beautiful, customizable, extendable, animated checkboxes on iOS. Completely configurable through interface builder. It has several built in animations, custom value support, a mixed state, checkmark and radio styles, circular and rounded rectangle box shapes, as well as full color customization. See the demo app to play with all the features.

Table of Contents

Documentation

Check out the demo app to change the properties of the checkbox and see the changes in real time.

Animations

  • Animation enum: The possible animations for switching to and from the unchecked state.

    • Stroke:

      Stroke Sample

    • Fill:

      Fill Sample

    • Bounce (Stroke):

      Bounce Stroke Sample

    • Bounce (Fill):

      Bounce Fill Sample

    • Expand (Stroke):

      Expand Stroke Sample

    • Expand (Fill):

      Expand Fill Sample

    • Flat (Stroke):

      Flat Stroke Sample

    • Flat (Fill):

      Flat Fill Sample

    • Spiral:

      Spiral Sample

    • Fade (Stroke):

      Fade Stroke Sample

    • Fade (Fill):

      Fade Fill Sample

    • Dot (Stroke):

      Dot Stroke Sample

    • Dot (Fill):

      Dot Fill Sample

  • stateChangeAnimation Animation: The type of animation to preform when changing from the unchecked state to any other state.

  • animationDuration NSTimeInterval: The duration of the animation that occurs when the checkbox switches states. The default is 0.3 seconds.

Values

  • value (Any): Returns either the checkedValue, uncheckedValue, or mixedValue depending on the checkbox's state.
  • checkedValue Any: The object to return from value when the checkbox is checked.
  • uncheckedValue Any: The object to return from value when the checkbox is unchecked.
  • mixedValue Any: The object to return from value when the checkbox is mixed.

State

  • CheckState enum: The possible states the check can be in.
    • unchecked — No check is shown.
    • checked — A checkmark is shown.
    • mixed — A dash is shown.
  • checkState CheckState: The current state of the checkbox.
  • setCheckState(newState: CheckState, animated: Bool): Change the check state with the option of animating the change.
  • toggleCheckState(animated: Bool = false): Toggle the check state between Unchecked and Checked states.

Appearance

  • MarkType: The possible shapes of the mark.
    • checkmark — The mark is a standard checkmark.
    • radio — The mark is a radio style fill.
  • BoxType: The possible shapes of the box.
    • circle — The box is a circle.
    • square — The box is square with optional rounded corners.
  • tintColor: The main color of the Selected and Mixed states for certain animations.
  • secondaryTintColor UIColor: The color of the box in the unselected state.
  • secondaryCheckmarkTintColor UIColor: The color of the checkmark or radio for certain animations. (Mostly animations with a fill style.)
  • checkmarkLineWidth CGFloat: The line width of the checkmark.
  • markType MarkType: The type of mark to display.
  • boxLineWidth CGFloat: The line width of the box.
  • cornerRadius CGFloat: The corner radius of the box if the box type is Square.
  • boxType BoxType: The shape of the checkbox.
  • hideBox Bool: Wether or not to hide the box.

Getting Started

Demo

Playground

To see a working playground in action, run the workspace located at path M13Checkbox Demo Playground/LaunchMe.xcworkspace. You may need to run the framework scheme and wait for Xcode to process the files, before the playground begins. Open the assistant editor for a live preview of the UI.

This is a great way to work on customizing the checkbox in code to suit your needs.

App

To see the checkbox working on a device, run the demo app included in M13Checkbox.xcodeproj. The demo app walks through all the available features. You will need to run a pod install in order to build the demo app.

Installation

Cocoapods

The easiest way to install M13Checkbox is through CocoaPods. Simplify add the following to your podfile.

pod 'M13Checkbox'

Carthage

To install via Carthage, add the following to your cartfile:

github "Marxon13/M13Checkbox"

Swift Package Manager

M13Checkbox supports SPM versions 5.1.0 and above. To use SPM, you should use Xcode 11 to open your project. Click File -> Swift Packages -> Add Package Dependency, enter https://github.com/Marxon13/M13Checkbox. Select the version you’d like to use.

You can also manually add the package to your Package.swift file:

.package(url: "https://github.com/Marxon13/M13Checkbox.git", from: "3.4.0")

Note: IBDesignables and IBInspectables will not work in interface builder.

Workaround: Create IBDesignable subclass of M13Checkbox, Use this subclass as custom class in interface builder. Example:

@IBDesignable
class M13CheckboxView : M13Checkbox {}    

Manual

Another option is to copy the files in the "Sources" folder to your project.

Use

Storyboard

Add a custom view to the storyboard and set its class to "M13Checkbox". Customize the available parameters in the attributes inspector as needed.

Note: A shim was added to add support for setting enum properties through interface builder. Just retrieve the integer value corresponding to the enum value needed, and enter that into the property in the attributes inspector.

Programmatically

Just initialize the checkbox like one would initialize a UIView, and add it as a subview to your view hierarchy.

let checkbox = M13Checkbox(frame: CGRect(x: 0.0, y: 0.0, width: 40.0, height: 40.0))
view.addSubview(checkbox)

Project Structure

M13Checkbox The main interface for M13Checkbox is the M13Checkbox class. It is a subclass of UIControl and handles the configurable properties, as well as touch events.

M13CheckboxController Each M13Checkbox references an instance of M13CheckboxController, which controls the appearance and animations of its layers. The controller passes a set of layers to the M13Checkbox, which adds the layers to its layer hierarchy. The checkbox then asks the controller to perform the necessary animations on the layers to animate between states. Each animation type has its own subclass of M13CheckboxController. To add an animation, subclass M13CheckboxController, and add the animation type to the Animation enum, supporting AnimationStyle if applicable. Take a look at the existing controllers to see what variables and functions to override.

M13CheckboxAnimationGenerator Each M13CheckboxController references an instance of M13CheckboxAnimationGenerator, which generates the animations that will be applied to layers during state transitions. The base class contains animations that are shared between multiple animation styles. An animation can subclass M13CheckboxAnimationGenerator to generate new animations specific to the animation type.

M13CheckboxPathGenerator Each M13CheckboxManager references an instance of M13CheckboxPathGenerator, which generates the paths that will be displayed by the layers. The base class contains paths that are shared between multiple animation styles, as well as some boilerplate code to determine which path to use. Some animations have a subclass of M13CheckboxPathGenerator to add new paths specific to the animation type, or override existing paths to customize the look.

M13CheckboxPathGenerator calculates the positions of the points of the checkmark with more than just a basic scaled offset. This allows the checkmark to always look the same, not matter what size the checkbox is. The math contained in the checkmarkLongArmBoxIntersectionPoint and checkmarkLongArmEndPoint are a simplified version of a human readable solution. To see the math that went into creating these equations, check out the "Math.nb" or the "Math.pdf" in the "Other" folder.

M13Checkbox+IB A shim that gives the ability to set the enum values of M13Checkbox in Interface Builder.


Project Details

Requirements

  • iOS 8+
  • Xcode 10.2+
  • Swift 5

Todo

  • Fix the animations between the checked and mixed states when the mark is a radio. When the circle is close to being flat, the left and right edges are not rounded, as well as render some artifacts.
  • Add visual feedback for UIControl's selected state. So that when the checkbox is touched, it animates slightly towards the new state.
  • Add support for interrupting animations mid-animation. So that if the checkbox is tapped multiple times in quick succession, it animates from the current values, instead of resetting the checkbox and restarting the animations. This might involve replacing CAAnimations with manually done animations using a CADisplayLink. Or the new UIViewPropertyAnimator.
  • tvOS support.
  • watchOS support.
  • macOS support.
  • Checkbox cells (Re-add label support)
  • Checkbox groups (single / multiple selection)

License

M13Checkbox is avaiable under MIT Licence.

m13checkbox's People

Contributors

0x0c avatar andreaantonioni avatar andreacremaschi avatar awalz avatar benaneesh avatar brandon-mcquilkin-kr avatar bryanone avatar canaksoy avatar cbs avatar churowa avatar dpopov avatar erikprice avatar idevelopper avatar jaltin avatar jefmwols avatar johncowmilk avatar jp26jp avatar marxon13 avatar ninjakittenproductions avatar oliver204 avatar szotyi avatar uberjason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m13checkbox's Issues

Swift 3 support

Hi guys. Love the framework and use it extensively in my apps.

Just wondering about support for Swift 3, since I'm hoping to release an app optimized for iOS10 on launch day.

If there's no plans underway it's something I'd be willing to help out with.

Actions

Hi !

this is probably a newbie question :(
How can I register a M13Checkbox for actions. F.e. if something got selected and so on ?

Increased compilation times in Swift 3

Hi, I'm seeing increased compilation times for this project (version 2.2.4) and it causes to XCode 8 to be really slow. I ran the command mentioned here: http://irace.me/swift-profiling and it gave me this:

17059.2ms       /XXX/Pods/M13Checkbox/Sources/M13CheckboxPathPresets.swift:113:43        get {}
16583.8ms       /XXX/Pods/M13Checkbox/Sources/M13CheckboxPathPresets.swift:113:43        get {}
10840.5ms       /XXX/Pods/M13Checkbox/Sources/M13CheckboxPathPresets.swift:76:55 get {}
10393.4ms       /XXX/Pods/M13Checkbox/Sources/M13CheckboxPathPresets.swift:76:55 get {}

The times vary, but they are always really high (min. 6000ms).
Can you look into it? Thanks

What about change events?

Hi, thanks for this amazing tool, today I faced 2 issues and my questions to those are:

  • How can I capture the a check/uncheck event?
  • Is there any way to set a hidden value like in HTML?

Many thanks in advance

Problems running demo: No such module 'Color_Picker_for_iOS'

I'm trying to follow the instructions for running the Demo app, but I'm running into an issue:

# Since I'm using Xcode 8
$ gem install cocoapods --pre
...
Successfully installed cocoapods-1.1.0.rc.2
...
$ pod install
Analyzing dependencies
Downloading dependencies
Using Color-Picker-for-iOS (2.0.2)
Using PBDCarouselCollectionViewLayout (1.1.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.

[!] The `M13Checkbox Demo [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-M13Checkbox Demo/Pods-M13Checkbox Demo.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `M13Checkbox Demo [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-M13Checkbox Demo/Pods-M13Checkbox Demo.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

Usually you need to open the .xcworkspace file, so I tried that first, but it was missing projects, so then I tried opening the .xcodeproj as instructed in the README.

When I select the "M13Checkbox Demo" scheme and run, it displays the error:

No such module 'Color_Picker_for_iOS'

Did I do something wrong, or is this a bug?

return true ??

how can i return Property checkbox ?
and
When I added view to the storyboard and set its class to "M13Checkbox" , module is None.
is it correct ??
22

Cocoapods-generated Swift bridging header doesn't include all M13Checkbox methods/properties

I've included M13Checkbox (v 2.1.0) as a pod in an Objective-c project. The pod seems to install correctly, certainly well enough to integrate it in the storyboard.

I just noticed that when I tried to call setCheckState(newState: CheckState, animated: Bool) on a checkbox in a UIView subclass, the compiler doesn't seem to know anything about the method.

I had a look at the swift bridging header that was generated, and it looks like it's missing a few things. https://gist.github.com/churowa/66f54a984d58f2b8ecdb8f60602f6af5

Just comparing it to the available properties in M13Checkbox.swift, I see right away that it's missing setCheckState, boxType, stateChangeAnimation, and a few others.

Am I correct that it looks odd? I'm not sure what to look at next, basically. I don't know that this is an M13Checkbox issue per se... Maybe it's more to do with Cocoapods or Xcode itself. But does the bridging header look right?

Is checkbox support content edge insets?

Hello Brandon, I have one question. I need use checkbox with some text. I can use M13CheckboxAlignment. But in this case it strictly bind to side(right or left). Is any way to set something like button contentEdgeInset? I need add some padding from side.

Thanks.

Swift 3 Versions not available in Cocoapods.

Currently pod trunk push and pod spec lint are failing. Working on a fix, there is no clear solution that I can find. I tried overriding the SWIFT_VERSION config property, but that is not working. As soon as a solution is found, I'll update Cocoapods.

Control doesn't appear when when attached to a custom UIView in XCode's GUI editor

Using XCode 4.6.1 interface builder

  1. drag and drop a UIViewController. (This controller should already have an embedded UIView.)
  2. drag and drop a UIView onto that controller's UIView.
  3. In the Identity Inspector set the UIView's (from step 2) custom class as an instance of M13Checkbox
  4. Build and run app. Observe that the checkbox never appears.

In the debugger I have verified that M13Checkbox's -initWithFrame: method is called and executes correctly. Using DCIntrospect I have found that when created this way the M13Checkbox instance doesn't contain the CheckView and UILabel subviews

Here's the (truncated) output of DCIntrospect:

2013-04-08 19:00:13.081 XXXXXXX[25443:c07] DCIntrospect: <UIView: 0xe5815f0; frame = (0 20; 320 460); autoresize = RM+BM; layer = <CALayer: 0xe581650>>
   | <M13Checkbox: 0x7871820; baseClass = UIControl; frame = (20 57; 16 16); layer = <CALayer: 0x78718f0>>
   | <M13Checkbox: 0x786c9a0; baseClass = UIControl; frame = (80 25; 16 16); layer = <CALayer: 0x7868f40>>
   |    | <CheckView: 0xe575ce0; frame = (0 0; 16 16); userInteractionEnabled = NO; layer = <CALayer: 0xe59bf00>>
   |    | <UILabel: 0x7d981e0; frame = (-5 2; 5 14); clipsToBounds = YES; userInteractionEnabled = NO; layer = <CALayer: 0x7d9a6e0>>

In that log the first instance of M13Checkbox is the one created in IB. The second instance of M13Checkbox is created entirely in code. That second instance works as expected.

Fails to receive taps when added to a view with a tap gesture recognizer

When the M13Checkbox is added to a view that has a UITapGestureRecognizer added to it, the M13Checkbox does not receive tap events. Applying the following diff to this project will demonstrate the problem easily:

--- a/M13Checkbox/ViewController.m
+++ b/M13Checkbox/ViewController.m
@@ -114,13 +114,6 @@
     customFrame.titleLabel.numberOfLines = 0;
     customFrame.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
     [self.view addSubview:customFrame];
-
-    UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleRecognizerTap)];
-    [self.view addGestureRecognizer:recognizer];
-}
-
-- (void)handleRecognizerTap {
-    NSLog(@"Tapped");
 }

 - (void)didReceiveMemoryWarning

This does not appear to be the standard behavior of UIControls. For example, a UIButton added to the same view is able to receive tap events with no problem. The same is true of UITextFields and other UIControls.

Round the view?

Hi there,

I can't get the cornerRadius applied? This view just stay squared?

m13

Changint tint color on checked state

Hi Pals, I am trying to implement your great checkbox, but when checking control it's changing my tint color to blue. How I can fix it. Is there some delegate methods to catch checked/unchecked values like 0 and 1?

Swift 2.3 - render issue within framework

Hey Folks,

since Xcode 8 is available and Swift 2.3 conversion is recommended i have an error within your Framework.

"error: IB Designables: Failed to render and update auto layout status for UIView (iN0-l3-epB): dlopen(M13Checkbox.framework, 1): Symbol not found: __TWPSis16ForwardIndexTypes
Referenced from: M13Checkbox.framework
Expected in: (shortended).../Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Overlays/../../../../../../Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/libswiftCore.dylib
in M13Checkbox.framework

The whole xib is not renderable in interface builder if a m13checkbox is within a xib file. If i reset the class it runs until i reopen it in interface builder.

screen shot 2016-09-10 at 10 45 08

I Want to use your framework further on so do you have any suggestion?

greetings

setCheckState not updating view on iOS 7

Am I going crazy or does programatically setting the checkState in iOS 7 not work as expected?

I've tried both:

[self.readTermsCheckbox setCheckState:M13CheckboxStateChecked];

and:

self.readTermsCheckbox.checkState = M13CheckboxStateChecked;

Both ways work fine on iOS 8 and iOS 9 but on iOS 7, I see the code gets called and in debugging I can see the value gets set correctly but the view is just not updating to show the new state. What am I missing?

I have also tried calling [self.readTermsCheckbox setNeedsDisplay]; but still no joy.

Checkmark line not complete

M13Checkbox 2.2.5 via storyboard- XCode 8 - Swift 3 - iOS 10

Hi,
When I choose Circle for IBBox Type with checked state, it's okay but when I choose Square, I only have half the line. Screenshots below

screen shot 2016-10-02 at 3 14 31 pm screen shot 2016-10-02 at 3 14 18 pm

I want to fit the frame size with mlutiline text

I add the following method.
What do you think ?

// M13Checkbox.m

  • (void)autoSizeToFit {
    _titleLabel.numberOfLines = 0;
    _titleLabel.lineBreakMode = NSLineBreakByWordWrapping;

    CGSize margin = CGSizeMake(5.0, 5.0);
    CGRect labelrect = [_titleLabel.text
    boundingRectWithSize:CGSizeMake(_titleLabel.bounds.size.width - margin.width * 2,
    CGFLOAT_MAX)
    options:NSStringDrawingUsesLineFragmentOrigin
    attributes:@{
    NSFontAttributeName : _titleLabel.font
    }
    context:nil];

    self.frame = CGRectMake(
    self.frame.origin.x, self.frame.origin.y,
    labelrect.size.width + ([self heightForCheckbox] * kCheckBoxSpacing) +
    ((kBoxSize + kCheckHorizontalExtention) * [self heightForCheckbox]),
    labelrect.size.height);

    [self layoutSubviews];
    }

Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored

Hi, your component is great, alghough, I'm getting weird logs that look like:

Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem.
Oct  7 13:44:31  HDM Survey[897] <Error>: Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem.
2016-10-07 13:44:31.829081 HDM Survey[897:303416] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable.

Oct  7 13:44:31  HDM Survey[897] <Error>: If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable.
2016-10-07 13:44:31.829793 HDM Survey[897:303416] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem.
Oct  7 13:44:31  HDM Survey[897] <Error>: Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem.
2016-10-07 13:44:31.834693 HDM Survey[897:303416] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable.

Oct  7 13:44:31  HDM Survey[897] <Error>: If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable.

Adding a symbolic error(CGPostError), got this Backtrace (using bt on lldb):

thread #1: tid = 0x4a138, 0x00000001888ebe0c CoreGraphics`CGPostError, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1
    frame #0: 0x00000001888ebe0c CoreGraphics`CGPostError
    frame #1: 0x00000001886d001c CoreGraphics`CGFloatValidateWithLog + 80
    frame #2: 0x000000018889d0dc CoreGraphics`CGPathAddLineToPoint + 96
    frame #3: 0x000000018d202778 UIKit`-[UIBezierPath addLineToPoint:] + 36
  * frame #4: 0x0000000100a27bec M13Checkbox`M13CheckboxPathPresets.pathForCheckmark(self=0x0000000170110a10) -> UIBezierPath + 192 at M13CheckboxPathPresets.swift:286
    frame #5: 0x0000000100a280a0 M13Checkbox`M13CheckboxPathPresets.pathForUnselectedCheckmark(self=0x0000000170110a10) -> UIBezierPath? + 28 at M13CheckboxPathPresets.swift:356
    frame #6: 0x0000000100a279fc M13Checkbox`M13CheckboxPathPresets.pathForUnselectedMark(self=0x0000000170110a10) -> UIBezierPath? + 80 at M13CheckboxPathPresets.swift:349
    frame #7: 0x0000000100a27978 M13Checkbox`M13CheckboxPathPresets.path(state=unchecked, self=0x0000000170110a10) -> UIBezierPath? + 96 at M13CheckboxPathPresets.swift:260
    frame #8: 0x0000000100a34654 M13Checkbox`M13CheckboxStrokeManager.layoutLayers(self=0x00000001700bd0a0) -> () + 1420 at M13CheckboxStrokeManager.swift:196
    frame #9: 0x0000000100a246ec M13Checkbox`M13CheckboxManager.resetLayersForState(state=unchecked, self=0x00000001700bd0a0) -> () + 60 at M13CheckboxManager.swift:88
    frame #10: 0x0000000100a34788 M13Checkbox`M13CheckboxStrokeManager.resetLayersForState(state=unchecked, self=0x00000001700bd0a0) -> () + 72 at M13CheckboxStrokeManager.swift:204
    frame #11: 0x00000001009f85bc M13Checkbox`M13Checkbox.sharedSetup(self=0x0000000101655920) -> () + 612 at M13Checkbox.swift:250
    frame #12: 0x00000001009f82c8 M13Checkbox`M13Checkbox.init(aDecoder=0x00000001018c1a00) -> M13Checkbox? + 760 at M13Checkbox.swift:240
    frame #13: 0x00000001009f834c M13Checkbox`@objc M13Checkbox.init(coder : NSCoder) -> M13Checkbox? + 52 at M13Checkbox.swift:0
    frame #14: 0x000000018d544b78 UIKit`-[UIClassSwapper initWithCoder:] + 248
    frame #15: 0x000000018d69464c UIKit`UINibDecoderDecodeObjectForValue + 672
    frame #16: 0x000000018d694394 UIKit`-[UINibDecoder decodeObjectForKey:] + 104
    frame #17: 0x000000018d54481c UIKit`-[UIRuntimeConnection initWithCoder:] + 188
    frame #18: 0x000000018d69464c UIKit`UINibDecoderDecodeObjectForValue + 672
    frame #19: 0x000000018d6947c0 UIKit`UINibDecoderDecodeObjectForValue + 1044
    frame #20: 0x000000018d694394 UIKit`-[UINibDecoder decodeObjectForKey:] + 104
    frame #21: 0x000000018d543b1c UIKit`-[UINib instantiateWithOwner:options:] + 1212
    frame #22: 0x000000018d3a4648 UIKit`-[UIViewController _loadViewFromNibNamed:bundle:] + 372
    frame #23: 0x000000018d176868 UIKit`-[UIViewController loadView] + 176
    frame #24: 0x000000018d042074 UIKit`-[UIViewController loadViewIfRequired] + 184
    frame #25: 0x000000018d0fbfcc UIKit`-[UINavigationController _layoutViewController:] + 72
    frame #26: 0x000000018d0fbea4 UIKit`-[UINavigationController _updateScrollViewFromViewController:toViewController:] + 416
    frame #27: 0x000000018d0fb1ec UIKit`-[UINavigationController _startTransition:fromViewController:toViewController:] + 140
    frame #28: 0x000000018d0fac38 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 856
    frame #29: 0x000000018d0fa7ec UIKit`-[UINavigationController __viewWillLayoutSubviews] + 64
    frame #30: 0x000000018d0fa750 UIKit`-[UILayoutContainerView layoutSubviews] + 188
    frame #31: 0x000000018d03f54c UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1196
    frame #32: 0x000000018a50740c QuartzCore`-[CALayer layoutSublayers] + 148
    frame #33: 0x000000018a4fc0e8 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 292
    frame #34: 0x000000018a4fbfa8 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
    frame #35: 0x000000018a478c64 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 252
    frame #36: 0x000000018a4a00d0 QuartzCore`CA::Transaction::commit() + 512
    frame #37: 0x000000018a4a0af0 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 120
    frame #38: 0x00000001871ad7dc CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    frame #39: 0x00000001871ab40c CoreFoundation`__CFRunLoopDoObservers + 372
    frame #40: 0x00000001871ab89c CoreFoundation`__CFRunLoopRun + 1024
    frame #41: 0x00000001870da048 CoreFoundation`CFRunLoopRunSpecific + 444
    frame #42: 0x0000000188b5d198 GraphicsServices`GSEventRunModal + 180
    frame #43: 0x000000018d0ad628 UIKit`-[UIApplication _run] + 684
    frame #44: 0x000000018d0a8360 UIKit`UIApplicationMain + 208
    frame #45: 0x000000010017a920 HDM Survey`main + 140 at AppDelegate.swift:6
    frame #46: 0x00000001860bc5b8 libdyld.dylib`start + 4

black window

hi . it's very nice .

but When I run the program,Black window and something does not come up and log : ```
M13Checkbox Demo[20038:913393] unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: <UIClassicWindow: 0x7ff1bc803d30; frame = (0 0; 414 736); userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0x7ff1bad12020>; layer = <UIWindowLayer: 0x7ff1bc8046d0>>
2016-04-15 07:14:58.342 M13Checkbox Demo[20038:913393] unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: <UIClassicWindow: 0x7ff1bc803d30; frame = (0 0; 414 736); userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0x7ff1bad12020>; layer = <UIWindowLayer: 0x7ff1bc8046d0>>
2016-04-15 07:14:58.870 M13Checkbox Demo[20038:913393] unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: <UIClassicWindow: 0x7ff1bc803d30; frame = (0 0; 414 736); userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0x7ff1bad12020>; layer = <UIWindowLayer: 0x7ff1bc8046d0>>

Checkbox display a line on top right when it is inside uitableviewcell for unchecked state

I have a configuredcell method for a custom uitableviewcell which initiate a m13checkbox everytime cellForRowAtIndexPath is called.

when I click on the checkbox in any row, the other checkboxes in random row will show a the box with a small line above the top right of the box whenever i scroll the UITableView. It will display like the image attached below

tick

cocoapods prompt does not support iOS6.0

When I try to install M13Checkbox by cocoa pods, prompts an error:

$ pod install
Analyzing dependencies
[!] The platform of the target Pods (iOS 6.0) is not compatible with M13Checkbox (1.1.0) which has a minimum requirement of iOS 7.0.

Carthage Unknown class M13Checkbox in Interface Builder file

Hi, I installed the framework you with carhage, the only problem is that if the code side everything seems to work, the side storyboard get a "Unknown M13Checkbox class in Interface Builder files" running.

I plugged in bridging header import but still does not work.

do you have any ideas on how to solve it?

Disabling a disabled checkbox makes text white

setEnabled doesn't check if the new enabled state is the same as the old one. As a result, setting enabled = false multiple times causes the text to lighten until it's white (and likely invisible).

Cocoapods dependency blocks demo

I don't use cocoapods.
Would be good if the demo worked out of the box, or if there were more than one option to fetch dependencies.

Creating a M13Checkbox from the IB

Hello Brandon,

I want to create a checkbox from the IB. So I dragged and placed a UIView and set its class as M13Checkbox. And referenced it as an IBOutlet in the view controller.

@property (strong, nonatomic) IBOutlet M13Checkbox *checkBox1;

I initialized it like this in the viewDidLoad method,

self.checkBox1 = [[M13Checkbox alloc] initWithTitle:@"Now to 3 Months"];
self.checkBox1.radius = 5.0;

The checkbox appears but without the title and also its not the radius one I needed.
screen shot 2014-02-02 at 6 14 02 pm

Any idea what I'm missing here and how to correct it?

Thank you :)

Are there way to use it on Swift 2.3?

I would like to use this library on swift 2.3 with xcode8.
But i could not find way to use.
This looks for only Swift3.
Are there way to use it on Swift 2.3?
I am trying to fix swift branch then,I am trying to use it.

Compiler warnings for iOS7

Is there a fork that has been updated to switch the deprecated method calls for iOS7 to the new methods?

Build fail

Build fails in this line:

let longPressGesture = M13CheckboxGestureRecognizer(target: self, action: #selector(M13Checkbox.handleLongPress(_:)))

with Expected instruction in list of expressions and Expected ',' separator and Missing argument for parameter 'action' in call.

UIControlEventValueChanged action is sent before value is actually changed

The UIControlEventValueChanged action message is sent from the beginTrackingWithTouch:withEvent: method, but the checkbox's value isn't actually changed in that method. The checkbox's value is changed in the endTrackingWithTouch:withEvent: method. Should the UIControlEventValueChanged action message instead be sent from the endTrackingWithTouch:withEvent: method?

Missing delegate

There is no callback delegate classes for changes in checkbox state. Any idea how to workaround that?

Freeze when initializing with CGRectZero

I'm using M13Checkbox in a form where the layouting is separate from the creation, thus I initWIthFrame:CGRectZero, which leads to a freeze in core graphics:

bildschirmfoto 2015-07-21 um 10 39 38

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.