JSButton
  • November 11, 2023

Demo


 

$ pod try JSButton

…or clone this repo and build and run/test the JSButton project in Xcode to see JSButton in action. If you don’t have CocoaPods installed, grab it with [sudo] gem install cocoapods.

$ cd Example
$ pod install
$ open JSButton.xcworkspace

Requirements


  • iOS 8.3+
  • Xcode 9.0
  • Swift 4.0

Installation


JSButton is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod “JSButton”

Manual Installation

Just drag the JSButton.swift files into your project.

IBDesignable

JSButton includes IBInspectable annotations to enable configuring the label inside Interface Builder. However, if you see these warnings when building…

IB Designables: Failed to update auto layout status: Failed to load designables from path (null)
IB Designables: Failed to render instance of JSButton: Failed to load designables from path (null)

…then you are likely using JSButton as a static library, which does not support IB annotations. Some workarounds include:

  • Install JSButton as a dynamic framework using CocoaPods with use_frameworks! in your Podfile, or with Carthage
  • Install JSButton by dragging its source files to your project

Usage


Creating a view from the storyboard

  • If you already have a Label where you want to use then set it’s class to JSButton in identity inspector.

  • Or drag a Button from object library and then change it’s class to JSButton in identity inspector.

  • Set the module property to JSButton.

  • Customize the view properties in the attributes inspector.

 

Add action to button

To add action to your button just use .action you dont have to add Target and then handler function.

yourButton.action {
print(“Button Pressed!”)
}

GitHub


View Github

#apple #attributesinspector #cocoapods #identityinspector #ios #iosapp #iosui #labels #storyboard #swift #swift3 #swift4 #swiftlanguage #xcode
YOU MIGHT ALSO LIKE...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...