Skip to content
/ BayKit Public

Calculates the global offset for all screen sizes by depending on given screen size and given offset.

License

Notifications You must be signed in to change notification settings

cemtu/BayKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BayKit

Table of Contents


Features

Image description

As you can see width and height constraints updated by depending on phone size.

Without any extra code!


Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate BayKit into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'BayKit', '~> 1.0.1'
end

Then, run the following command:

$ pod install

Usage

import BayKit

class MyViewController: UIViewController {
    lazy var box = UIView()
    let magicOffset = BayKit()

    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(box)
        box.translatesAutoresizingMaskIntoConstraints = false

        box.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: magicOffset.offseter(scaleFactor: 1.0,
        offset: 24, direction: .horizontal, currentDeviceBound: BayKit.DeviceList.iPhone5.screenWidth)).isActive = true
    }
}

Contributing

Step 1

  • Option 1

    • Fork this repo.
  • Option 2

    • Clone this repo to your local machine using https://github.com/BayCem/BayKit.git

Step 2

  • HACK AWAY! 🔨🔨🔨

Step 3

  • 🔃 Create a new pull request.

License

About

Calculates the global offset for all screen sizes by depending on given screen size and given offset.

Resources

License

Stars

Watchers

Forks

Packages

No packages published