Showing preview only (856K chars total). Download the full file or copy to clipboard to get everything.
Repository: aloco/SimpleButton
Branch: master
Commit: ae7b44515223
Files: 97
Total size: 813.9 KB
Directory structure:
gitextract_06_t_g1y/
├── .gitignore
├── .travis.yml
├── Example/
│ ├── AppDelegate.swift
│ ├── Base.lproj/
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── CustomButtons.swift
│ ├── DesignableButton.swift
│ ├── Images.xcassets/
│ │ ├── AppIcon.appiconset/
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ └── garten.imageset/
│ │ └── Contents.json
│ ├── Info.plist
│ ├── UIColorExtensions.swift
│ └── ViewController.swift
├── Example.xcodeproj/
│ ├── project.pbxproj
│ ├── project.xcworkspace/
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata/
│ └── xcschemes/
│ ├── SimpleButton.xcscheme
│ └── SimpleButtonTests.xcscheme
├── LICENSE
├── Package.swift
├── README.md
├── SimpleButton/
│ ├── Info.plist
│ ├── SimpleButton.h
│ ├── SimpleButton.swift
│ ├── SimpleButtonControlState.swift
│ └── SimpleButtonStateChangeValue.swift
├── SimpleButton.podspec
├── SimpleButtonTests/
│ ├── Info.plist
│ └── SimpleButtonTests.swift
└── docs/
├── Classes/
│ └── SimpleButton.html
├── Classes.html
├── Structs/
│ └── SimpleButtonControlState.html
├── Structs.html
├── css/
│ ├── highlight.css
│ └── jazzy.css
├── docsets/
│ ├── SimpleButton.docset/
│ │ └── Contents/
│ │ ├── Info.plist
│ │ └── Resources/
│ │ ├── Documents/
│ │ │ ├── Classes/
│ │ │ │ └── SimpleButton.html
│ │ │ ├── Classes.html
│ │ │ ├── Structs/
│ │ │ │ └── SimpleButtonControlState.html
│ │ │ ├── Structs.html
│ │ │ ├── css/
│ │ │ │ ├── highlight.css
│ │ │ │ └── jazzy.css
│ │ │ ├── index.html
│ │ │ ├── js/
│ │ │ │ └── jazzy.js
│ │ │ ├── search.json
│ │ │ └── swift_output/
│ │ │ ├── Classes/
│ │ │ │ └── SimpleButton.html
│ │ │ ├── Classes.html
│ │ │ ├── Structs/
│ │ │ │ └── SimpleButtonControlState.html
│ │ │ ├── Structs.html
│ │ │ ├── css/
│ │ │ │ ├── highlight.css
│ │ │ │ └── jazzy.css
│ │ │ ├── docsets/
│ │ │ │ ├── SimpleButton.docset/
│ │ │ │ │ └── Contents/
│ │ │ │ │ ├── Info.plist
│ │ │ │ │ └── Resources/
│ │ │ │ │ ├── Documents/
│ │ │ │ │ │ ├── Classes/
│ │ │ │ │ │ │ └── SimpleButton.html
│ │ │ │ │ │ ├── Classes.html
│ │ │ │ │ │ ├── Structs/
│ │ │ │ │ │ │ └── SimpleButtonControlState.html
│ │ │ │ │ │ ├── Structs.html
│ │ │ │ │ │ ├── css/
│ │ │ │ │ │ │ ├── highlight.css
│ │ │ │ │ │ │ └── jazzy.css
│ │ │ │ │ │ ├── index.html
│ │ │ │ │ │ ├── js/
│ │ │ │ │ │ │ └── jazzy.js
│ │ │ │ │ │ └── search.json
│ │ │ │ │ └── docSet.dsidx
│ │ │ │ ├── SimpleButton.tgz
│ │ │ │ └── SimpleButton.xml
│ │ │ ├── index.html
│ │ │ ├── js/
│ │ │ │ └── jazzy.js
│ │ │ ├── search.json
│ │ │ └── undocumented.json
│ │ └── docSet.dsidx
│ └── SimpleButton.tgz
├── index.html
├── js/
│ └── jazzy.js
├── search.json
├── swift_output/
│ ├── Classes/
│ │ └── SimpleButton.html
│ ├── Classes.html
│ ├── Structs/
│ │ └── SimpleButtonControlState.html
│ ├── Structs.html
│ ├── css/
│ │ ├── highlight.css
│ │ └── jazzy.css
│ ├── docsets/
│ │ ├── SimpleButton.docset/
│ │ │ └── Contents/
│ │ │ ├── Info.plist
│ │ │ └── Resources/
│ │ │ ├── Documents/
│ │ │ │ ├── Classes/
│ │ │ │ │ └── SimpleButton.html
│ │ │ │ ├── Classes.html
│ │ │ │ ├── Structs/
│ │ │ │ │ └── SimpleButtonControlState.html
│ │ │ │ ├── Structs.html
│ │ │ │ ├── css/
│ │ │ │ │ ├── highlight.css
│ │ │ │ │ └── jazzy.css
│ │ │ │ ├── index.html
│ │ │ │ ├── js/
│ │ │ │ │ └── jazzy.js
│ │ │ │ └── search.json
│ │ │ └── docSet.dsidx
│ │ ├── SimpleButton.tgz
│ │ └── SimpleButton.xml
│ ├── index.html
│ ├── js/
│ │ └── jazzy.js
│ ├── search.json
│ └── undocumented.json
└── undocumented.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
.DS_Store
# Swift Package Manager
.build/
================================================
FILE: .travis.yml
================================================
language: objective-c
osx_image: xcode10
script:
# The pipefail option sets the exit status to the last commond with a non-zero status code, which would usually be xcodebuild
- set -o pipefail && xcodebuild test -project Example.xcodeproj -scheme SimpleButtonTests -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone x,OS=latest" | xcpretty
================================================
FILE: Example/AppDelegate.swift
================================================
//
// AppDelegate.swift
// Example
//
// Created by Andreas Tinoco Lobo on 25.03.15.
// Copyright (c) 2015 Andreas Tinoco Lobo. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
================================================
FILE: Example/Base.lproj/LaunchScreen.xib
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
================================================
FILE: Example/Base.lproj/Main.storyboard
================================================
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="mxQ-Bh-zmZ">
<device id="retina5_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Examples-->
<scene sceneID="3ng-ST-Wqn">
<objects>
<viewController title="Examples" id="mxQ-Bh-zmZ" customClass="ViewController" customModule="Example" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="rqZ-0k-agv"/>
<viewControllerLayoutGuide type="bottom" id="u1v-g4-Npf"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="dUw-EP-3XF">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="D3f-CL-nXX" customClass="BackgroundColorButton" customModule="Example">
<rect key="frame" x="20" y="309" width="335" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="M7r-qC-Sy2"/>
</constraints>
<state key="normal" title="Button">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="t43-yN-ltM" customClass="ShadowButton" customModule="Example">
<rect key="frame" x="197.66666666666663" y="244" width="157.33333333333337" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="h7r-bn-ygn"/>
</constraints>
<state key="normal" title="Button">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="k0b-Ci-qgj" customClass="BorderColorButton" customModule="Example">
<rect key="frame" x="20" y="374" width="335" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="ey4-3l-cTN"/>
</constraints>
<state key="normal" title="Button">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HSm-us-q4x" customClass="BorderWidthButton" customModule="Example">
<rect key="frame" x="130" y="461.66666666666669" width="225" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="x8Q-bv-FVf"/>
</constraints>
<state key="normal" title="Button">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8jA-3m-30Y" customClass="LoadingButton" customModule="Example" customModuleProvider="target">
<rect key="frame" x="20" y="549" width="335" height="40"/>
<color key="backgroundColor" red="0.88831676140000004" green="0.88831676140000004" blue="0.88831676140000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="CL9-qh-C0V"/>
</constraints>
<state key="normal" title="Save"/>
<connections>
<action selector="saveButtonTouchUpInside:" destination="mxQ-Bh-zmZ" eventType="touchUpInside" id="6P1-qD-U8E"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bXO-DR-JCt" customClass="DisabledButton" customModule="Example" customModuleProvider="target">
<rect key="frame" x="20" y="609" width="335" height="40"/>
<color key="backgroundColor" red="0.90409958960000003" green="0.90409958960000003" blue="0.90409958960000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="w03-xc-LeG"/>
</constraints>
<state key="normal" title="Button"/>
<connections>
<action selector="disabledButtonTouchUpInside:" destination="mxQ-Bh-zmZ" eventType="touchUpInside" id="DGb-jd-PVM"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DEo-df-f2Q" customClass="ScaleButton" customModule="Example">
<rect key="frame" x="20" y="244" width="157.66666666666666" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="MMp-Pn-hhx"/>
</constraints>
<state key="normal" title="Button">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BWl-vM-4gd" customClass="CornerRadiusButton" customModule="Example">
<rect key="frame" x="20" y="439" width="90" height="90"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="44" id="9SQ-w8-vxA"/>
<constraint firstAttribute="height" constant="100" id="Wll-SE-JMH"/>
<constraint firstAttribute="width" secondItem="BWl-vM-4gd" secondAttribute="height" multiplier="1:1" id="yfa-Tv-4Mc"/>
</constraints>
<state key="normal" title="Button">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<variation key="default">
<mask key="constraints">
<exclude reference="9SQ-w8-vxA"/>
<exclude reference="Wll-SE-JMH"/>
</mask>
</variation>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hKU-OU-R0v" customClass="DesignableButton" customModule="Example" customModuleProvider="target">
<rect key="frame" x="20" y="669" width="335" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="uMx-U1-w8h"/>
</constraints>
<state key="normal" title="@IBDesignable Button"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="backgroundColorNormal">
<color key="value" red="0.96862745100000003" green="0.64313725489999995" blue="0.094117647060000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="titleColorNormal">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="titleColorHighlighted">
<color key="value" red="0.89866220951080322" green="0.89866220951080322" blue="0.89866220951080322" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="backgroundColorHighlight">
<color key="value" red="0.83831632137298584" green="0.37662053108215332" blue="0.024419162422418594" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="shadow" value="YES"/>
<userDefinedRuntimeAttribute type="color" keyPath="shadowColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="size" keyPath="shadowOffset">
<size key="value" width="0.0" height="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="shadowRadius">
<real key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="shadowOpacity">
<real key="value" value="0.5"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SimpleButton" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Hi-ZY-2Vx">
<rect key="frame" x="26" y="74" width="323" height="50.333333333333343"/>
<fontDescription key="fontDescription" type="system" pointSize="42"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="hKU-OU-R0v" secondAttribute="trailing" constant="20" id="0Qw-LO-dvq"/>
<constraint firstItem="BWl-vM-4gd" firstAttribute="leading" secondItem="dUw-EP-3XF" secondAttribute="leading" constant="20" id="1ww-Fq-umZ"/>
<constraint firstItem="hKU-OU-R0v" firstAttribute="top" secondItem="bXO-DR-JCt" secondAttribute="bottom" constant="20" id="2N0-g2-8gc"/>
<constraint firstItem="t43-yN-ltM" firstAttribute="top" secondItem="rqZ-0k-agv" secondAttribute="bottom" constant="200" id="2PP-mo-p11"/>
<constraint firstItem="k0b-Ci-qgj" firstAttribute="top" secondItem="D3f-CL-nXX" secondAttribute="bottom" constant="20" id="5TU-EJ-sLR"/>
<constraint firstItem="DEo-df-f2Q" firstAttribute="top" secondItem="rqZ-0k-agv" secondAttribute="bottom" constant="200" id="6ZK-nN-aoH"/>
<constraint firstItem="HSm-us-q4x" firstAttribute="leading" secondItem="BWl-vM-4gd" secondAttribute="trailing" constant="20" id="7rX-J3-mWr"/>
<constraint firstItem="hKU-OU-R0v" firstAttribute="leading" secondItem="dUw-EP-3XF" secondAttribute="leading" constant="20" id="9hr-03-iG2"/>
<constraint firstItem="8jA-3m-30Y" firstAttribute="top" secondItem="BWl-vM-4gd" secondAttribute="bottom" constant="20" id="BRm-Ey-Fst"/>
<constraint firstAttribute="trailing" secondItem="bXO-DR-JCt" secondAttribute="trailing" constant="20" id="CLY-1Z-EsZ"/>
<constraint firstItem="t43-yN-ltM" firstAttribute="width" secondItem="DEo-df-f2Q" secondAttribute="width" id="HwB-ms-zDh"/>
<constraint firstItem="DEo-df-f2Q" firstAttribute="leading" secondItem="dUw-EP-3XF" secondAttribute="leading" constant="20" id="JIp-RX-lF3"/>
<constraint firstItem="D3f-CL-nXX" firstAttribute="leading" secondItem="dUw-EP-3XF" secondAttribute="leading" constant="20" id="RQN-pA-1fY"/>
<constraint firstAttribute="trailing" secondItem="D3f-CL-nXX" secondAttribute="trailing" constant="20" id="Rbp-QB-xxc"/>
<constraint firstItem="HSm-us-q4x" firstAttribute="baseline" secondItem="BWl-vM-4gd" secondAttribute="baseline" id="Sma-99-qeQ"/>
<constraint firstItem="BWl-vM-4gd" firstAttribute="top" secondItem="k0b-Ci-qgj" secondAttribute="bottom" constant="20" id="TnQ-F2-gtH"/>
<constraint firstItem="8jA-3m-30Y" firstAttribute="leading" secondItem="dUw-EP-3XF" secondAttribute="leading" constant="20" id="Wmw-TI-JAo"/>
<constraint firstItem="k0b-Ci-qgj" firstAttribute="leading" secondItem="dUw-EP-3XF" secondAttribute="leading" constant="20" id="ekL-dS-qfT"/>
<constraint firstItem="bXO-DR-JCt" firstAttribute="leading" secondItem="dUw-EP-3XF" secondAttribute="leading" constant="20" id="f77-xa-G9c"/>
<constraint firstAttribute="trailing" secondItem="t43-yN-ltM" secondAttribute="trailing" constant="20" id="hBy-lx-VkG"/>
<constraint firstAttribute="trailing" secondItem="HSm-us-q4x" secondAttribute="trailing" constant="20" id="iAY-qC-ikP"/>
<constraint firstAttribute="trailing" secondItem="k0b-Ci-qgj" secondAttribute="trailing" constant="20" id="j2r-93-S7l"/>
<constraint firstItem="4Hi-ZY-2Vx" firstAttribute="top" secondItem="rqZ-0k-agv" secondAttribute="bottom" constant="30" id="oVV-8u-JTt"/>
<constraint firstAttribute="trailingMargin" secondItem="4Hi-ZY-2Vx" secondAttribute="trailing" constant="10" id="p0v-ef-sf8"/>
<constraint firstAttribute="trailing" secondItem="8jA-3m-30Y" secondAttribute="trailing" constant="20" id="r4n-1a-OYa"/>
<constraint firstItem="bXO-DR-JCt" firstAttribute="top" secondItem="8jA-3m-30Y" secondAttribute="bottom" constant="20" id="r9P-ql-NXh"/>
<constraint firstItem="t43-yN-ltM" firstAttribute="leading" secondItem="DEo-df-f2Q" secondAttribute="trailing" constant="20" id="s7b-kO-nAM"/>
<constraint firstItem="4Hi-ZY-2Vx" firstAttribute="leading" secondItem="dUw-EP-3XF" secondAttribute="leadingMargin" constant="10" id="sXP-SE-fKh"/>
<constraint firstItem="D3f-CL-nXX" firstAttribute="top" secondItem="DEo-df-f2Q" secondAttribute="bottom" constant="20" id="xgP-GS-Aqz"/>
<constraint firstItem="BWl-vM-4gd" firstAttribute="width" secondItem="HSm-us-q4x" secondAttribute="width" multiplier="0.4" id="zEt-hE-RBx"/>
</constraints>
</view>
<tabBarItem key="tabBarItem" title="Basic Examples" id="kdB-Fj-WDs"/>
<connections>
<outlet property="disabledButton" destination="bXO-DR-JCt" id="aVW-LS-o0M"/>
<outlet property="saveButton" destination="8jA-3m-30Y" id="xrh-6x-eeo"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="IeF-Gl-7wA" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-678" y="-226"/>
</scene>
</scenes>
</document>
================================================
FILE: Example/CustomButtons.swift
================================================
//
// CustomButtons.swift
// Example
//
// Created by Andreas Tinoco Lobo on 08.04.15.
// Copyright (c) 2015 Andreas Tinoco Lobo. All rights reserved.
//
import Foundation
import SimpleButton
class ScaleButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setBackgroundColor(UIColor.peterRiverColor(), for: .normal)
setTitle("SCALE", for: .normal)
setScale(1.0, for: .normal, animated: true, animationDuration: 0.25)
setScale(0.96, for: .highlighted, animated: true, animationDuration: 0.1)
}
}
class BackgroundColorButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setBackgroundColor(UIColor.peterRiverColor(), for: .normal, animated: true, animationDuration: 0.2)
setBackgroundColor(UIColor.belizeHoleColor(), for: .highlighted, animated: false)
setBackgroundColor(UIColor.nephritisColor(), for: SimpleButtonControlState.loading)
setTitle("BACKGROUND COLOR", for: .normal)
}
}
class BorderWidthButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setBackgroundColor(UIColor.alizarinColor(), for: .normal, animated: true)
setBorderColor(UIColor.pomergranateColor(), for: .normal, animated: true)
setTitle("BORDER WIDTH", for: .normal)
setBorderWidth(4.0, for: .normal, animated: true, animationDuration: 0.2)
setBorderWidth(8.0, for: .highlighted, animated: false)
}
}
class BorderColorButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setTitleColor(UIColor.alizarinColor(), for: .normal)
setTitleColor(UIColor.pomergranateColor(), for: .highlighted)
setBorderWidth(6.0, for: .normal)
setBorderColor(UIColor.alizarinColor(), for: .normal, animationDuration: 0.3)
setBorderColor(UIColor.pomergranateColor(), for: .highlighted, animated: false)
setTitle("BORDER COLOR", for: .normal)
}
}
class CornerRadiusButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setBackgroundColor(UIColor.peterRiverColor(), for: .normal, animated: true)
setTitle("RADIUS", for: .normal)
setCornerRadius(10.0, for: .normal, animated: true)
setCornerRadius(30.0, for: .highlighted, animated: true)
}
}
class ShadowButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setShadowRadius(10, for: .normal, animated: true)
setShadowRadius(3, for: .highlighted, animated: true)
setBackgroundColor(UIColor.alizarinColor(), for: .normal, animated: true)
setShadowColor(UIColor.asbestosColor(), for: .normal)
setShadowOpacity(1.0, for: .normal, animated: true)
setShadowOffset(CGSize(width: 0, height: 0), for: .normal, animated: true)
setTitle("SHADOW", for: .normal)
}
}
class LoadingButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setBackgroundColor(UIColor.peterRiverColor(), for: .normal)
setBackgroundColor(UIColor.belizeHoleColor(), for: .highlighted)
setBackgroundColor(UIColor.asbestosColor(), for: SimpleButtonControlState.loading)
loadingView = createCustomLoadingView()
setTitleColor(UIColor.white, for: .normal)
setTitle("PRESS TO START LOADING", for: .normal)
}
private func createCustomLoadingView() -> UIView {
let view = UIView()
let imageView = UIImageView(image: UIImage(named: "garten"))
view.addSubview(imageView)
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.heightAnchor.constraint(equalToConstant: 40).isActive = true
imageView.contentMode = .scaleAspectFit
imageView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
view.backgroundColor = .red
return view
}
}
class DisabledButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setBackgroundColor(UIColor.alizarinColor(), for: .normal)
setBackgroundColor(UIColor.pomergranateColor(), for: .highlighted)
setTitle("PRESS TO DISABLE BUTTON", for: .normal)
setTitle("BUTTON DISABLED", for: .disabled)
setBackgroundColor(UIColor.silverColor(), for: .disabled)
setTitleColor(UIColor.white, for: .normal)
}
}
================================================
FILE: Example/DesignableButton.swift
================================================
//
// DesignableButton.swift
// Example
//
// Created by Gunter Hager on 03.06.16.
// Copyright © 2016 all about apps. All rights reserved.
//
import UIKit
import SimpleButton
@IBDesignable
class DesignableButton: SimpleButton {
/// Background color for normal state.
@IBInspectable var backgroundColorNormal: UIColor?
@IBInspectable var backgroundColorHighlight: UIColor?
@IBInspectable var titleColorNormal: UIColor?
@IBInspectable var titleColorHighlighted: UIColor?
@IBInspectable var shadow: Bool = false
@IBInspectable var shadowColor: UIColor?
@IBInspectable var shadowOffset: CGSize = CGSize.zero
@IBInspectable var shadowRadius: CGFloat = 0
@IBInspectable var shadowOpacity: Float = 0
override func configureButtonStyles() {
super.configureButtonStyles()
if let backgroundColorNormal = backgroundColorNormal {
setBackgroundColor(backgroundColorNormal, for: .normal)
}
if let backgroundColorHighlight = backgroundColorHighlight {
setBackgroundColor(backgroundColorHighlight, for: .highlighted)
}
if let titleColorNormal = titleColorNormal {
setTitleColor(titleColorNormal, for: .normal)
}
if let titleColorHighlighted = titleColorHighlighted {
setTitleColor(titleColorHighlighted, for: .highlighted)
}
if shadow {
if let shadowColor = shadowColor {
setShadowColor(shadowColor)
}
setShadowOffset(shadowOffset)
setShadowRadius(shadowRadius)
setShadowOpacity(shadowOpacity)
}
}
}
================================================
FILE: Example/Images.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Example/Images.xcassets/Contents.json
================================================
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
================================================
FILE: Example/Images.xcassets/garten.imageset/Contents.json
================================================
{
"images" : [
{
"filename" : "garten.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
================================================
FILE: Example/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
================================================
FILE: Example/UIColorExtensions.swift
================================================
//
// UIColorExtensions.swift
//
// Created by Mihails Tumkins on 10/02/15.
//
import UIKit
extension UIColor {
convenience init(r: Int, g:Int, b:Int) {
self.init(red: CGFloat(r)/255, green: CGFloat(g)/255, blue: CGFloat(b)/255, alpha: 1.0)
}
class func turquoiseColor()->UIColor {
return UIColor(r: 26, g: 188, b: 156)
}
class func greenSeaColor()->UIColor {
return UIColor(r: 22, g: 160, b: 133)
}
class func emeraldColor()->UIColor {
return UIColor(r: 46, g: 204, b: 113)
}
class func nephritisColor()->UIColor {
return UIColor(r: 39, g: 174, b: 96)
}
class func peterRiverColor()->UIColor {
return UIColor(r: 52, g: 152, b: 219)
}
class func belizeHoleColor()->UIColor {
return UIColor(r: 41, g: 128, b: 185)
}
class func amethystColor()->UIColor {
return UIColor(r:155, g:89, b:182)
}
class func wisteriaColor()->UIColor {
return UIColor(r:142, g:68, b:173)
}
class func wetAsphaltColor()->UIColor {
return UIColor(r:52, g:73, b:94)
}
class func midnightBlueColor()->UIColor {
return UIColor(r:44, g:62, b:80)
}
class func sunflowerColor()->UIColor {
return UIColor(r:241, g:196, b:15)
}
class func carrotColor()->UIColor {
return UIColor(r:230, g:126, b:34)
}
class func pumpkinColor()->UIColor {
return UIColor(r:211, g:84, b:0)
}
class func alizarinColor()->UIColor {
return UIColor(r:231, g:76, b:60)
}
class func pomergranateColor()->UIColor {
return UIColor(r:192, g:57, b:43)
}
class func cloudsColor()->UIColor {
return UIColor(r:236, g:240, b:241)
}
class func silverColor()->UIColor {
return UIColor(r:189, g:195, b:199)
}
class func concreteColor()->UIColor {
return UIColor(r:149, g:165, b:166)
}
class func asbestosColor()->UIColor {
return UIColor(r:127, g:140, b:141)
}
}
================================================
FILE: Example/ViewController.swift
================================================
//
// ViewController.swift
// Example
//
// Created by Andreas Tinoco Lobo on 12/11/15.
// Copyright © 2015 Andreas Tinoco Lobo. All rights reserved.
//
import UIKit
import SimpleButton
class ViewController: UIViewController {
@IBOutlet weak var saveButton: LoadingButton!
@IBOutlet weak var disabledButton: DisabledButton!
override func viewDidLoad() {
super.viewDidLoad()
// create SimpleButton from code
}
@IBAction func disabledButtonTouchUpInside(_ sender: AnyObject) {
disabledButton.isEnabled = false
// Delay execution of my block for 3 seconds.
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(UInt64(3) * NSEC_PER_SEC)) / Double(NSEC_PER_SEC)) {
self.disabledButton.isEnabled = true
}
}
@IBAction func saveButtonTouchUpInside(_ sender: AnyObject) {
saveButton.isLoading = true
// Delay execution of my block for 3 seconds.
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(UInt64(3) * NSEC_PER_SEC)) / Double(NSEC_PER_SEC)) {
self.saveButton.isLoading = false
}
}
}
================================================
FILE: Example.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1FE0BCDE1BD6845400C9E8F6 /* SimpleButton.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A93CA2771AC2B8A800BD5B22 /* SimpleButton.framework */; };
4D032EE31ADD85C600991630 /* SimpleButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D032EE21ADD85C600991630 /* SimpleButtonTests.swift */; };
A92045E61AD5803900401655 /* CustomButtons.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92045E51AD5803900401655 /* CustomButtons.swift */; };
A93CA2531AC2B89300BD5B22 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A93CA2521AC2B89300BD5B22 /* AppDelegate.swift */; };
A93CA25A1AC2B89300BD5B22 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A93CA2591AC2B89300BD5B22 /* Images.xcassets */; };
A93CA25D1AC2B89300BD5B22 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = A93CA25B1AC2B89300BD5B22 /* LaunchScreen.xib */; };
A93CA27C1AC2B8A800BD5B22 /* SimpleButton.h in Headers */ = {isa = PBXBuildFile; fileRef = A93CA27B1AC2B8A800BD5B22 /* SimpleButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
A93CA28E1AC2B8A900BD5B22 /* SimpleButton.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A93CA2771AC2B8A800BD5B22 /* SimpleButton.framework */; };
A93CA28F1AC2B8A900BD5B22 /* SimpleButton.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A93CA2771AC2B8A800BD5B22 /* SimpleButton.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
A93CA2981AC2B91400BD5B22 /* SimpleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A93CA2971AC2B91400BD5B22 /* SimpleButton.swift */; };
A93DE0DE1BE8E20F00409A4B /* SimpleButtonControlState.swift in Sources */ = {isa = PBXBuildFile; fileRef = A93DE0DD1BE8E20F00409A4B /* SimpleButtonControlState.swift */; };
A93DE0E01BE90C8200409A4B /* SimpleButtonStateChangeValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = A93DE0DF1BE90C8200409A4B /* SimpleButtonStateChangeValue.swift */; };
A97727951C04B3E400FDC7B4 /* UIColorExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97727941C04B3E400FDC7B4 /* UIColorExtensions.swift */; };
A98449251BF4B991007E90C7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98449241BF4B991007E90C7 /* ViewController.swift */; };
A9C97EEE1AC45CCF005C14E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9C97EEC1AC45CCF005C14E0 /* Main.storyboard */; };
BC95C8DB1D01790C00BC474C /* DesignableButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC95C8DA1D01790C00BC474C /* DesignableButton.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
4D032EDD1ADD858E00991630 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A93CA2451AC2B89300BD5B22 /* Project object */;
proxyType = 1;
remoteGlobalIDString = A93CA2761AC2B8A800BD5B22;
remoteInfo = SimpleButton;
};
A93CA28C1AC2B8A900BD5B22 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A93CA2451AC2B89300BD5B22 /* Project object */;
proxyType = 1;
remoteGlobalIDString = A93CA2761AC2B8A800BD5B22;
remoteInfo = SimpleButton;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
A93CA2931AC2B8A900BD5B22 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
A93CA28F1AC2B8A900BD5B22 /* SimpleButton.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1FBF39581BD678AD00289AAD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4D032ED61ADD858E00991630 /* SimpleButtonTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SimpleButtonTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4D032EE21ADD85C600991630 /* SimpleButtonTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleButtonTests.swift; sourceTree = "<group>"; };
A92045E51AD5803900401655 /* CustomButtons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomButtons.swift; sourceTree = "<group>"; };
A93CA24D1AC2B89300BD5B22 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
A93CA2511AC2B89300BD5B22 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A93CA2521AC2B89300BD5B22 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
A93CA2591AC2B89300BD5B22 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
A93CA25C1AC2B89300BD5B22 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
A93CA2771AC2B8A800BD5B22 /* SimpleButton.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SimpleButton.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A93CA27A1AC2B8A800BD5B22 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A93CA27B1AC2B8A800BD5B22 /* SimpleButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleButton.h; sourceTree = "<group>"; };
A93CA2971AC2B91400BD5B22 /* SimpleButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleButton.swift; sourceTree = "<group>"; };
A93DE0DD1BE8E20F00409A4B /* SimpleButtonControlState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleButtonControlState.swift; sourceTree = "<group>"; };
A93DE0DF1BE90C8200409A4B /* SimpleButtonStateChangeValue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleButtonStateChangeValue.swift; sourceTree = "<group>"; };
A97727941C04B3E400FDC7B4 /* UIColorExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIColorExtensions.swift; sourceTree = "<group>"; };
A98449241BF4B991007E90C7 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
A9C97EED1AC45CCF005C14E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
BC95C8DA1D01790C00BC474C /* DesignableButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DesignableButton.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
4D032ED31ADD858E00991630 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1FE0BCDE1BD6845400C9E8F6 /* SimpleButton.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A93CA24A1AC2B89300BD5B22 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A93CA28E1AC2B8A900BD5B22 /* SimpleButton.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A93CA2731AC2B8A800BD5B22 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
4D032EBF1ADD84C800991630 /* Custom Button Classes */ = {
isa = PBXGroup;
children = (
A92045E51AD5803900401655 /* CustomButtons.swift */,
BC95C8DA1D01790C00BC474C /* DesignableButton.swift */,
);
name = "Custom Button Classes";
sourceTree = "<group>";
};
4D032ED71ADD858E00991630 /* SimpleButtonTests */ = {
isa = PBXGroup;
children = (
4D032EE21ADD85C600991630 /* SimpleButtonTests.swift */,
4D032ED81ADD858E00991630 /* Supporting Files */,
);
path = SimpleButtonTests;
sourceTree = "<group>";
};
4D032ED81ADD858E00991630 /* Supporting Files */ = {
isa = PBXGroup;
children = (
1FBF39581BD678AD00289AAD /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
A93CA2441AC2B89300BD5B22 = {
isa = PBXGroup;
children = (
A93CA24F1AC2B89300BD5B22 /* Example */,
A93CA2781AC2B8A800BD5B22 /* SimpleButton */,
4D032ED71ADD858E00991630 /* SimpleButtonTests */,
A93CA24E1AC2B89300BD5B22 /* Products */,
);
sourceTree = "<group>";
};
A93CA24E1AC2B89300BD5B22 /* Products */ = {
isa = PBXGroup;
children = (
A93CA24D1AC2B89300BD5B22 /* Example.app */,
A93CA2771AC2B8A800BD5B22 /* SimpleButton.framework */,
4D032ED61ADD858E00991630 /* SimpleButtonTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
A93CA24F1AC2B89300BD5B22 /* Example */ = {
isa = PBXGroup;
children = (
A93CA2521AC2B89300BD5B22 /* AppDelegate.swift */,
A98449241BF4B991007E90C7 /* ViewController.swift */,
A9C97EEC1AC45CCF005C14E0 /* Main.storyboard */,
4D032EBF1ADD84C800991630 /* Custom Button Classes */,
A93CA2501AC2B89300BD5B22 /* Supporting Files */,
A93CA2591AC2B89300BD5B22 /* Images.xcassets */,
A93CA25B1AC2B89300BD5B22 /* LaunchScreen.xib */,
A97727941C04B3E400FDC7B4 /* UIColorExtensions.swift */,
);
path = Example;
sourceTree = "<group>";
};
A93CA2501AC2B89300BD5B22 /* Supporting Files */ = {
isa = PBXGroup;
children = (
A93CA2511AC2B89300BD5B22 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
A93CA2781AC2B8A800BD5B22 /* SimpleButton */ = {
isa = PBXGroup;
children = (
A93CA2971AC2B91400BD5B22 /* SimpleButton.swift */,
A93DE0DD1BE8E20F00409A4B /* SimpleButtonControlState.swift */,
A93CA27B1AC2B8A800BD5B22 /* SimpleButton.h */,
A93CA2791AC2B8A800BD5B22 /* Supporting Files */,
A93DE0DF1BE90C8200409A4B /* SimpleButtonStateChangeValue.swift */,
);
path = SimpleButton;
sourceTree = "<group>";
};
A93CA2791AC2B8A800BD5B22 /* Supporting Files */ = {
isa = PBXGroup;
children = (
A93CA27A1AC2B8A800BD5B22 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
A93CA2741AC2B8A800BD5B22 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
A93CA27C1AC2B8A800BD5B22 /* SimpleButton.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
4D032ED51ADD858E00991630 /* SimpleButtonTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4D032EDF1ADD858E00991630 /* Build configuration list for PBXNativeTarget "SimpleButtonTests" */;
buildPhases = (
4D032ED21ADD858E00991630 /* Sources */,
4D032ED31ADD858E00991630 /* Frameworks */,
4D032ED41ADD858E00991630 /* Resources */,
);
buildRules = (
);
dependencies = (
4D032EDE1ADD858E00991630 /* PBXTargetDependency */,
);
name = SimpleButtonTests;
productName = SimpleButtonTests;
productReference = 4D032ED61ADD858E00991630 /* SimpleButtonTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
A93CA24C1AC2B89300BD5B22 /* Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = A93CA26C1AC2B89300BD5B22 /* Build configuration list for PBXNativeTarget "Example" */;
buildPhases = (
A93CA2491AC2B89300BD5B22 /* Sources */,
A93CA24A1AC2B89300BD5B22 /* Frameworks */,
A93CA24B1AC2B89300BD5B22 /* Resources */,
A93CA2931AC2B8A900BD5B22 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
A93CA28D1AC2B8A900BD5B22 /* PBXTargetDependency */,
);
name = Example;
productName = Example;
productReference = A93CA24D1AC2B89300BD5B22 /* Example.app */;
productType = "com.apple.product-type.application";
};
A93CA2761AC2B8A800BD5B22 /* SimpleButton */ = {
isa = PBXNativeTarget;
buildConfigurationList = A93CA2901AC2B8A900BD5B22 /* Build configuration list for PBXNativeTarget "SimpleButton" */;
buildPhases = (
A93CA2721AC2B8A800BD5B22 /* Sources */,
A93CA2731AC2B8A800BD5B22 /* Frameworks */,
A93CA2741AC2B8A800BD5B22 /* Headers */,
A93CA2751AC2B8A800BD5B22 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SimpleButton;
productName = SimpleButton;
productReference = A93CA2771AC2B8A800BD5B22 /* SimpleButton.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
A93CA2451AC2B89300BD5B22 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = "Andreas Tinoco Lobo";
TargetAttributes = {
4D032ED51ADD858E00991630 = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 0800;
};
A93CA24C1AC2B89300BD5B22 = {
CreatedOnToolsVersion = 6.3;
DevelopmentTeam = M8F9QH57A6;
LastSwiftMigration = 1100;
};
A93CA2761AC2B8A800BD5B22 = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = A93CA2481AC2B89300BD5B22 /* Build configuration list for PBXProject "Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = A93CA2441AC2B89300BD5B22;
productRefGroup = A93CA24E1AC2B89300BD5B22 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
A93CA24C1AC2B89300BD5B22 /* Example */,
A93CA2761AC2B8A800BD5B22 /* SimpleButton */,
4D032ED51ADD858E00991630 /* SimpleButtonTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
4D032ED41ADD858E00991630 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
A93CA24B1AC2B89300BD5B22 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A9C97EEE1AC45CCF005C14E0 /* Main.storyboard in Resources */,
A93CA25D1AC2B89300BD5B22 /* LaunchScreen.xib in Resources */,
A93CA25A1AC2B89300BD5B22 /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A93CA2751AC2B8A800BD5B22 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
4D032ED21ADD858E00991630 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4D032EE31ADD85C600991630 /* SimpleButtonTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A93CA2491AC2B89300BD5B22 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A93CA2531AC2B89300BD5B22 /* AppDelegate.swift in Sources */,
A97727951C04B3E400FDC7B4 /* UIColorExtensions.swift in Sources */,
A98449251BF4B991007E90C7 /* ViewController.swift in Sources */,
BC95C8DB1D01790C00BC474C /* DesignableButton.swift in Sources */,
A92045E61AD5803900401655 /* CustomButtons.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A93CA2721AC2B8A800BD5B22 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A93CA2981AC2B91400BD5B22 /* SimpleButton.swift in Sources */,
A93DE0E01BE90C8200409A4B /* SimpleButtonStateChangeValue.swift in Sources */,
A93DE0DE1BE8E20F00409A4B /* SimpleButtonControlState.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
4D032EDE1ADD858E00991630 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = A93CA2761AC2B8A800BD5B22 /* SimpleButton */;
targetProxy = 4D032EDD1ADD858E00991630 /* PBXContainerItemProxy */;
};
A93CA28D1AC2B8A900BD5B22 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = A93CA2761AC2B8A800BD5B22 /* SimpleButton */;
targetProxy = A93CA28C1AC2B8A900BD5B22 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
A93CA25B1AC2B89300BD5B22 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
A93CA25C1AC2B89300BD5B22 /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
A9C97EEC1AC45CCF005C14E0 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
A9C97EED1AC45CCF005C14E0 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
4D032EE01ADD858E00991630 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = SimpleButtonTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.aloco.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
};
name = Debug;
};
4D032EE11ADD858E00991630 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = SimpleButtonTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.aloco.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
};
name = Release;
};
A93CA26A1AC2B89300BD5B22 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
A93CA26B1AC2B89300BD5B22 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
A93CA26D1AC2B89300BD5B22 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = M8F9QH57A6;
INFOPLIST_FILE = Example/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.aloco.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
A93CA26E1AC2B89300BD5B22 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = M8F9QH57A6;
INFOPLIST_FILE = Example/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.aloco.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Release;
};
A93CA2911AC2B8A900BD5B22 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = SimpleButton/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.aloco.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
A93CA2921AC2B8A900BD5B22 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SimpleButton/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.aloco.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
4D032EDF1ADD858E00991630 /* Build configuration list for PBXNativeTarget "SimpleButtonTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4D032EE01ADD858E00991630 /* Debug */,
4D032EE11ADD858E00991630 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A93CA2481AC2B89300BD5B22 /* Build configuration list for PBXProject "Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A93CA26A1AC2B89300BD5B22 /* Debug */,
A93CA26B1AC2B89300BD5B22 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A93CA26C1AC2B89300BD5B22 /* Build configuration list for PBXNativeTarget "Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A93CA26D1AC2B89300BD5B22 /* Debug */,
A93CA26E1AC2B89300BD5B22 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A93CA2901AC2B8A900BD5B22 /* Build configuration list for PBXNativeTarget "SimpleButton" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A93CA2911AC2B8A900BD5B22 /* Debug */,
A93CA2921AC2B8A900BD5B22 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = A93CA2451AC2B89300BD5B22 /* Project object */;
}
================================================
FILE: Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Example.xcodeproj">
</FileRef>
</Workspace>
================================================
FILE: Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
================================================
FILE: Example.xcodeproj/xcshareddata/xcschemes/SimpleButton.xcscheme
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A93CA2761AC2B8A800BD5B22"
BuildableName = "SimpleButton.framework"
BlueprintName = "SimpleButton"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D032ED51ADD858E00991630"
BuildableName = "SimpleButtonTests.xctest"
BlueprintName = "SimpleButtonTests"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A93CA2761AC2B8A800BD5B22"
BuildableName = "SimpleButton.framework"
BlueprintName = "SimpleButton"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A93CA2761AC2B8A800BD5B22"
BuildableName = "SimpleButton.framework"
BlueprintName = "SimpleButton"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
================================================
FILE: Example.xcodeproj/xcshareddata/xcschemes/SimpleButtonTests.xcscheme
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D032ED51ADD858E00991630"
BuildableName = "SimpleButtonTests.xctest"
BlueprintName = "SimpleButtonTests"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D032ED51ADD858E00991630"
BuildableName = "SimpleButtonTests.xctest"
BlueprintName = "SimpleButtonTests"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D032ED51ADD858E00991630"
BuildableName = "SimpleButtonTests.xctest"
BlueprintName = "SimpleButtonTests"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D032ED51ADD858E00991630"
BuildableName = "SimpleButtonTests.xctest"
BlueprintName = "SimpleButtonTests"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2015 Andreas Tinoco Lobo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: Package.swift
================================================
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "SimpleButton",
platforms: [
.iOS(.v11)
],
products: [
.library(name: "SimpleButton", targets: ["SimpleButton"])
],
dependencies: [
],
targets: [
.target(name: "SimpleButton", dependencies: [], path: "SimpleButton/")
],
swiftLanguageVersions: [.v5]
)
================================================
FILE: README.md
================================================
# SimpleButton

[](https://travis-ci.org/aloco/SimpleButton)

UIButton subclass with animated, state-aware attributes. Easy to subclass and configure! [Full API docs](http://aloco.github.io/SimpleButton/swift_output)

## Usage
Just create your own `SimpleButton` subclass and configure your button attributes by overriding `configureButtonStyles`.
```swift
class PrimaryButton: SimpleButton {
override func configureButtonStyles() {
super.configureButtonStyles()
setBorderWidth(4.0, for: .normal)
setBackgroundColor(UIColor(red: 52/255, green: 73/255, blue: 94/255, alpha: 1.0), for: .normal)
setBackgroundColor(UIColor(red: 44/255, green: 62/255, blue: 80/255, alpha: 1.0), for: .highlighted)
setBorderColor(UIColor(red: 44/255, green: 62/255, blue: 80/255, alpha: 1.0), for: .normal)
setScale(0.98, for: .highlighted)
setTitleColor(UIColor.whiteColor(), for: .normal)
}
}
```
For usage in Interfacebuilder, just use your `SimpleButton` subclass as custom class for any `UIButton` element. All defined styles gets applied automatically.
You can also configure your button without a subclass directly inline.
```swift
let awesomeButton = SimpleButton(type: .custom)
awesomeButton.setBorderWidth(2.0, for: .normal)
awesomeButton.setBorderColor(UIColor.redColor(), for: .highlighted)
view.addSubview(awesomeButton)
```
Note that you should use `UIButtonType.custom` to avoid undesired effects.
Please checkout the example project for a detailed usage demo.
#### @IBDesignable
Have a look on [DesignableButton](Example/DesignableButton.swift) subclass within the Example Project for `@IBDesignable` usage.
### Animation
Each state change of `SimpleButton` animates by default. Sometimes you need to define which state transition should animate and which should happen immediately. Therefore you can control that behaviour with the `animated` and `animationDuration` parameters.
```
setBorderWidth(4.0, for: .normal, animated: true, animationDuration: 0.2)
setBorderWidth(8.0, for: .highlighted, animated: false)
```
This means, every state change to `.normal` animates the `borderWidth` to `4.0`.
Every state change to `.highlighted` changes instantly the `borderWidth` to `8.0` without animation.
### Loading state
`SimpleButton` has a custom `loading` state. You can toggle this state by setting `simpleButton.isLoading`. The button shows an `UIActivityIndicator` instead of the title when adding the `loading` state.
```
simpleButton.setCornerRadius(20, for: SimpleButtonControlState.loading)
simpleButton.isLoading = true
```
If you don´t like the default loading indicator, you can set your own `UIView` by doing
```
simpleButton.loadingView = CustomAwesomeLoadingView()
```
Please note, when using a custom loading view don´t forget to handle the position and initial add to subview by yourself to fit your needs.
## Configurable attributes
Take a look at the ```Setter for state attributes``` section of the [API Docs](http://aloco.github.io/SimpleButton/swift_output/Classes/SimpleButton.html#/Setter%20for%20state%20attributes)
## Installation
Note that SimpleButton is written in `swift 5` and may not be compatible with previous versions of swift.
#### Swift Package Manager (Recommended)
Add the following dependency to your `Package.swift` file:
```
.package(url: "https://github.com/allaboutapps/SimpleButton.git", from: "5.0.0")
```
#### Carthage
Add the following line to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile).
```
github "allaboutapps/SimpleButton" ~> 5.0
```
Then run `carthage update`.
#### Manually
Just drag and drop the `SimpleButton.swift` file into your project.
## Contributing
* Create something awesome, make the code better, add some functionality,
whatever (this is the hardest part).
* [Fork it](http://help.github.com/forking/)
* Create new branch to make your changes
* Commit all your changes to your branch
* Submit a [pull request](http://help.github.com/pull-requests/)
================================================
FILE: SimpleButton/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
================================================
FILE: SimpleButton/SimpleButton.h
================================================
//
// SimpleButton.h
// SimpleButton
//
// Created by Andreas Tinoco Lobo on 25.03.15.
// Copyright (c) 2015 Andreas Tinoco Lobo. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for SimpleButton.
FOUNDATION_EXPORT double SimpleButtonVersionNumber;
//! Project version string for SimpleButton.
FOUNDATION_EXPORT const unsigned char SimpleButtonVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SimpleButton/PublicHeader.h>
================================================
FILE: SimpleButton/SimpleButton.swift
================================================
//
// SimpleButton.swift
// Example
//
// Created by Andreas Tinoco Lobo on 25.03.15.
// Copyright (c) 2015 Andreas Tinoco Lobo. All rights reserved.
//
import UIKit
open class SimpleButton: UIButton {
typealias ControlState = UInt
/// Loading view. UIActivityIndicatorView as default
open var loadingView: UIView?
/// Default duration of animated state change.
open var defaultAnimationDuration: TimeInterval = 0.1
/// Represents current button state.
open override var state: UIControl.State {
// injects custom button state if necessary
if isLoading {
var options = SimpleButtonControlState.loading
options.insert(super.state)
return options
}
return super.state
}
/// used to lock any animated state transition for initial setup
private var lockAnimatedUpdate: Bool = true
/// used to determine the `from` value of any animation
private var sourceLayer: CALayer {
return (layer.presentation() ?? layer)
}
// MARK: State values with initial values
private lazy var backgroundColors: [ControlState: SimpleButtonStateChangeValue<CGColor>] = {
if let color = self.backgroundColor?.cgColor {
return [UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: color, animated: true, animationDuration: self.defaultAnimationDuration)]
}
return [:]
}()
private lazy var borderColors: [ControlState: SimpleButtonStateChangeValue<CGColor>] = {
if let color = self.layer.borderColor {
return [UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: color, animated: true, animationDuration: self.defaultAnimationDuration)]
}
return [:]
}()
private lazy var buttonScales: [ControlState: SimpleButtonStateChangeValue<CGFloat>] = {
[UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: 1.0, animated: true, animationDuration: self.defaultAnimationDuration)]
}()
private lazy var borderWidths: [ControlState: SimpleButtonStateChangeValue<CGFloat>] = {
[UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: self.layer.borderWidth, animated: true, animationDuration: self.defaultAnimationDuration)]
}()
private lazy var cornerRadii: [ControlState: SimpleButtonStateChangeValue<CGFloat>] = {
[UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: self.layer.cornerRadius, animated: true, animationDuration: self.defaultAnimationDuration)]
}()
private lazy var shadowColors: [ControlState: SimpleButtonStateChangeValue<CGColor>] = {
if let color = self.layer.shadowColor {
return [UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: color, animated: true, animationDuration: self.defaultAnimationDuration)]
}
return [:]
}()
private lazy var shadowOpacities: [ControlState: SimpleButtonStateChangeValue<Float>] = {
[UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: self.layer.shadowOpacity, animated: true, animationDuration: self.defaultAnimationDuration)]
}()
private lazy var shadowOffsets: [ControlState: SimpleButtonStateChangeValue<CGSize>] = {
[UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: self.layer.shadowOffset, animated: true, animationDuration: self.defaultAnimationDuration)]
}()
private lazy var shadowRadii: [ControlState: SimpleButtonStateChangeValue<CGFloat>] = {
[UIControl.State.normal.rawValue: SimpleButtonStateChangeValue(value: self.layer.shadowRadius, animated: true, animationDuration: self.defaultAnimationDuration)]
}()
// MARK: Overrides
open override var isEnabled: Bool {
didSet {
// manually enables / disables user interaction to restore correct state if loading or enabled state are switched separate or together
if !isEnabled {
self.isUserInteractionEnabled = false
}
else if !state.contains(SimpleButtonControlState.loading), isEnabled {
self.isUserInteractionEnabled = true
}
update()
}
}
open override var isHighlighted: Bool {
didSet {
update()
}
}
open override var isSelected: Bool {
didSet {
update()
}
}
// MARK: Custom states
/// A Boolean value that determines the SimpleButton´s loading state.
/// Specify `true` to switch to the loading state.
/// If set to `true`, SimpleButton shows `loadingView` and hides the default `titleLabel` and `imageView`
open var isLoading: Bool = false {
didSet {
DispatchQueue.main.async {
if self.isLoading {
if self.loadingView == nil {
self.setDefaultLoadingView()
}
self.isUserInteractionEnabled = false
self.showLoadingView(animaded: true)
} else {
if !self.state.contains(.disabled) {
self.isUserInteractionEnabled = true
}
self.hideLoadingView(animaded: true)
}
self.update()
}
}
}
// MARK: Initializer
public required override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setup()
}
open override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
setup()
}
open override func awakeFromNib() {
super.awakeFromNib()
setup()
}
private func setup() {
lockAnimatedUpdate = true
configureButtonStyles()
update()
lockAnimatedUpdate = false
}
// MARK: Configuration
/**
To define various styles for specific button states, override this function and set attributes for specific states (e.g. setBackgroundColor(UIColor.blueColor(), for: .Highlighted, animated: true))
*/
open func configureButtonStyles() {}
// MARK: Setter for state attributes
/**
Sets the scale for a specific `UIControlState`
- parameter scale: scale of button
- parameter state: determines at which state that scale applies
- parameter animated: determines if that change in scale should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setScale(_ scale: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
buttonScales[state.rawValue] = SimpleButtonStateChangeValue(value: scale, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateScale()
}
/**
Sets the background color for a specific `UIControlState`
- parameter color: background color of button
- parameter state: determines at which state that background color applies
- parameter animated: determines if that change in background color should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setBackgroundColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
backgroundColors[state.rawValue] = SimpleButtonStateChangeValue(value: color.cgColor, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateBackgroundColor()
}
/**
Sets the border width for a specific `UIControlState`
- parameter width: border width of button
- parameter state: determines at which state that border width applies
- parameter animated: determines if that change in border width should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setBorderWidth(_ width: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
borderWidths[state.rawValue] = SimpleButtonStateChangeValue(value: width, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateBorderWidth()
}
/**
Sets the border color for a specific `UIControlState`
- parameter color: border color of button
- parameter state: determines at which state that border color applies
- parameter animated: determines if that change in border color should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setBorderColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
borderColors[state.rawValue] = SimpleButtonStateChangeValue(value: color.cgColor, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateBorderColor()
}
/**
Sets the corner radius for a specific `UIControlState`
- parameter radius: corner radius of button
- parameter state: determines at which state that corner radius applies
- parameter animated: determines if that change in radius of the corners should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setCornerRadius(_ radius: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
cornerRadii[state.rawValue] = SimpleButtonStateChangeValue(value: radius, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateCornerRadius()
}
/**
Sets the shadow color for a specific `UIControlState`
- parameter color: shadow color of button
- parameter state: determines at which state that shadow color applies
- parameter animated: determines if that change in shadow color should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setShadowColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
shadowColors[state.rawValue] = SimpleButtonStateChangeValue(value: color.cgColor, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateShadowColor()
}
/**
Sets the shadow opacity for a specific `UIControlState`
- parameter opacity: shadow opacity of button
- parameter state: determines at which state that shadow opacity applies
- parameter animated: determines if that change in shadow opacity should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setShadowOpacity(_ opacity: Float, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
shadowOpacities[state.rawValue] = SimpleButtonStateChangeValue(value: opacity, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateShadowOpacity()
}
/**
Sets the shadow radius for a specific `UIControlState`
- parameter radius: shadow radius of button
- parameter state: determines at which state that shadow radius applies
- parameter animated: determines if that change in shadow radius should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setShadowRadius(_ radius: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
shadowRadii[state.rawValue] = SimpleButtonStateChangeValue(value: radius, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateShadowRadius()
}
/**
Sets the shadow offset for a specific `UIControlState`
- parameter offset: shadow offset of button
- parameter state: determines at which state that shadow offset applies
- parameter animated: determines if that change in shadow offset should animate. Default is `true`
- parameter animationDuration: set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from `defaultAnimationDuration`
*/
open func setShadowOffset(_ offset: CGSize, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil) {
shadowOffsets[state.rawValue] = SimpleButtonStateChangeValue(value: offset, animated: animated, animationDuration: animationDuration ?? defaultAnimationDuration)
updateShadowOffset()
}
/**
Sets the spacing between `titleLabel` and `imageView`
- parameter spacing: spacing between `titleLabel` and `imageView`
*/
open func setTitleImageSpacing(_ spacing: CGFloat) {
imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: spacing / 2)
titleEdgeInsets = UIEdgeInsets(top: 0, left: spacing / 2, bottom: 0, right: 0)
}
// MARK: Attribute update helper
/**
Updates all attributes if necessary. Each update function determines by itself if an update of any attribute is necessary. It also determines if that update should animate.
- parameter lockAnimatedUpdate: set this to true to update without animation, even it´s defined in `SimpleButtonStateChange`. Used to set initial button attributes
*/
private func update() {
updateBackgroundColor()
updateBorderColor()
updateBorderWidth()
updateCornerRadius()
updateScale()
updateShadowColor()
updateShadowOffset()
updateShadowOpacity()
updateShadowRadius()
}
private func updateCornerRadius() {
if let stateChange = cornerRadii[state.rawValue] ?? cornerRadii[UIControl.State.normal.rawValue], stateChange.value != layer.cornerRadius {
if stateChange.animated, !lockAnimatedUpdate {
animate(layer: layer, from: sourceLayer.cornerRadius as AnyObject?, to: stateChange.value as AnyObject, forKey: "cornerRadius", duration: stateChange.animationDuration)
}
layer.cornerRadius = stateChange.value
}
}
private func updateScale() {
if let stateChange = buttonScales[state.rawValue] ?? buttonScales[UIControl.State.normal.rawValue], transform.a != stateChange.value, transform.b != stateChange.value {
let animations = {
self.transform = CGAffineTransform(scaleX: stateChange.value, y: stateChange.value)
}
stateChange.animated && !lockAnimatedUpdate ? UIView.animate(withDuration: stateChange.animationDuration, animations: animations) : animations()
}
}
private func updateBackgroundColor() {
if let stateChange = backgroundColors[state.rawValue] ?? backgroundColors[UIControl.State.normal.rawValue], layer.backgroundColor == nil || UIColor(cgColor: layer.backgroundColor!) != UIColor(cgColor: stateChange.value) {
if stateChange.animated, !lockAnimatedUpdate {
animate(layer: layer, from: sourceLayer.backgroundColor, to: stateChange.value, forKey: "backgroundColor", duration: stateChange.animationDuration)
}
layer.backgroundColor = stateChange.value
}
}
private func updateBorderColor() {
if let stateChange = borderColors[state.rawValue] ?? borderColors[UIControl.State.normal.rawValue], layer.borderColor == nil || UIColor(cgColor: layer.borderColor!) != UIColor(cgColor: stateChange.value) {
if stateChange.animated, !lockAnimatedUpdate {
animate(layer: layer, from: sourceLayer.borderColor, to: stateChange.value, forKey: "borderColor", duration: stateChange.animationDuration)
}
layer.borderColor = stateChange.value
}
}
private func updateBorderWidth() {
if let stateChange = borderWidths[state.rawValue] ?? borderWidths[UIControl.State.normal.rawValue], stateChange.value != layer.borderWidth {
if stateChange.animated, !lockAnimatedUpdate {
animate(layer: layer, from: sourceLayer.borderWidth as AnyObject?, to: stateChange.value as AnyObject, forKey: "borderWidth", duration: stateChange.animationDuration)
}
layer.borderWidth = stateChange.value
}
}
private func updateShadowOffset() {
if let stateChange = shadowOffsets[state.rawValue] ?? shadowOffsets[UIControl.State.normal.rawValue], stateChange.value != layer.shadowOffset {
if stateChange.animated, !lockAnimatedUpdate {
animate(layer: layer, from: NSValue(cgSize: sourceLayer.shadowOffset), to: NSValue(cgSize: stateChange.value), forKey: "shadowOffset", duration: stateChange.animationDuration)
}
layer.shadowOffset = stateChange.value
}
}
private func updateShadowColor() {
if let stateChange = shadowColors[state.rawValue] ?? shadowColors[UIControl.State.normal.rawValue], layer.shadowColor == nil || UIColor(cgColor: layer.shadowColor!) != UIColor(cgColor: stateChange.value) {
if stateChange.animated, !lockAnimatedUpdate {
animate(layer: layer, from: sourceLayer.shadowColor, to: stateChange.value, forKey: "shadowColor", duration: stateChange.animationDuration)
}
layer.shadowColor = stateChange.value
}
}
private func updateShadowRadius() {
if let stateChange = shadowRadii[state.rawValue] ?? shadowRadii[UIControl.State.normal.rawValue], stateChange.value != layer.shadowRadius {
if stateChange.animated, !lockAnimatedUpdate {
animate(layer: layer, from: sourceLayer.shadowRadius as AnyObject?, to: stateChange.value as AnyObject, forKey: "shadowRadius", duration: stateChange.animationDuration)
}
layer.shadowRadius = stateChange.value
}
}
private func updateShadowOpacity() {
if let stateChange = shadowOpacities[state.rawValue] ?? shadowOpacities[UIControl.State.normal.rawValue], stateChange.value != layer.shadowOpacity {
if stateChange.animated, !lockAnimatedUpdate {
animate(layer: layer, from: sourceLayer.shadowOpacity as AnyObject?, to: stateChange.value as AnyObject, forKey: "shadowOpacity", duration: stateChange.animationDuration)
}
layer.shadowOpacity = stateChange.value
}
}
// MARK: Animation helper
private func animate(layer: CALayer, from: AnyObject?, to: AnyObject, forKey key: String, duration: TimeInterval) {
let animation = CABasicAnimation()
animation.fromValue = from
animation.toValue = to
animation.duration = duration
layer.add(animation, forKey: key)
}
// MARK: Layout
open override func layoutSubviews() {
super.layoutSubviews()
loadingView?.center = CGPoint(x: bounds.size.width / 2,
y: bounds.size.height / 2)
}
// MARK: - LoadingView
private func setDefaultLoadingView() {
let activityIndicator = UIActivityIndicatorView(style: .white)
activityIndicator.startAnimating()
activityIndicator.hidesWhenStopped = false
activityIndicator.alpha = 0
loadingView = activityIndicator
}
private func addLoadingViewAsSubView() {
guard let loadingView = loadingView else { return }
loadingView.translatesAutoresizingMaskIntoConstraints = false
addSubview(loadingView)
NSLayoutConstraint.activate([
trailingAnchor.constraint(equalTo: loadingView.trailingAnchor, constant: contentEdgeInsets.right),
loadingView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: contentEdgeInsets.left),
loadingView.topAnchor.constraint(equalTo: topAnchor, constant: contentEdgeInsets.top),
bottomAnchor.constraint(equalTo: loadingView.bottomAnchor, constant: contentEdgeInsets.bottom)
])
layoutIfNeeded()
}
private func removeLoadingViewAsSubView() {
loadingView?.removeFromSuperview()
layoutIfNeeded()
}
private func showLoadingView(animaded: Bool) {
let animation = { [weak self] in
self?.loadingView?.alpha = 1
self?.titleLabel?.layer.opacity = 0
self?.imageView?.alpha = 0
}
if loadingView?.superview == nil {
addLoadingViewAsSubView()
loadingView?.alpha = 0
}
if animaded {
loadingView?.alpha = 0
UIView.animate(withDuration: defaultAnimationDuration, animations: animation)
} else {
animation()
}
}
private func hideLoadingView(animaded: Bool) {
let animation = { [weak self] in
self?.loadingView?.alpha = 0
self?.titleLabel?.layer.opacity = 2
self?.imageView?.alpha = 1
}
let completion: (Bool) -> Void = { [weak self] _ in
self?.removeLoadingViewAsSubView()
}
if animaded {
UIView.animate(withDuration: defaultAnimationDuration, animations: animation, completion: completion)
} else {
animation()
completion(true)
}
}
}
================================================
FILE: SimpleButton/SimpleButtonControlState.swift
================================================
//
// SimpleButtonControlState.swift
// Example
//
// Created by Andreas Tinoco Lobo on 03/11/15.
// Copyright © 2015 Andreas Tinoco Lobo. All rights reserved.
//
import UIKit
/**
* Custom SimpleButton control state
*/
public struct SimpleButtonControlState {
/// Indicates loading state of SimpleButton
public static let loading: UIControl.State = UIControl.State(rawValue: 1 << 16)
}
================================================
FILE: SimpleButton/SimpleButtonStateChangeValue.swift
================================================
//
// SimpleButtonStateChangeValue.swift
// Example
//
// Created by Andreas Tinoco Lobo on 03/11/15.
// Copyright © 2015 Andreas Tinoco Lobo. All rights reserved.
//
import Foundation
/**
* defines whether state transition to a given value should animate and at which speed
*/
struct SimpleButtonStateChangeValue<T> {
let value: T
let animated: Bool
let animationDuration: TimeInterval
}
================================================
FILE: SimpleButton.podspec
================================================
Pod::Spec.new do |s|
s.name = "SimpleButton"
s.version = "4.0.1"
s.summary = "Simple UIButton subclass with additional state change animations (e.g. backgroundColor)"
s.description = "Simple UIButton subclass with animated, state-aware attributes. Easy to subclass and configure!"
s.homepage = "https://github.com/aloco/SimpleButton"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Andreas Tinoco Lobo" => "andreas@tinoco-lobo.at" }
s.platform = :ios
s.ios.deployment_target = "8.1"
s.source = { :git => "https://github.com/aloco/SimpleButton.git", :tag => s.version }
s.requires_arc = true
s.source_files = "SimpleButton/*.swift"
s.swift_version = "4.0"
end
================================================
FILE: SimpleButtonTests/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
================================================
FILE: SimpleButtonTests/SimpleButtonTests.swift
================================================
//
// SimpleButtonTests.swift
// SimpleButtonTests
//
// Created by Alexander Schuch on 14/04/15.
// Copyright (c) 2015 Andreas Tinoco Lobo. All rights reserved.
//
import UIKit
import XCTest
import SimpleButton
class SimpleButtonTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
// MARK: BackgroundColor
func testSetBackgroundColor() {
// This is an example of a functional test case.
let button = SimpleButton(type: .custom)
button.setBackgroundColor(UIColor.red)
XCTAssertEqual(button.backgroundColor, UIColor.red, "backgroundColor doesn't match")
}
func testSetBackgroundColorStateChange() {
let button = SimpleButton(type: .custom)
button.setBackgroundColor(UIColor.green, for: .normal, animated: true)
button.isEnabled = true
XCTAssertEqual(button.backgroundColor, UIColor.green, "enabled backgroundColor doesn't match set color")
button.setBackgroundColor(UIColor.red, for: .disabled, animated: true)
button.isEnabled = false
XCTAssertEqual(button.backgroundColor, UIColor.red, "disabled backgroundColor doesn't match set color")
}
// MARK: BorderColor
func testBorderColor() {
let button = SimpleButton(type: .custom)
button.setBorderColor(UIColor.red)
XCTAssertEqual(UIColor(cgColor: button.layer.borderColor!), UIColor.red, "borderColor doesn't match")
}
func testBorderColorWithStateChange() {
let button = SimpleButton(type: .custom)
button.setBorderColor(UIColor.green, for: .normal, animated: true)
button.isEnabled = true
XCTAssertEqual(UIColor(cgColor: button.layer.borderColor!), UIColor.green, "enabled borderColor doesn't match")
button.setBorderColor(UIColor.red, for: .disabled, animated: true)
button.isEnabled = false
XCTAssertEqual(UIColor(cgColor: button.layer.borderColor!), UIColor.red, "disabled borderColor doesn't match")
}
// MARK: BorderWidth
func testBorderWidthWithStateChange() {
let button = SimpleButton(type: .custom)
button.setBorderWidth(1.0)
button.setBorderWidth(0.5, for: .highlighted, animated: true)
let unhighlightedWidth = button.layer.borderWidth;
button.isHighlighted = true
let highlightedWidth = button.layer.borderWidth;
XCTAssertEqual(unhighlightedWidth, 1.0, "unhighlightedWidth doesn't macth expected width of 1.0")
XCTAssertEqual(highlightedWidth, 0.5, "highlightedWidth doesn't macth expected width of 0.5")
}
// MARK: CornerRadius
func testSetCornerRadius() {
let button = SimpleButton(type: .custom)
button.setCornerRadius(2.0)
XCTAssertEqual(button.layer.cornerRadius, 2.0, "corderRadius doesn't match")
}
func testSetCornerRadiusWithStateChange() {
let button = SimpleButton(type: .custom)
button.setCornerRadius(4.0, for: .normal, animated: true)
button.isEnabled = true
XCTAssertEqual(button.layer.cornerRadius, 4.0, "enabled corderRadius doesn't match")
button.setCornerRadius(2.0, for: .disabled, animated: true)
button.isEnabled = false
XCTAssertEqual(button.layer.cornerRadius, 2.0, "corderRadius doesn't match")
}
// MARK: Scale
func testSetScale() {
let button = SimpleButton(type: .custom)
let originalScale = button.frame.height
button.setScale(0.5)
let halfSizeScale = button.frame.height
XCTAssertEqual(originalScale * 0.5, halfSizeScale, "halfSizeScale scale doesn't match originalScale * 0.5")
}
func testScaleWithStateChange() {
let button = SimpleButton(type: .custom)
button.setScale(0.5, for: .selected, animated: true)
let unselectedSize = button.frame.height
button.isSelected = true
let selectedSize = button.frame.height
XCTAssertEqual(unselectedSize * 0.5, selectedSize, "selected scale doesn't match unselected scale * 0.5")
}
// MARK: ShadowColor
func testSetShadowColor() {
let button = SimpleButton(type: .custom)
button.setShadowColor(UIColor.red, for: .normal, animated: true)
XCTAssertEqual(UIColor(cgColor: button.layer.shadowColor ?? UIColor.blue.cgColor), UIColor.red, "shadowColor doesn't match")
}
func testSetShadowColorStateChange() {
let button = SimpleButton(type: .custom)
button.setShadowColor(UIColor.green, for: .normal, animated: true)
button.isEnabled = true
XCTAssertEqual(UIColor(cgColor: button.layer.shadowColor ?? UIColor.blue.cgColor), UIColor.green, "enabled backgroundColor doesn't match set color")
button.setShadowColor(UIColor.red, for: .disabled, animated: true)
button.isEnabled = false
XCTAssertEqual(UIColor(cgColor: button.layer.shadowColor ?? UIColor.blue.cgColor), UIColor.red, "disabled backgroundColor doesn't match set color")
}
// MARK: ShadowOffset
func testSetShadowOffset() {
let button = SimpleButton(type: .custom)
let offset = CGSize(width: 10, height: 10)
button.setShadowOffset(offset, for: .normal, animated: true)
XCTAssertEqual(offset, button.layer.shadowOffset, "shadowOffset doesn't match")
}
func testSetShadowOffsetStateChange() {
let button = SimpleButton(type: .custom)
let offset = CGSize(width: 10, height: 10)
button.setShadowOffset(offset, for: .normal, animated: true)
XCTAssertEqual(offset, button.layer.shadowOffset, "shadowOffset doesn't match")
let newOffset = CGSize(width: 2, height: 3)
button.setShadowOffset(newOffset, for: .disabled, animated: true)
button.isEnabled = false
XCTAssertEqual(newOffset, button.layer.shadowOffset, "disabled shadowOffset doesn't match")
}
// MARK: ShadowRadius
func testSetShadowRadius() {
let button = SimpleButton(type: .custom)
let offset = CGSize(width: 10, height: 10)
button.setShadowOffset(offset, for: .normal, animated: true)
XCTAssertEqual(offset, button.layer.shadowOffset, "shadowOffset doesn't match")
}
func testSetShadowRadiusStateChange() {
let button = SimpleButton(type: .custom)
button.setShadowRadius(10, for: .normal, animated: true)
XCTAssertEqual(10, button.layer.shadowRadius, "shadowRadius doesn't match")
button.setShadowRadius(2, for: .disabled, animated: true)
button.isEnabled = false
XCTAssertEqual(2, button.layer.shadowRadius, "disabled shadowRadius doesn't match")
}
// MARK: ShadowOpacity
func testSetShadowOpacity() {
let button = SimpleButton(type: .custom)
let offset = CGSize(width: 10, height: 10)
button.setShadowOffset(offset, for: .normal, animated: true)
XCTAssertEqual(offset, button.layer.shadowOffset, "shadowOffset doesn't match")
}
func testSetShadowOpacityStateChange() {
let button = SimpleButton(type: .custom)
button.setShadowOpacity(1, for: .normal, animated: true)
XCTAssertEqual(1, button.layer.shadowOpacity, "shadowOpacity doesn't match")
button.setShadowOpacity(0.5, for: .disabled, animated: true)
button.isEnabled = false
XCTAssertEqual(0.5, button.layer.shadowOpacity, "disabled shadowOpacity doesn't match")
}
// MARK: EdgeCases
func testChangeStateBackgroundColorWithoutStateChange() {
let button = SimpleButton(type: .custom)
button.setBackgroundColor(UIColor.green, for: .normal, animated: true)
XCTAssertEqual(button.backgroundColor, UIColor.green, "backgorundColor doesn't match")
button.setBackgroundColor(UIColor.red, for: .normal, animated: true)
XCTAssertEqual(button.backgroundColor, UIColor.red, "backgorundColor doesn't match")
}
// MARK: StateChange tests
func testStateChange() {
let button = SimpleButton(type: .custom)
XCTAssertEqual(button.state, UIControlState.normal, "state should be set to Normal")
button.isHighlighted = true
XCTAssertEqual(button.state, UIControlState.highlighted, "state should be set to Highlighted")
button.isEnabled = false
print(button.state)
XCTAssert(button.state.contains(.highlighted), "state should contain highlighted")
button.isLoading = true
print(button.state)
XCTAssert(button.state.contains(SimpleButtonControlState.loading), "state should contain Loading")
}
// MARK: Check correct enable / disable of userInteractionEnabled
func testUserInteractionEnabled() {
let button = SimpleButton(type: .custom)
button.isEnabled = false
XCTAssert(button.isUserInteractionEnabled == false, "userInteractionEnabled should be set to false")
button.isEnabled = true
XCTAssert(button.isUserInteractionEnabled == true, "userInteractionEnabled should be set to true")
button.isLoading = true
XCTAssert(button.isUserInteractionEnabled == false, "userInteractionEnabled should be set to false")
button.isLoading = false
XCTAssert(button.isUserInteractionEnabled == true, "userInteractionEnabled should be set to true")
button.isLoading = true
button.isEnabled = true
XCTAssert(button.isUserInteractionEnabled == false, "userInteractionEnabled should be set to false")
button.isEnabled = false
button.isLoading = false
XCTAssert(button.isUserInteractionEnabled == false, "userInteractionEnabled should be set to false")
button.isLoading = false
button.isEnabled = true
XCTAssert(button.isUserInteractionEnabled == true, "userInteractionEnabled should be set to true")
button.isLoading = true
button.isEnabled = false
XCTAssert(button.isUserInteractionEnabled == false, "userInteractionEnabled should be set to false")
button.isLoading = true
button.isEnabled = false
button.isLoading = false
XCTAssert(button.isUserInteractionEnabled == false, "userInteractionEnabled should be set to false")
button.isLoading = false
button.isEnabled = true
button.isLoading = true
XCTAssert(button.isUserInteractionEnabled == false, "userInteractionEnabled should be set to false")
button.isEnabled = false
button.isLoading = false
button.isEnabled = true
XCTAssert(button.isUserInteractionEnabled == true, "userInteractionEnabled should be set to true")
button.isEnabled = true
button.isLoading = true
button.isEnabled = false
XCTAssert(button.isUserInteractionEnabled == false, "userInteractionEnabled should be set to false")
}
}
================================================
FILE: docs/Classes/SimpleButton.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<title>SimpleButton Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/SimpleButton" class="dashAnchor"></a>
<a title="SimpleButton Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SimpleButton Docs</a> (65% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SimpleButton Reference</a>
<img id="carat" src="../img/carat.png" />
SimpleButton Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/SimpleButton.html">SimpleButton</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/SimpleButtonControlState.html">SimpleButtonControlState</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>SimpleButton</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">SimpleButton</span> <span class="p">:</span> <span class="kt">UIButton</span></code></pre>
</div>
</div>
<p>Undocumented</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC11loadingViewSo6UIViewCSgvp"></a>
<a name="//apple_ref/swift/Property/loadingView" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC11loadingViewSo6UIViewCSgvp">loadingView</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Loading view. UIActivityIndicatorView as default</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="k">var</span> <span class="nv">loadingView</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC24defaultAnimationDurationSdvp"></a>
<a name="//apple_ref/swift/Property/defaultAnimationDuration" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Default duration of animated state change.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="k">var</span> <span class="nv">defaultAnimationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(py)state"></a>
<a name="//apple_ref/swift/Property/state" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(py)state">state</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Represents current button state.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="k">override</span> <span class="k">var</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Overrides"></a>
<a name="//apple_ref/swift/Section/Overrides" class="dashAnchor"></a>
<a href="#/Overrides">
<h3 class="section-name">Overrides</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(py)enabled"></a>
<a name="//apple_ref/swift/Property/isEnabled" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(py)enabled">isEnabled</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">override</span> <span class="kd">open</span> <span class="k">var</span> <span class="nv">isEnabled</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(py)highlighted"></a>
<a name="//apple_ref/swift/Property/isHighlighted" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(py)highlighted">isHighlighted</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">override</span> <span class="kd">open</span> <span class="k">var</span> <span class="nv">isHighlighted</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(py)selected"></a>
<a name="//apple_ref/swift/Property/isSelected" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(py)selected">isSelected</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">override</span> <span class="kd">open</span> <span class="k">var</span> <span class="nv">isSelected</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Custom%20states"></a>
<a name="//apple_ref/swift/Section/Custom states" class="dashAnchor"></a>
<a href="#/Custom%20states">
<h3 class="section-name">Custom states</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC9isLoadingSbvp"></a>
<a name="//apple_ref/swift/Property/isLoading" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC9isLoadingSbvp">isLoading</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A Boolean value that determines the SimpleButton´s loading state.
Specify <code>true</code> to switch to the loading state.
If set to <code>true</code>, SimpleButton shows <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC11loadingViewSo6UIViewCSgvp">loadingView</a></code> and hides the default <code>titleLabel</code> and <code>imageView</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="k">var</span> <span class="nv">isLoading</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Initializer"></a>
<a name="//apple_ref/swift/Section/Initializer" class="dashAnchor"></a>
<a href="#/Initializer">
<h3 class="section-name">Initializer</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(im)initWithFrame:"></a>
<a name="//apple_ref/swift/Method/init(frame:)" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(im)initWithFrame:">init(frame:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">required</span> <span class="k">override</span> <span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">frame</span><span class="p">:</span> <span class="kt">CGRect</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(im)initWithCoder:"></a>
<a name="//apple_ref/swift/Method/init(coder:)" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(im)initWithCoder:">init(coder:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">required</span> <span class="kd">public</span> <span class="nf">init</span><span class="p">?(</span><span class="n">coder</span> <span class="nv">aDecoder</span><span class="p">:</span> <span class="kt">NSCoder</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(im)prepareForInterfaceBuilder"></a>
<a name="//apple_ref/swift/Method/prepareForInterfaceBuilder()" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(im)prepareForInterfaceBuilder">prepareForInterfaceBuilder()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">prepareForInterfaceBuilder</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(im)awakeFromNib"></a>
<a name="//apple_ref/swift/Method/awakeFromNib()" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(im)awakeFromNib">awakeFromNib()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">awakeFromNib</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Configuration"></a>
<a name="//apple_ref/swift/Section/Configuration" class="dashAnchor"></a>
<a href="#/Configuration">
<h3 class="section-name">Configuration</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC09configureB6StylesyyF"></a>
<a name="//apple_ref/swift/Method/configureButtonStyles()" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC09configureB6StylesyyF">configureButtonStyles()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>To define various styles for specific button states, override this function and set attributes for specific states (e.g. setBackgroundColor(UIColor.blueColor(), for: .Highlighted, animated: true))</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">configureButtonStyles</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Setter%20for%20state%20attributes"></a>
<a name="//apple_ref/swift/Section/Setter for state attributes" class="dashAnchor"></a>
<a href="#/Setter%20for%20state%20attributes">
<h3 class="section-name">Setter for state attributes</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC8setScale_3for8animated17animationDurationy12CoreGraphics7CGFloatV_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setScale(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC8setScale_3for8animated17animationDurationy12CoreGraphics7CGFloatV_So14UIControlStateVSbSdSgtF">setScale(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the scale for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setScale</span><span class="p">(</span><span class="n">_</span> <span class="nv">scale</span><span class="p">:</span> <span class="kt">CGFloat</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>scale</em>
</code>
</td>
<td>
<div>
<p>scale of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that scale applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in scale should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC18setBackgroundColor_3for8animated17animationDurationySo7UIColorC_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setBackgroundColor(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC18setBackgroundColor_3for8animated17animationDurationySo7UIColorC_So14UIControlStateVSbSdSgtF">setBackgroundColor(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the background color for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setBackgroundColor</span><span class="p">(</span><span class="n">_</span> <span class="nv">color</span><span class="p">:</span> <span class="kt">UIColor</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>color</em>
</code>
</td>
<td>
<div>
<p>background color of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that background color applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in background color should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC14setBorderWidth_3for8animated17animationDurationy12CoreGraphics7CGFloatV_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setBorderWidth(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC14setBorderWidth_3for8animated17animationDurationy12CoreGraphics7CGFloatV_So14UIControlStateVSbSdSgtF">setBorderWidth(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the border width for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setBorderWidth</span><span class="p">(</span><span class="n">_</span> <span class="nv">width</span><span class="p">:</span> <span class="kt">CGFloat</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>width</em>
</code>
</td>
<td>
<div>
<p>border width of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that border width applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in border width should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC14setBorderColor_3for8animated17animationDurationySo7UIColorC_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setBorderColor(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC14setBorderColor_3for8animated17animationDurationySo7UIColorC_So14UIControlStateVSbSdSgtF">setBorderColor(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the border color for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setBorderColor</span><span class="p">(</span><span class="n">_</span> <span class="nv">color</span><span class="p">:</span> <span class="kt">UIColor</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>color</em>
</code>
</td>
<td>
<div>
<p>border color of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that border color applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in border color should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC15setCornerRadius_3for8animated17animationDurationy12CoreGraphics7CGFloatV_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setCornerRadius(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC15setCornerRadius_3for8animated17animationDurationy12CoreGraphics7CGFloatV_So14UIControlStateVSbSdSgtF">setCornerRadius(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the corner radius for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setCornerRadius</span><span class="p">(</span><span class="n">_</span> <span class="nv">radius</span><span class="p">:</span> <span class="kt">CGFloat</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>radius</em>
</code>
</td>
<td>
<div>
<p>corner radius of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that corner radius applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in radius of the corners should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC14setShadowColor_3for8animated17animationDurationySo7UIColorC_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setShadowColor(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC14setShadowColor_3for8animated17animationDurationySo7UIColorC_So14UIControlStateVSbSdSgtF">setShadowColor(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the shadow color for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setShadowColor</span><span class="p">(</span><span class="n">_</span> <span class="nv">color</span><span class="p">:</span> <span class="kt">UIColor</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>color</em>
</code>
</td>
<td>
<div>
<p>shadow color of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that shadow color applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in shadow color should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC16setShadowOpacity_3for8animated17animationDurationySf_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setShadowOpacity(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC16setShadowOpacity_3for8animated17animationDurationySf_So14UIControlStateVSbSdSgtF">setShadowOpacity(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the shadow opacity for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setShadowOpacity</span><span class="p">(</span><span class="n">_</span> <span class="nv">opacity</span><span class="p">:</span> <span class="kt">Float</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>opacity</em>
</code>
</td>
<td>
<div>
<p>shadow opacity of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that shadow opacity applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in shadow opacity should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC15setShadowRadius_3for8animated17animationDurationy12CoreGraphics7CGFloatV_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setShadowRadius(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC15setShadowRadius_3for8animated17animationDurationy12CoreGraphics7CGFloatV_So14UIControlStateVSbSdSgtF">setShadowRadius(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the shadow radius for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setShadowRadius</span><span class="p">(</span><span class="n">_</span> <span class="nv">radius</span><span class="p">:</span> <span class="kt">CGFloat</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>radius</em>
</code>
</td>
<td>
<div>
<p>shadow radius of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that shadow radius applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in shadow radius should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC15setShadowOffset_3for8animated17animationDurationySo6CGSizeV_So14UIControlStateVSbSdSgtF"></a>
<a name="//apple_ref/swift/Method/setShadowOffset(_:for:animated:animationDuration:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC15setShadowOffset_3for8animated17animationDurationySo6CGSizeV_So14UIControlStateVSbSdSgtF">setShadowOffset(_:for:animated:animationDuration:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the shadow offset for a specific <code>UIControlState</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setShadowOffset</span><span class="p">(</span><span class="n">_</span> <span class="nv">offset</span><span class="p">:</span> <span class="kt">CGSize</span><span class="p">,</span> <span class="k">for</span> <span class="nv">state</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span> <span class="o">=</span> <span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">animationDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>offset</em>
</code>
</td>
<td>
<div>
<p>shadow offset of button</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>state</em>
</code>
</td>
<td>
<div>
<p>determines at which state that shadow offset applies</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animated</em>
</code>
</td>
<td>
<div>
<p>determines if that change in shadow offset should animate. Default is <code>true</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>animationDuration</em>
</code>
</td>
<td>
<div>
<p>set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from <code><a href="../Classes/SimpleButton.html#/s:12SimpleButtonAAC24defaultAnimationDurationSdvp">defaultAnimationDuration</a></code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButtonAAC20setTitleImageSpacingyy12CoreGraphics7CGFloatVF"></a>
<a name="//apple_ref/swift/Method/setTitleImageSpacing(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButtonAAC20setTitleImageSpacingyy12CoreGraphics7CGFloatVF">setTitleImageSpacing(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the spacing between <code>titleLabel</code> and <code>imageView</code></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">setTitleImageSpacing</span><span class="p">(</span><span class="n">_</span> <span class="nv">spacing</span><span class="p">:</span> <span class="kt">CGFloat</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>spacing</em>
</code>
</td>
<td>
<div>
<p>spacing between <code>titleLabel</code> and <code>imageView</code></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Layout"></a>
<a name="//apple_ref/swift/Section/Layout" class="dashAnchor"></a>
<a href="#/Layout">
<h3 class="section-name">Layout</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton(im)layoutSubviews"></a>
<a name="//apple_ref/swift/Method/layoutSubviews()" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton(im)layoutSubviews">layoutSubviews()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">override</span> <span class="kd">open</span> <span class="kd">func</span> <span class="nf">layoutSubviews</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2018 <a class="link" href="https://github.com/aloco/SimpleButton" target="_blank" rel="external">Andreas Tinoco Lobo</a>. All rights reserved. (Last updated: 2018-12-29)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
================================================
FILE: docs/Classes.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classes Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Section/Classes" class="dashAnchor"></a>
<a title="Classes Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SimpleButton Docs</a> (65% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">SimpleButton Reference</a>
<img id="carat" src="img/carat.png" />
Classes Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/SimpleButton.html">SimpleButton</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Structs/SimpleButtonControlState.html">SimpleButtonControlState</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Classes</h1>
<p>The following classes are available globally.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/c:@M@SimpleButton@objc(cs)SimpleButton"></a>
<a name="//apple_ref/swift/Class/SimpleButton" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SimpleButton@objc(cs)SimpleButton">SimpleButton</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<a href="Classes/SimpleButton.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">SimpleButton</span> <span class="p">:</span> <span class="kt">UIButton</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2018 <a class="link" href="https://github.com/aloco/SimpleButton" target="_blank" rel="external">Andreas Tinoco Lobo</a>. All rights reserved. (Last updated: 2018-12-29)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
================================================
FILE: docs/Structs/SimpleButtonControlState.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<title>SimpleButtonControlState Structure Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Struct/SimpleButtonControlState" class="dashAnchor"></a>
<a title="SimpleButtonControlState Structure Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SimpleButton Docs</a> (65% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SimpleButton Reference</a>
<img id="carat" src="../img/carat.png" />
SimpleButtonControlState Structure Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/SimpleButton.html">SimpleButton</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/SimpleButtonControlState.html">SimpleButtonControlState</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>SimpleButtonControlState</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SimpleButtonControlState</span></code></pre>
</div>
</div>
<p>Custom SimpleButton control state</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:12SimpleButton0aB12ControlStateV7loadingSo09UIControlD0VvpZ"></a>
<a name="//apple_ref/swift/Variable/loading" class="dashAnchor"></a>
<a class="token" href="#/s:12SimpleButton0aB12ControlStateV7loadingSo09UIControlD0VvpZ">loading</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Indicates loading state of SimpleButton</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">loading</span><span class="p">:</span> <span class="kt">UIControl</span><span class="o">.</span><span class="kt">State</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2018 <a class="link" href="https://github.com/aloco/SimpleButton" target="_blank" rel="external">Andreas Tinoco Lobo</a>. All rights reserved. (Last updated: 2018-12-29)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
================================================
FILE: docs/Structs.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<title>Structures Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Section/Structures" class="dashAnchor"></a>
<a title="Structures Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SimpleButton Docs</a> (65% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">SimpleButton Reference</a>
<img id="carat" src="img/carat.png" />
Structures Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/
gitextract_06_t_g1y/
├── .gitignore
├── .travis.yml
├── Example/
│ ├── AppDelegate.swift
│ ├── Base.lproj/
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── CustomButtons.swift
│ ├── DesignableButton.swift
│ ├── Images.xcassets/
│ │ ├── AppIcon.appiconset/
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ └── garten.imageset/
│ │ └── Contents.json
│ ├── Info.plist
│ ├── UIColorExtensions.swift
│ └── ViewController.swift
├── Example.xcodeproj/
│ ├── project.pbxproj
│ ├── project.xcworkspace/
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata/
│ └── xcschemes/
│ ├── SimpleButton.xcscheme
│ └── SimpleButtonTests.xcscheme
├── LICENSE
├── Package.swift
├── README.md
├── SimpleButton/
│ ├── Info.plist
│ ├── SimpleButton.h
│ ├── SimpleButton.swift
│ ├── SimpleButtonControlState.swift
│ └── SimpleButtonStateChangeValue.swift
├── SimpleButton.podspec
├── SimpleButtonTests/
│ ├── Info.plist
│ └── SimpleButtonTests.swift
└── docs/
├── Classes/
│ └── SimpleButton.html
├── Classes.html
├── Structs/
│ └── SimpleButtonControlState.html
├── Structs.html
├── css/
│ ├── highlight.css
│ └── jazzy.css
├── docsets/
│ ├── SimpleButton.docset/
│ │ └── Contents/
│ │ ├── Info.plist
│ │ └── Resources/
│ │ ├── Documents/
│ │ │ ├── Classes/
│ │ │ │ └── SimpleButton.html
│ │ │ ├── Classes.html
│ │ │ ├── Structs/
│ │ │ │ └── SimpleButtonControlState.html
│ │ │ ├── Structs.html
│ │ │ ├── css/
│ │ │ │ ├── highlight.css
│ │ │ │ └── jazzy.css
│ │ │ ├── index.html
│ │ │ ├── js/
│ │ │ │ └── jazzy.js
│ │ │ ├── search.json
│ │ │ └── swift_output/
│ │ │ ├── Classes/
│ │ │ │ └── SimpleButton.html
│ │ │ ├── Classes.html
│ │ │ ├── Structs/
│ │ │ │ └── SimpleButtonControlState.html
│ │ │ ├── Structs.html
│ │ │ ├── css/
│ │ │ │ ├── highlight.css
│ │ │ │ └── jazzy.css
│ │ │ ├── docsets/
│ │ │ │ ├── SimpleButton.docset/
│ │ │ │ │ └── Contents/
│ │ │ │ │ ├── Info.plist
│ │ │ │ │ └── Resources/
│ │ │ │ │ ├── Documents/
│ │ │ │ │ │ ├── Classes/
│ │ │ │ │ │ │ └── SimpleButton.html
│ │ │ │ │ │ ├── Classes.html
│ │ │ │ │ │ ├── Structs/
│ │ │ │ │ │ │ └── SimpleButtonControlState.html
│ │ │ │ │ │ ├── Structs.html
│ │ │ │ │ │ ├── css/
│ │ │ │ │ │ │ ├── highlight.css
│ │ │ │ │ │ │ └── jazzy.css
│ │ │ │ │ │ ├── index.html
│ │ │ │ │ │ ├── js/
│ │ │ │ │ │ │ └── jazzy.js
│ │ │ │ │ │ └── search.json
│ │ │ │ │ └── docSet.dsidx
│ │ │ │ ├── SimpleButton.tgz
│ │ │ │ └── SimpleButton.xml
│ │ │ ├── index.html
│ │ │ ├── js/
│ │ │ │ └── jazzy.js
│ │ │ ├── search.json
│ │ │ └── undocumented.json
│ │ └── docSet.dsidx
│ └── SimpleButton.tgz
├── index.html
├── js/
│ └── jazzy.js
├── search.json
├── swift_output/
│ ├── Classes/
│ │ └── SimpleButton.html
│ ├── Classes.html
│ ├── Structs/
│ │ └── SimpleButtonControlState.html
│ ├── Structs.html
│ ├── css/
│ │ ├── highlight.css
│ │ └── jazzy.css
│ ├── docsets/
│ │ ├── SimpleButton.docset/
│ │ │ └── Contents/
│ │ │ ├── Info.plist
│ │ │ └── Resources/
│ │ │ ├── Documents/
│ │ │ │ ├── Classes/
│ │ │ │ │ └── SimpleButton.html
│ │ │ │ ├── Classes.html
│ │ │ │ ├── Structs/
│ │ │ │ │ └── SimpleButtonControlState.html
│ │ │ │ ├── Structs.html
│ │ │ │ ├── css/
│ │ │ │ │ ├── highlight.css
│ │ │ │ │ └── jazzy.css
│ │ │ │ ├── index.html
│ │ │ │ ├── js/
│ │ │ │ │ └── jazzy.js
│ │ │ │ └── search.json
│ │ │ └── docSet.dsidx
│ │ ├── SimpleButton.tgz
│ │ └── SimpleButton.xml
│ ├── index.html
│ ├── js/
│ │ └── jazzy.js
│ ├── search.json
│ └── undocumented.json
└── undocumented.json
Condensed preview — 97 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (883K chars).
[
{
"path": ".gitignore",
"chars": 257,
"preview": "# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!defau"
},
{
"path": ".travis.yml",
"chars": 363,
"preview": "language: objective-c\nosx_image: xcode10\nscript:\n # The pipefail option sets the exit status to the last commond with a"
},
{
"path": "Example/AppDelegate.swift",
"chars": 2186,
"preview": "//\n// AppDelegate.swift\n// Example\n//\n// Created by Andreas Tinoco Lobo on 25.03.15.\n// Copyright (c) 2015 Andreas T"
},
{
"path": "Example/Base.lproj/LaunchScreen.xib",
"chars": 1245,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" versi"
},
{
"path": "Example/Base.lproj/Main.storyboard",
"chars": 19921,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3"
},
{
"path": "Example/CustomButtons.swift",
"chars": 4581,
"preview": "//\n// CustomButtons.swift\n// Example\n//\n// Created by Andreas Tinoco Lobo on 08.04.15.\n// Copyright (c) 2015 Andreas"
},
{
"path": "Example/DesignableButton.swift",
"chars": 1699,
"preview": "//\n// DesignableButton.swift\n// Example\n//\n// Created by Gunter Hager on 03.06.16.\n// Copyright © 2016 all about app"
},
{
"path": "Example/Images.xcassets/AppIcon.appiconset/Contents.json",
"chars": 1590,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"20x20\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\""
},
{
"path": "Example/Images.xcassets/Contents.json",
"chars": 63,
"preview": "{\n \"info\" : {\n \"author\" : \"xcode\",\n \"version\" : 1\n }\n}\n"
},
{
"path": "Example/Images.xcassets/garten.imageset/Contents.json",
"chars": 304,
"preview": "{\n \"images\" : [\n {\n \"filename\" : \"garten.png\",\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "Example/Info.plist",
"chars": 1495,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "Example/UIColorExtensions.swift",
"chars": 2116,
"preview": "//\n// UIColorExtensions.swift\n//\n// Created by Mihails Tumkins on 10/02/15.\n//\n\nimport UIKit\n\nextension UIColor {\n "
},
{
"path": "Example/ViewController.swift",
"chars": 1216,
"preview": "//\n// ViewController.swift\n// Example\n//\n// Created by Andreas Tinoco Lobo on 12/11/15.\n// Copyright © 2015 Andreas "
},
{
"path": "Example.xcodeproj/project.pbxproj",
"chars": 27420,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 152,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:Example.xcodepr"
},
{
"path": "Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
"chars": 238,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "Example.xcodeproj/xcshareddata/xcschemes/SimpleButton.xcscheme",
"chars": 3248,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n LastUpgradeVersion = \"1200\"\n version = \"1.3\">\n <BuildAction\n "
},
{
"path": "Example.xcodeproj/xcshareddata/xcschemes/SimpleButtonTests.xcscheme",
"chars": 3233,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n LastUpgradeVersion = \"1200\"\n version = \"1.3\">\n <BuildAction\n "
},
{
"path": "LICENSE",
"chars": 1085,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Andreas Tinoco Lobo\n\nPermission is hereby granted, free of charge, to any pers"
},
{
"path": "Package.swift",
"chars": 399,
"preview": "// swift-tools-version:5.0\n\nimport PackageDescription\n\nlet package = Package(\n name: \"SimpleButton\",\n platforms: ["
},
{
"path": "README.md",
"chars": 4355,
"preview": "# SimpleButton\n\n\n[![Build "
},
{
"path": "SimpleButton/Info.plist",
"chars": 806,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "SimpleButton/SimpleButton.h",
"chars": 535,
"preview": "//\n// SimpleButton.h\n// SimpleButton\n//\n// Created by Andreas Tinoco Lobo on 25.03.15.\n// Copyright (c) 2015 Andreas"
},
{
"path": "SimpleButton/SimpleButton.swift",
"chars": 23366,
"preview": "//\n// SimpleButton.swift\n// Example\n//\n// Created by Andreas Tinoco Lobo on 25.03.15.\n// Copyright (c) 2015 Andreas "
},
{
"path": "SimpleButton/SimpleButtonControlState.swift",
"chars": 403,
"preview": "//\n// SimpleButtonControlState.swift\n// Example\n//\n// Created by Andreas Tinoco Lobo on 03/11/15.\n// Copyright © 201"
},
{
"path": "SimpleButton/SimpleButtonStateChangeValue.swift",
"chars": 409,
"preview": "//\n// SimpleButtonStateChangeValue.swift\n// Example\n//\n// Created by Andreas Tinoco Lobo on 03/11/15.\n// Copyright ©"
},
{
"path": "SimpleButton.podspec",
"chars": 852,
"preview": "Pod::Spec.new do |s|\n s.name = \"SimpleButton\"\n s.version = \"4.0.1\"\n s.summary "
},
{
"path": "SimpleButtonTests/Info.plist",
"chars": 733,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "SimpleButtonTests/SimpleButtonTests.swift",
"chars": 11796,
"preview": "//\n// SimpleButtonTests.swift\n// SimpleButtonTests\n//\n// Created by Alexander Schuch on 14/04/15.\n// Copyright (c) 2"
},
{
"path": "docs/Classes/SimpleButton.html",
"chars": 69921,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Class Reference</title>\n <link rel=\"stylesheet\" typ"
},
{
"path": "docs/Classes.html",
"chars": 3884,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Classes Reference</title>\n <link rel=\"stylesheet\" type=\"text/cs"
},
{
"path": "docs/Structs/SimpleButtonControlState.html",
"chars": 4363,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButtonControlState Structure Reference</title>\n <link rel="
},
{
"path": "docs/Structs.html",
"chars": 3909,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Structures Reference</title>\n <link rel=\"stylesheet\" type=\"text"
},
{
"path": "docs/css/highlight.css",
"chars": 4479,
"preview": "/* Credit to https://gist.github.com/wataru420/2048287 */\n.highlight {\n /* Comment */\n /* Error */\n /* Keyword */\n /"
},
{
"path": "docs/css/jazzy.css",
"chars": 6715,
"preview": "html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {\n background: transparent;\n bord"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Info.plist",
"chars": 629,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/Classes/SimpleButton.html",
"chars": 69921,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Class Reference</title>\n <link rel=\"stylesheet\" typ"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/Classes.html",
"chars": 3884,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Classes Reference</title>\n <link rel=\"stylesheet\" type=\"text/cs"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/Structs/SimpleButtonControlState.html",
"chars": 4363,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButtonControlState Structure Reference</title>\n <link rel="
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/Structs.html",
"chars": 3909,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Structures Reference</title>\n <link rel=\"stylesheet\" type=\"text"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/css/highlight.css",
"chars": 4479,
"preview": "/* Credit to https://gist.github.com/wataru420/2048287 */\n.highlight {\n /* Comment */\n /* Error */\n /* Keyword */\n /"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/css/jazzy.css",
"chars": 6715,
"preview": "html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {\n background: transparent;\n bord"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/index.html",
"chars": 11866,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Reference</title>\n <link rel=\"stylesheet\" type=\"te"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/js/jazzy.js",
"chars": 1395,
"preview": "window.jazzy = {'docset': false}\nif (typeof window.dash != 'undefined') {\n document.documentElement.className += ' dash"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/search.json",
"chars": 6280,
"preview": "{\"Structs/SimpleButtonControlState.html#/s:12SimpleButton0aB12ControlStateV7loadingSo09UIControlD0VvpZ\":{\"name\":\"loading"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/Classes/SimpleButton.html",
"chars": 75529,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Class Reference</title>\n <link rel=\"stylesheet\" typ"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/Classes.html",
"chars": 4440,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Classes Reference</title>\n <link rel=\"stylesheet\" type=\"text/cs"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/Structs/SimpleButtonControlState.html",
"chars": 4932,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButtonControlState Structure Reference</title>\n <link rel="
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/Structs.html",
"chars": 4476,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Structures Reference</title>\n <link rel=\"stylesheet\" type=\"text"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/css/highlight.css",
"chars": 4479,
"preview": "/* Credit to https://gist.github.com/wataru420/2048287 */\n.highlight {\n /* Comment */\n /* Error */\n /* Keyword */\n /"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/css/jazzy.css",
"chars": 6715,
"preview": "html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {\n background: transparent;\n bord"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Info.plist",
"chars": 629,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/Classes/SimpleButton.html",
"chars": 75529,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Class Reference</title>\n <link rel=\"stylesheet\" typ"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/Classes.html",
"chars": 4440,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Classes Reference</title>\n <link rel=\"stylesheet\" type=\"text/cs"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/Structs/SimpleButtonControlState.html",
"chars": 4932,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButtonControlState Structure Reference</title>\n <link rel="
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/Structs.html",
"chars": 4476,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Structures Reference</title>\n <link rel=\"stylesheet\" type=\"text"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/css/highlight.css",
"chars": 4479,
"preview": "/* Credit to https://gist.github.com/wataru420/2048287 */\n.highlight {\n /* Comment */\n /* Error */\n /* Keyword */\n /"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/css/jazzy.css",
"chars": 6715,
"preview": "html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {\n background: transparent;\n bord"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/index.html",
"chars": 12193,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Reference</title>\n <link rel=\"stylesheet\" type=\"te"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/js/jazzy.js",
"chars": 1395,
"preview": "window.jazzy = {'docset': false}\nif (typeof window.dash != 'undefined') {\n document.documentElement.className += ' dash"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/search.json",
"chars": 6280,
"preview": "{\"Structs/SimpleButtonControlState.html#/s:12SimpleButton0aB12ControlStateV7loadingSo09UIControlD0VvpZ\":{\"name\":\"loading"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/docsets/SimpleButton.xml",
"chars": 130,
"preview": "<entry><version>4.0</version><url>https://github.com/aloco/SimpleButton/tree/swift-4.0/api/docsets/SimpleButton.tgz</url"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/index.html",
"chars": 12193,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Reference</title>\n <link rel=\"stylesheet\" type=\"te"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/js/jazzy.js",
"chars": 1395,
"preview": "window.jazzy = {'docset': false}\nif (typeof window.dash != 'undefined') {\n document.documentElement.className += ' dash"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/search.json",
"chars": 6280,
"preview": "{\"Structs/SimpleButtonControlState.html#/s:12SimpleButton0aB12ControlStateV7loadingSo09UIControlD0VvpZ\":{\"name\":\"loading"
},
{
"path": "docs/docsets/SimpleButton.docset/Contents/Resources/Documents/swift_output/undocumented.json",
"chars": 2615,
"preview": "{\n \"warnings\": [\n {\n \"file\": \"/Users/andreastinocolobo/Applications/iOS/SimpleButton/SimpleButton/SimpleButton."
},
{
"path": "docs/index.html",
"chars": 11866,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Reference</title>\n <link rel=\"stylesheet\" type=\"te"
},
{
"path": "docs/js/jazzy.js",
"chars": 1395,
"preview": "window.jazzy = {'docset': false}\nif (typeof window.dash != 'undefined') {\n document.documentElement.className += ' dash"
},
{
"path": "docs/search.json",
"chars": 6280,
"preview": "{\"Structs/SimpleButtonControlState.html#/s:12SimpleButton0aB12ControlStateV7loadingSo09UIControlD0VvpZ\":{\"name\":\"loading"
},
{
"path": "docs/swift_output/Classes/SimpleButton.html",
"chars": 75529,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Class Reference</title>\n <link rel=\"stylesheet\" typ"
},
{
"path": "docs/swift_output/Classes.html",
"chars": 4440,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Classes Reference</title>\n <link rel=\"stylesheet\" type=\"text/cs"
},
{
"path": "docs/swift_output/Structs/SimpleButtonControlState.html",
"chars": 4932,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButtonControlState Structure Reference</title>\n <link rel="
},
{
"path": "docs/swift_output/Structs.html",
"chars": 4476,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Structures Reference</title>\n <link rel=\"stylesheet\" type=\"text"
},
{
"path": "docs/swift_output/css/highlight.css",
"chars": 4479,
"preview": "/* Credit to https://gist.github.com/wataru420/2048287 */\n.highlight {\n /* Comment */\n /* Error */\n /* Keyword */\n /"
},
{
"path": "docs/swift_output/css/jazzy.css",
"chars": 6715,
"preview": "html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {\n background: transparent;\n bord"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Info.plist",
"chars": 629,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/Classes/SimpleButton.html",
"chars": 75529,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Class Reference</title>\n <link rel=\"stylesheet\" typ"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/Classes.html",
"chars": 4440,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Classes Reference</title>\n <link rel=\"stylesheet\" type=\"text/cs"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/Structs/SimpleButtonControlState.html",
"chars": 4932,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButtonControlState Structure Reference</title>\n <link rel="
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/Structs.html",
"chars": 4476,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Structures Reference</title>\n <link rel=\"stylesheet\" type=\"text"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/css/highlight.css",
"chars": 4479,
"preview": "/* Credit to https://gist.github.com/wataru420/2048287 */\n.highlight {\n /* Comment */\n /* Error */\n /* Keyword */\n /"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/css/jazzy.css",
"chars": 6715,
"preview": "html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {\n background: transparent;\n bord"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/index.html",
"chars": 12193,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Reference</title>\n <link rel=\"stylesheet\" type=\"te"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/js/jazzy.js",
"chars": 1395,
"preview": "window.jazzy = {'docset': false}\nif (typeof window.dash != 'undefined') {\n document.documentElement.className += ' dash"
},
{
"path": "docs/swift_output/docsets/SimpleButton.docset/Contents/Resources/Documents/search.json",
"chars": 6280,
"preview": "{\"Structs/SimpleButtonControlState.html#/s:12SimpleButton0aB12ControlStateV7loadingSo09UIControlD0VvpZ\":{\"name\":\"loading"
},
{
"path": "docs/swift_output/docsets/SimpleButton.xml",
"chars": 130,
"preview": "<entry><version>4.0</version><url>https://github.com/aloco/SimpleButton/tree/swift-4.0/api/docsets/SimpleButton.tgz</url"
},
{
"path": "docs/swift_output/index.html",
"chars": 12193,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>SimpleButton Reference</title>\n <link rel=\"stylesheet\" type=\"te"
},
{
"path": "docs/swift_output/js/jazzy.js",
"chars": 1395,
"preview": "window.jazzy = {'docset': false}\nif (typeof window.dash != 'undefined') {\n document.documentElement.className += ' dash"
},
{
"path": "docs/swift_output/search.json",
"chars": 6280,
"preview": "{\"Structs/SimpleButtonControlState.html#/s:12SimpleButton0aB12ControlStateV7loadingSo09UIControlD0VvpZ\":{\"name\":\"loading"
},
{
"path": "docs/swift_output/undocumented.json",
"chars": 2615,
"preview": "{\n \"warnings\": [\n {\n \"file\": \"/Users/andreastinocolobo/Applications/iOS/SimpleButton/SimpleButton/SimpleButton."
},
{
"path": "docs/undocumented.json",
"chars": 2615,
"preview": "{\n \"warnings\": [\n {\n \"file\": \"/Users/andreastinocolobo/Applications/iOS/SimpleButton/SimpleButton/SimpleButton."
}
]
// ... and 6 more files (download for full content)
About this extraction
This page contains the full source code of the aloco/SimpleButton GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 97 files (813.9 KB), approximately 202.2k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.