Skip to content

X901/Helper4Swift

 
 

Repository files navigation

Helper4Swift

CI Status Version License Platform Twitter: @cs_alhaider

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Xcode 9.2 , Swift 4

Installation

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

pod 'Helper4Swift'

Classes folder contain :

Extensions folder contains :


Helper4Swift

  • fetchGenericData method // fetching json data by passing the struct/class model and the url
  • getCurrentDate method // return the current date in different format
  • getCurrentDateWithThisFormat method // return the current date with specific format
  • formatThisNumber method // takes string numbers (e.g Arabic numbers) and return string english numbers
  • shakePhone method // all kinds of UIImpactFeedbackGenerator .light .medium etc..
  • disabledForSome method // take control of what to show/hide for specific iOS devices
  • toolBar method // adding toolbar to a textField
  • showBasicAlert method // showing basic alert with title and message and OK button to dissmiss

Extensions

String Extension

  • isValidEmail // return true if the email match the regular expression (helful when adding sign up page)
  • isValidNumber // return true if the number match the regular expression
  • isValidPassword // return true if the string has minimum 8 characters, and at least one uppercase letter, and one lowercase letter and one number
  • isValidUrl // return true if string is valid Url
  • removeWhitespace method // removing the white space form string
  • replaceString // Replacing string by another string

Array Extension

  • shuffle method // returns an array containing this sequence shuffled

UIButton Extension

  • applyButtonDesign method // adding a shadow and other design

UILabel Extension

  • setLineSpacing method // adding a space between the lines

UIDevice Extension

  • modelName // determines the current iOS device model

UITextField Extension

  • addUnderlineDesign method // adding underline Design to UITextField

UIView Extension

  • addVerticalGradientLayer method // adds a vertical gradient layer with two UIColors to the UIView
  • applyViewDesign method // like drop a shadow to the UIView

UIImageView Extension

  • downloadedFrom method // downloads an image asynchronously from the web using URLSession

UIColor Extension

  • colorFromHexString method // return UIColor from a given hex string color

Author

Abdullah Alhaider,
cs.alhaider@gmail.com
Twitter

License

Helper4Swift is available under the MIT license. See the LICENSE file for more info.

About

Helpful extensions and methods to short your coding time.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 94.7%
  • Ruby 5.3%