This is a custom page control (similar to UIPageControl) for iOS that has different options for displaying page control views.
Drag and drop the VPPageControl into the project file and start using it :)
- iOS 7.0 or later.
- ARC memory management.
After adding VPPageControl file into your project, there are 2 ways to create page control.
-
By adding an empty view to your xib/storyboard and changing the class of the view to VPPageControl. After adding the view create an outlet.
-
Programmatically set the property for the view.
For the oulet/property of the view set the necessary properties.
The available public properties are:
This defines how the page control dots would look like. The current available options are:
- RoundedFilled // Circular with filled states. Default UIPageControl type. This is the default type
- RoundedBorder // Circular with border type. Only Border and border color will be representing the states
- RoundedBorderFilledSelected // Circular with border type. Border color will be representing the unselected state. Filled represents the selected state
- RoundedFilledBorderSelected // Circular with filled type. Filled color will be representing the unselected state. Border represents the selected state
- SquareFilled // Square with filled states. Fill color represent the states
- SquareBorder // Square with border type. Border color will be representing the states
- SquareBorderFilledSelected // Square with border type. Border color will be representing the unselected state. Filled represents the selected state
- SquareFilledBorderSelected // Square with filled type. Filled color will be representing the unselected state. Border represents the selected state
- DiamondFilled // Diamond with filled states. Fill color represent the states
- DiamondBorder // Diamond with border type. Border color will be representing the states
- DiamondBorderFilledSelected // Diamond with border type. Border color will be representing the unselected state. Filled represents the selected state
- DiamondFilledBorderSelected // Diamond with filled type. Filled color will be representing the unselected state. Border represents the selected state
This defines the number of page controls that should be present.
This defines which page index is selected. Default will be 0 (indexing starts from 0).
This defines the color for the page control that isn't selected (unselected page control color).
This defines the color for the page control that is selected (selected page control color).
This is used for receiving notifications on changes of page control states.
VPPageControl has one delegate method for handling the changes of states.
This is called whenever the page changes for any necessary UI modification.
The following is a sample of VPPageControl options. There are some more similar options.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
###Version 1.1.0 ##Swift 3.0 Support added
Fixed spacing issue in diamond type.
###Version 1.0.0
Stable page control with support for rounded, square and diamond shaped page control with bordered, filled or both states for representing the selected or unselected state.
The MIT License (MIT)
Copyright (c) 2016 Varun P M
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.