├── .gitignore ├── LICENSE ├── README.md ├── SSRadioButtonController ├── SSRadioButton.swift └── SSRadioButtonsController.swift ├── SampleProject ├── SampleProject.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── SampleProject │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift └── SampleProjectTests │ ├── Info.plist │ └── SampleProjectTests.swift └── demoRadioButtons.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | .DS_Store 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 S Shahid 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SSRadioButtonsController 2 | A Radio Button Controller class for iOS written in Swift. (Now ported to Swift2) 3 | All you need to do is to create an `SSRadioButtonController` object and add your `UIButton`s to it. It will automatically handle selecting and deselecting without interfering with your own implementations. 4 | If you want your buttons to have a radioButton circle next to them, use the custom class `SSRadioButton`. 5 | 6 | ![Demo](https://github.com/shamasshahid/SSRadioButtonsController/blob/master/demoRadioButtons.gif?raw=true) 7 | 8 | ###Sample Code 9 | Sample code would look like this 10 | 11 | ``` 12 | var radioButtonController = SSRadioButtonsController(buttons: button1, button2, button3) 13 | ``` 14 | 15 | ### SSRadioButtonControllerDelegate 16 | Implement the optional function `didSelectButton`of delegate to get selected button object. If `shouldLetDeSelect` is set to true, on deselecting a selected button the value passed in optional parameter is nil. 17 | 18 | ### Get currently selected button 19 | To get the currently selected button, you can use 20 | 21 | ``` 22 | var currentButton = radioButtonController.selectedButton() 23 | ``` 24 | 25 | ### Add or Remove buttons 26 | You can add/remove buttons from controller by 27 | 28 | ``` 29 | radioButtonController.addButton(button1!) 30 | radioButtonController.removeButton(button3!) 31 | ``` 32 | -------------------------------------------------------------------------------- /SSRadioButtonController/SSRadioButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SSRadioButton.swift 3 | // SampleProject 4 | // 5 | // Created by Shamas on 18/05/2015. 6 | // Copyright (c) 2015 Al Shamas Tufail. All rights reserved. 7 | // with circle stroke attribute 8 | 9 | import Foundation 10 | import UIKit 11 | @IBDesignable 12 | 13 | class SSRadioButton: UIButton { 14 | 15 | fileprivate var circleLayer = CAShapeLayer() 16 | fileprivate var fillCircleLayer = CAShapeLayer() 17 | override var isSelected: Bool { 18 | didSet { 19 | toggleButon() 20 | } 21 | } 22 | /** 23 | Color of the radio button circle. Default value is UIColor red. 24 | */ 25 | @IBInspectable var circleColor: UIColor = UIColor.red { 26 | didSet { 27 | circleLayer.strokeColor = strokeColor.cgColor 28 | self.toggleButon() 29 | } 30 | } 31 | 32 | /** 33 | Color of the radio button stroke circle. Default value is UIColor red. 34 | */ 35 | @IBInspectable var strokeColor: UIColor = UIColor.gray { 36 | didSet { 37 | circleLayer.strokeColor = strokeColor.cgColor 38 | self.toggleButon() 39 | } 40 | } 41 | 42 | /** 43 | Radius of RadioButton circle. 44 | */ 45 | @IBInspectable var circleRadius: CGFloat = 5.0 46 | @IBInspectable var cornerRadius: CGFloat { 47 | get { 48 | return layer.cornerRadius 49 | } 50 | set { 51 | layer.cornerRadius = newValue 52 | layer.masksToBounds = newValue > 0 53 | } 54 | } 55 | 56 | fileprivate func circleFrame() -> CGRect { 57 | var circleFrame = CGRect(x: 0, y: 0, width: 2*circleRadius, height: 2*circleRadius) 58 | circleFrame.origin.x = 0 + circleLayer.lineWidth 59 | circleFrame.origin.y = bounds.height/2 - circleFrame.height/2 60 | return circleFrame 61 | } 62 | 63 | required init?(coder aDecoder: NSCoder) { 64 | super.init(coder: aDecoder) 65 | initialize() 66 | } 67 | 68 | override init(frame: CGRect) { 69 | super.init(frame: frame) 70 | initialize() 71 | } 72 | 73 | fileprivate func initialize() { 74 | circleLayer.frame = bounds 75 | circleLayer.lineWidth = 2 76 | circleLayer.fillColor = UIColor.clear.cgColor 77 | circleLayer.strokeColor = strokeColor.cgColor 78 | layer.addSublayer(circleLayer) 79 | fillCircleLayer.frame = bounds 80 | fillCircleLayer.lineWidth = 2 81 | fillCircleLayer.fillColor = UIColor.clear.cgColor 82 | fillCircleLayer.strokeColor = UIColor.clear.cgColor 83 | layer.addSublayer(fillCircleLayer) 84 | self.titleEdgeInsets = UIEdgeInsetsMake(0, (4*circleRadius + 4*circleLayer.lineWidth), 0, 0) 85 | self.toggleButon() 86 | } 87 | /** 88 | Toggles selected state of the button. 89 | */ 90 | func toggleButon() { 91 | if self.isSelected { 92 | fillCircleLayer.fillColor = circleColor.cgColor 93 | circleLayer.strokeColor = circleColor.cgColor 94 | } else { 95 | fillCircleLayer.fillColor = UIColor.clear.cgColor 96 | circleLayer.strokeColor = strokeColor.cgColor 97 | } 98 | } 99 | 100 | fileprivate func circlePath() -> UIBezierPath { 101 | return UIBezierPath(ovalIn: circleFrame()) 102 | } 103 | 104 | fileprivate func fillCirclePath() -> UIBezierPath { 105 | return UIBezierPath(ovalIn: circleFrame().insetBy(dx: 2, dy: 2)) 106 | } 107 | 108 | override func layoutSubviews() { 109 | super.layoutSubviews() 110 | circleLayer.frame = bounds 111 | circleLayer.path = circlePath().cgPath 112 | fillCircleLayer.frame = bounds 113 | fillCircleLayer.path = fillCirclePath().cgPath 114 | self.titleEdgeInsets = UIEdgeInsetsMake(0, (2*circleRadius + 4*circleLayer.lineWidth), 0, 0) 115 | } 116 | 117 | override func prepareForInterfaceBuilder() { 118 | initialize() 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /SSRadioButtonController/SSRadioButtonsController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RadioButtonsController.swift 3 | // TestApp 4 | // 5 | // Created by Al Shamas Tufail on 24/03/2015. 6 | // Copyright (c) 2015 Al Shamas Tufail. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | /// RadioButtonControllerDelegate. Delegate optionally implements didSelectButton that receives selected button. 13 | @objc protocol SSRadioButtonControllerDelegate { 14 | /** 15 | This function is called when a button is selected. If 'shouldLetDeSelect' is true, and a button is deselected, this function 16 | is called with a nil. 17 | 18 | */ 19 | @objc func didSelectButton(selectedButton: UIButton?) 20 | } 21 | 22 | class SSRadioButtonsController : NSObject 23 | { 24 | fileprivate var buttonsArray = [UIButton]() 25 | weak var delegate : SSRadioButtonControllerDelegate? = nil 26 | /** 27 | Set whether a selected radio button can be deselected or not. Default value is false. 28 | */ 29 | var shouldLetDeSelect = false 30 | /** 31 | Variadic parameter init that accepts UIButtons. 32 | 33 | - parameter buttons: Buttons that should behave as Radio Buttons 34 | */ 35 | init(buttons: UIButton...) { 36 | super.init() 37 | for aButton in buttons { 38 | aButton.addTarget(self, action: #selector(SSRadioButtonsController.pressed(_:)), for: UIControlEvents.touchUpInside) 39 | } 40 | self.buttonsArray = buttons 41 | } 42 | /** 43 | Add a UIButton to Controller 44 | 45 | - parameter button: Add the button to controller. 46 | */ 47 | func addButton(_ aButton: UIButton) { 48 | buttonsArray.append(aButton) 49 | aButton.addTarget(self, action: #selector(SSRadioButtonsController.pressed(_:)), for: UIControlEvents.touchUpInside) 50 | } 51 | /** 52 | Remove a UIButton from controller. 53 | 54 | - parameter button: Button to be removed from controller. 55 | */ 56 | func removeButton(_ aButton: UIButton) { 57 | var iteratingButton: UIButton? = nil 58 | if(buttonsArray.contains(aButton)) 59 | { 60 | iteratingButton = aButton 61 | } 62 | if(iteratingButton != nil) { 63 | buttonsArray.remove(at: buttonsArray.index(of: iteratingButton!)!) 64 | iteratingButton!.removeTarget(self, action: #selector(SSRadioButtonsController.pressed(_:)), for: UIControlEvents.touchUpInside) 65 | iteratingButton!.isSelected = false 66 | } 67 | } 68 | /** 69 | Set an array of UIButons to behave as controller. 70 | 71 | - parameter buttonArray: Array of buttons 72 | */ 73 | func setButtonsArray(_ aButtonsArray: [UIButton]) { 74 | for aButton in aButtonsArray { 75 | aButton.addTarget(self, action: #selector(SSRadioButtonsController.pressed(_:)), for: UIControlEvents.touchUpInside) 76 | } 77 | buttonsArray = aButtonsArray 78 | } 79 | 80 | func pressed(_ sender: UIButton) { 81 | var currentSelectedButton: UIButton? = nil 82 | if(sender.isSelected) { 83 | if shouldLetDeSelect { 84 | sender.isSelected = false 85 | currentSelectedButton = nil 86 | } 87 | } else { 88 | for aButton in buttonsArray { 89 | aButton.isSelected = false 90 | } 91 | sender.isSelected = true 92 | currentSelectedButton = sender 93 | } 94 | delegate?.didSelectButton(selectedButton: currentSelectedButton) 95 | } 96 | /** 97 | Get the currently selected button. 98 | 99 | - returns: Currenlty selected button. 100 | */ 101 | func selectedButton() -> UIButton? { 102 | guard let index = buttonsArray.index(where: { button in button.isSelected }) else { return nil } 103 | 104 | return buttonsArray[index] 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /SampleProject/SampleProject.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A7373771B09218100CB5FBC /* SSRadioButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A7373761B09218100CB5FBC /* SSRadioButton.swift */; }; 11 | 2D5074421AC546BB005AD163 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D5074411AC546BB005AD163 /* AppDelegate.swift */; }; 12 | 2D5074441AC546BB005AD163 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D5074431AC546BB005AD163 /* ViewController.swift */; }; 13 | 2D5074471AC546BB005AD163 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2D5074451AC546BB005AD163 /* Main.storyboard */; }; 14 | 2D5074491AC546BB005AD163 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5074481AC546BB005AD163 /* Images.xcassets */; }; 15 | 2D50744C1AC546BB005AD163 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D50744A1AC546BB005AD163 /* LaunchScreen.xib */; }; 16 | 2D5074581AC546BB005AD163 /* SampleProjectTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D5074571AC546BB005AD163 /* SampleProjectTests.swift */; }; 17 | 2D5074631AC54740005AD163 /* SSRadioButtonsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D5074621AC54740005AD163 /* SSRadioButtonsController.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 2D5074521AC546BB005AD163 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 2D5074341AC546BB005AD163 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 2D50743B1AC546BB005AD163; 26 | remoteInfo = SampleProject; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 1A7373761B09218100CB5FBC /* SSRadioButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSRadioButton.swift; sourceTree = ""; }; 32 | 2D50743C1AC546BB005AD163 /* SampleProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 2D5074401AC546BB005AD163 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 2D5074411AC546BB005AD163 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 35 | 2D5074431AC546BB005AD163 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 36 | 2D5074461AC546BB005AD163 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 37 | 2D5074481AC546BB005AD163 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 38 | 2D50744B1AC546BB005AD163 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 39 | 2D5074511AC546BB005AD163 /* SampleProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 2D5074561AC546BB005AD163 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | 2D5074571AC546BB005AD163 /* SampleProjectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleProjectTests.swift; sourceTree = ""; }; 42 | 2D5074621AC54740005AD163 /* SSRadioButtonsController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSRadioButtonsController.swift; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 2D5074391AC546BB005AD163 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | 2D50744E1AC546BB005AD163 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | 2D5074331AC546BB005AD163 = { 64 | isa = PBXGroup; 65 | children = ( 66 | 2D5074611AC54740005AD163 /* SSRadioButtonController */, 67 | 2D50743E1AC546BB005AD163 /* SampleProject */, 68 | 2D5074541AC546BB005AD163 /* SampleProjectTests */, 69 | 2D50743D1AC546BB005AD163 /* Products */, 70 | ); 71 | sourceTree = ""; 72 | }; 73 | 2D50743D1AC546BB005AD163 /* Products */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 2D50743C1AC546BB005AD163 /* SampleProject.app */, 77 | 2D5074511AC546BB005AD163 /* SampleProjectTests.xctest */, 78 | ); 79 | name = Products; 80 | sourceTree = ""; 81 | }; 82 | 2D50743E1AC546BB005AD163 /* SampleProject */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 2D5074411AC546BB005AD163 /* AppDelegate.swift */, 86 | 2D5074431AC546BB005AD163 /* ViewController.swift */, 87 | 2D5074451AC546BB005AD163 /* Main.storyboard */, 88 | 2D5074481AC546BB005AD163 /* Images.xcassets */, 89 | 2D50744A1AC546BB005AD163 /* LaunchScreen.xib */, 90 | 2D50743F1AC546BB005AD163 /* Supporting Files */, 91 | ); 92 | path = SampleProject; 93 | sourceTree = ""; 94 | }; 95 | 2D50743F1AC546BB005AD163 /* Supporting Files */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 2D5074401AC546BB005AD163 /* Info.plist */, 99 | ); 100 | name = "Supporting Files"; 101 | sourceTree = ""; 102 | }; 103 | 2D5074541AC546BB005AD163 /* SampleProjectTests */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 2D5074571AC546BB005AD163 /* SampleProjectTests.swift */, 107 | 2D5074551AC546BB005AD163 /* Supporting Files */, 108 | ); 109 | path = SampleProjectTests; 110 | sourceTree = ""; 111 | }; 112 | 2D5074551AC546BB005AD163 /* Supporting Files */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 2D5074561AC546BB005AD163 /* Info.plist */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | 2D5074611AC54740005AD163 /* SSRadioButtonController */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 2D5074621AC54740005AD163 /* SSRadioButtonsController.swift */, 124 | 1A7373761B09218100CB5FBC /* SSRadioButton.swift */, 125 | ); 126 | name = SSRadioButtonController; 127 | path = ../SSRadioButtonController; 128 | sourceTree = ""; 129 | }; 130 | /* End PBXGroup section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | 2D50743B1AC546BB005AD163 /* SampleProject */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = 2D50745B1AC546BB005AD163 /* Build configuration list for PBXNativeTarget "SampleProject" */; 136 | buildPhases = ( 137 | 2D5074381AC546BB005AD163 /* Sources */, 138 | 2D5074391AC546BB005AD163 /* Frameworks */, 139 | 2D50743A1AC546BB005AD163 /* Resources */, 140 | ); 141 | buildRules = ( 142 | ); 143 | dependencies = ( 144 | ); 145 | name = SampleProject; 146 | productName = SampleProject; 147 | productReference = 2D50743C1AC546BB005AD163 /* SampleProject.app */; 148 | productType = "com.apple.product-type.application"; 149 | }; 150 | 2D5074501AC546BB005AD163 /* SampleProjectTests */ = { 151 | isa = PBXNativeTarget; 152 | buildConfigurationList = 2D50745E1AC546BB005AD163 /* Build configuration list for PBXNativeTarget "SampleProjectTests" */; 153 | buildPhases = ( 154 | 2D50744D1AC546BB005AD163 /* Sources */, 155 | 2D50744E1AC546BB005AD163 /* Frameworks */, 156 | 2D50744F1AC546BB005AD163 /* Resources */, 157 | ); 158 | buildRules = ( 159 | ); 160 | dependencies = ( 161 | 2D5074531AC546BB005AD163 /* PBXTargetDependency */, 162 | ); 163 | name = SampleProjectTests; 164 | productName = SampleProjectTests; 165 | productReference = 2D5074511AC546BB005AD163 /* SampleProjectTests.xctest */; 166 | productType = "com.apple.product-type.bundle.unit-test"; 167 | }; 168 | /* End PBXNativeTarget section */ 169 | 170 | /* Begin PBXProject section */ 171 | 2D5074341AC546BB005AD163 /* Project object */ = { 172 | isa = PBXProject; 173 | attributes = { 174 | LastSwiftMigration = 0700; 175 | LastSwiftUpdateCheck = 0700; 176 | LastUpgradeCheck = 0800; 177 | ORGANIZATIONNAME = "Al Shamas Tufail"; 178 | TargetAttributes = { 179 | 2D50743B1AC546BB005AD163 = { 180 | CreatedOnToolsVersion = 6.2; 181 | LastSwiftMigration = 0800; 182 | }; 183 | 2D5074501AC546BB005AD163 = { 184 | CreatedOnToolsVersion = 6.2; 185 | LastSwiftMigration = 0800; 186 | TestTargetID = 2D50743B1AC546BB005AD163; 187 | }; 188 | }; 189 | }; 190 | buildConfigurationList = 2D5074371AC546BB005AD163 /* Build configuration list for PBXProject "SampleProject" */; 191 | compatibilityVersion = "Xcode 3.2"; 192 | developmentRegion = English; 193 | hasScannedForEncodings = 0; 194 | knownRegions = ( 195 | en, 196 | Base, 197 | ); 198 | mainGroup = 2D5074331AC546BB005AD163; 199 | productRefGroup = 2D50743D1AC546BB005AD163 /* Products */; 200 | projectDirPath = ""; 201 | projectRoot = ""; 202 | targets = ( 203 | 2D50743B1AC546BB005AD163 /* SampleProject */, 204 | 2D5074501AC546BB005AD163 /* SampleProjectTests */, 205 | ); 206 | }; 207 | /* End PBXProject section */ 208 | 209 | /* Begin PBXResourcesBuildPhase section */ 210 | 2D50743A1AC546BB005AD163 /* Resources */ = { 211 | isa = PBXResourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | 2D5074471AC546BB005AD163 /* Main.storyboard in Resources */, 215 | 2D50744C1AC546BB005AD163 /* LaunchScreen.xib in Resources */, 216 | 2D5074491AC546BB005AD163 /* Images.xcassets in Resources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | 2D50744F1AC546BB005AD163 /* Resources */ = { 221 | isa = PBXResourcesBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | }; 227 | /* End PBXResourcesBuildPhase section */ 228 | 229 | /* Begin PBXSourcesBuildPhase section */ 230 | 2D5074381AC546BB005AD163 /* Sources */ = { 231 | isa = PBXSourcesBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | 2D5074441AC546BB005AD163 /* ViewController.swift in Sources */, 235 | 2D5074421AC546BB005AD163 /* AppDelegate.swift in Sources */, 236 | 2D5074631AC54740005AD163 /* SSRadioButtonsController.swift in Sources */, 237 | 1A7373771B09218100CB5FBC /* SSRadioButton.swift in Sources */, 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | 2D50744D1AC546BB005AD163 /* Sources */ = { 242 | isa = PBXSourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | 2D5074581AC546BB005AD163 /* SampleProjectTests.swift in Sources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | /* End PBXSourcesBuildPhase section */ 250 | 251 | /* Begin PBXTargetDependency section */ 252 | 2D5074531AC546BB005AD163 /* PBXTargetDependency */ = { 253 | isa = PBXTargetDependency; 254 | target = 2D50743B1AC546BB005AD163 /* SampleProject */; 255 | targetProxy = 2D5074521AC546BB005AD163 /* PBXContainerItemProxy */; 256 | }; 257 | /* End PBXTargetDependency section */ 258 | 259 | /* Begin PBXVariantGroup section */ 260 | 2D5074451AC546BB005AD163 /* Main.storyboard */ = { 261 | isa = PBXVariantGroup; 262 | children = ( 263 | 2D5074461AC546BB005AD163 /* Base */, 264 | ); 265 | name = Main.storyboard; 266 | sourceTree = ""; 267 | }; 268 | 2D50744A1AC546BB005AD163 /* LaunchScreen.xib */ = { 269 | isa = PBXVariantGroup; 270 | children = ( 271 | 2D50744B1AC546BB005AD163 /* Base */, 272 | ); 273 | name = LaunchScreen.xib; 274 | sourceTree = ""; 275 | }; 276 | /* End PBXVariantGroup section */ 277 | 278 | /* Begin XCBuildConfiguration section */ 279 | 2D5074591AC546BB005AD163 /* Debug */ = { 280 | isa = XCBuildConfiguration; 281 | buildSettings = { 282 | ALWAYS_SEARCH_USER_PATHS = NO; 283 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 284 | CLANG_CXX_LIBRARY = "libc++"; 285 | CLANG_ENABLE_MODULES = YES; 286 | CLANG_ENABLE_OBJC_ARC = YES; 287 | CLANG_WARN_BOOL_CONVERSION = YES; 288 | CLANG_WARN_CONSTANT_CONVERSION = YES; 289 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 290 | CLANG_WARN_EMPTY_BODY = YES; 291 | CLANG_WARN_ENUM_CONVERSION = YES; 292 | CLANG_WARN_INFINITE_RECURSION = YES; 293 | CLANG_WARN_INT_CONVERSION = YES; 294 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 295 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 296 | CLANG_WARN_UNREACHABLE_CODE = YES; 297 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 298 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 299 | COPY_PHASE_STRIP = NO; 300 | ENABLE_STRICT_OBJC_MSGSEND = YES; 301 | ENABLE_TESTABILITY = YES; 302 | GCC_C_LANGUAGE_STANDARD = gnu99; 303 | GCC_DYNAMIC_NO_PIC = NO; 304 | GCC_NO_COMMON_BLOCKS = YES; 305 | GCC_OPTIMIZATION_LEVEL = 0; 306 | GCC_PREPROCESSOR_DEFINITIONS = ( 307 | "DEBUG=1", 308 | "$(inherited)", 309 | ); 310 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 311 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 312 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 313 | GCC_WARN_UNDECLARED_SELECTOR = YES; 314 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 315 | GCC_WARN_UNUSED_FUNCTION = YES; 316 | GCC_WARN_UNUSED_VARIABLE = YES; 317 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 318 | MTL_ENABLE_DEBUG_INFO = YES; 319 | ONLY_ACTIVE_ARCH = YES; 320 | SDKROOT = iphoneos; 321 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 322 | TARGETED_DEVICE_FAMILY = "1,2"; 323 | }; 324 | name = Debug; 325 | }; 326 | 2D50745A1AC546BB005AD163 /* Release */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 337 | CLANG_WARN_EMPTY_BODY = YES; 338 | CLANG_WARN_ENUM_CONVERSION = YES; 339 | CLANG_WARN_INFINITE_RECURSION = YES; 340 | CLANG_WARN_INT_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 343 | CLANG_WARN_UNREACHABLE_CODE = YES; 344 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 345 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 346 | COPY_PHASE_STRIP = NO; 347 | ENABLE_NS_ASSERTIONS = NO; 348 | ENABLE_STRICT_OBJC_MSGSEND = YES; 349 | GCC_C_LANGUAGE_STANDARD = gnu99; 350 | GCC_NO_COMMON_BLOCKS = YES; 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 358 | MTL_ENABLE_DEBUG_INFO = NO; 359 | SDKROOT = iphoneos; 360 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | VALIDATE_PRODUCT = YES; 363 | }; 364 | name = Release; 365 | }; 366 | 2D50745C1AC546BB005AD163 /* Debug */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 370 | INFOPLIST_FILE = SampleProject/Info.plist; 371 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 372 | PRODUCT_BUNDLE_IDENTIFIER = "com.test.$(PRODUCT_NAME:rfc1034identifier)"; 373 | PRODUCT_NAME = "$(TARGET_NAME)"; 374 | SWIFT_VERSION = 3.0; 375 | }; 376 | name = Debug; 377 | }; 378 | 2D50745D1AC546BB005AD163 /* Release */ = { 379 | isa = XCBuildConfiguration; 380 | buildSettings = { 381 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 382 | INFOPLIST_FILE = SampleProject/Info.plist; 383 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 384 | PRODUCT_BUNDLE_IDENTIFIER = "com.test.$(PRODUCT_NAME:rfc1034identifier)"; 385 | PRODUCT_NAME = "$(TARGET_NAME)"; 386 | SWIFT_VERSION = 3.0; 387 | }; 388 | name = Release; 389 | }; 390 | 2D50745F1AC546BB005AD163 /* Debug */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | BUNDLE_LOADER = "$(TEST_HOST)"; 394 | FRAMEWORK_SEARCH_PATHS = ( 395 | "$(SDKROOT)/Developer/Library/Frameworks", 396 | "$(inherited)", 397 | ); 398 | GCC_PREPROCESSOR_DEFINITIONS = ( 399 | "DEBUG=1", 400 | "$(inherited)", 401 | ); 402 | INFOPLIST_FILE = SampleProjectTests/Info.plist; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 404 | PRODUCT_BUNDLE_IDENTIFIER = "com.test.$(PRODUCT_NAME:rfc1034identifier)"; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | SWIFT_VERSION = 3.0; 407 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SampleProject.app/SampleProject"; 408 | }; 409 | name = Debug; 410 | }; 411 | 2D5074601AC546BB005AD163 /* Release */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | BUNDLE_LOADER = "$(TEST_HOST)"; 415 | FRAMEWORK_SEARCH_PATHS = ( 416 | "$(SDKROOT)/Developer/Library/Frameworks", 417 | "$(inherited)", 418 | ); 419 | INFOPLIST_FILE = SampleProjectTests/Info.plist; 420 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 421 | PRODUCT_BUNDLE_IDENTIFIER = "com.test.$(PRODUCT_NAME:rfc1034identifier)"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | SWIFT_VERSION = 3.0; 424 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SampleProject.app/SampleProject"; 425 | }; 426 | name = Release; 427 | }; 428 | /* End XCBuildConfiguration section */ 429 | 430 | /* Begin XCConfigurationList section */ 431 | 2D5074371AC546BB005AD163 /* Build configuration list for PBXProject "SampleProject" */ = { 432 | isa = XCConfigurationList; 433 | buildConfigurations = ( 434 | 2D5074591AC546BB005AD163 /* Debug */, 435 | 2D50745A1AC546BB005AD163 /* Release */, 436 | ); 437 | defaultConfigurationIsVisible = 0; 438 | defaultConfigurationName = Release; 439 | }; 440 | 2D50745B1AC546BB005AD163 /* Build configuration list for PBXNativeTarget "SampleProject" */ = { 441 | isa = XCConfigurationList; 442 | buildConfigurations = ( 443 | 2D50745C1AC546BB005AD163 /* Debug */, 444 | 2D50745D1AC546BB005AD163 /* Release */, 445 | ); 446 | defaultConfigurationIsVisible = 0; 447 | defaultConfigurationName = Release; 448 | }; 449 | 2D50745E1AC546BB005AD163 /* Build configuration list for PBXNativeTarget "SampleProjectTests" */ = { 450 | isa = XCConfigurationList; 451 | buildConfigurations = ( 452 | 2D50745F1AC546BB005AD163 /* Debug */, 453 | 2D5074601AC546BB005AD163 /* Release */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | /* End XCConfigurationList section */ 459 | }; 460 | rootObject = 2D5074341AC546BB005AD163 /* Project object */; 461 | } 462 | -------------------------------------------------------------------------------- /SampleProject/SampleProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SampleProject/SampleProject/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SampleProject 4 | // 5 | // Created by Al Shamas Tufail on 27/03/2015. 6 | // Copyright (c) 2015 Al Shamas Tufail. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SampleProject/SampleProject/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SampleProject/SampleProject/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 29 | 45 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /SampleProject/SampleProject/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /SampleProject/SampleProject/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /SampleProject/SampleProject/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SampleProject 4 | // 5 | // Created by Al Shamas Tufail on 27/03/2015. 6 | // Copyright (c) 2015 Al Shamas Tufail. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController, SSRadioButtonControllerDelegate { 12 | 13 | @IBOutlet weak var button1: UIButton! 14 | @IBOutlet weak var button2: UIButton! 15 | @IBOutlet weak var button3: UIButton! 16 | 17 | var radioButtonController: SSRadioButtonsController? 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | radioButtonController = SSRadioButtonsController(buttons: button1, button2, button3) 23 | radioButtonController!.delegate = self 24 | radioButtonController!.shouldLetDeSelect = true 25 | 26 | // Do any additional setup after loading the view, typically from a nib. 27 | } 28 | 29 | func didSelectButton(selectedButton: UIButton?) 30 | { 31 | NSLog(" \(selectedButton)" ) 32 | } 33 | 34 | override func didReceiveMemoryWarning() { 35 | super.didReceiveMemoryWarning() 36 | // Dispose of any resources that can be recreated. 37 | } 38 | 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /SampleProject/SampleProjectTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SampleProject/SampleProjectTests/SampleProjectTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SampleProjectTests.swift 3 | // SampleProjectTests 4 | // 5 | // Created by Al Shamas Tufail on 27/03/2015. 6 | // Copyright (c) 2015 Al Shamas Tufail. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class SampleProjectTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /demoRadioButtons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamasshahid/SSRadioButtonsController/6d6aab26b4e45da0a03c5f722b245bf90bb9c692/demoRadioButtons.gif --------------------------------------------------------------------------------