Giter Site home page Giter Site logo

bfwcontrols's Introduction

BFWControls

A framework to simplify building apps using Interface Builder.

Some useful resources:

BFWControls contains many features to simplify building apps visually, especially when using Interface Builder. Features include:

  • NibReplaceable protocol with NibView, NibTableViewCell classes: Loading xib layouts into subclasses with no extra code.
  • Adjustable protocol for UITableView: Sticky header and footer that remain stationery while the table scrolls.
  • HidingStackView: A stack view that hides any subviews that have invisible contents (eg UILabel.text == nil and UIImageView.image == nil) or a UIStackView subview that has all of its subviews hidden. When a stack view has a hidden subview, it removes it from the arrangedSubviews, so the space it occupied is freed, essentially shrinking any unused space.
  • UIView+NSLayoutConstraint: Convenient AutoLayout functions like pinToSuperviewEdges(), pinToSuperview(with inset: CGFloat)
  • StaticTableViewController: excludedCells: easy dynamic show/hide cells and sections
  • SegueHandlerType protocol: enum SegueIdentifier
  • UIApplication: unwindToBackmostViewController()
  • UIViewController+Unwind unwindToSelf() frontViewController
  • DefaultsHandlerType protocol: Expose UserDefaults as named variables

bfwcontrols's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bfwcontrols's Issues

Is it not allowed to use code to register collectionViewCell ?

If I register collectionViewCell in storyboard,it work well, but when I use a xib to create viewController,register collectionViewCell by code,it crash.

613C7D8C-F476-40A1-B6DC-A07F08E275B4

@IBDesignable
class EnterpriseUserCardCollectionViewCell: NibCollectionViewCell {
    override  func awakeFromNib() {
        super.awakeFromNib()
        self.contentView.layer.cornerRadius = 8
        self.contentView.clipsToBounds = true
    }
}

class TestCollectionViewController: UIViewController,UICollectionViewDataSource {
    @IBOutlet weak var collectionView: UICollectionView!
    override func viewDidLoad() {
        super.viewDidLoad()
        self.collectionView.dataSource = self
        self.collectionView.register(UINib(nibName: "EnterpriseUserCardCollectionViewCell", bundle: .main), forCellWithReuseIdentifier: "EnterpriseUserCardCollectionViewCell")
    }
    
     func numberOfSections(in collectionView: UICollectionView) -> Int {
        return 1
    }


     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 10
    }

     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "EnterpriseUserCardCollectionViewCell", for: indexPath)
        return cell
    }
}

How can I use it in Objective-C?

It work well in Swift,I use the same way to create Xib in Objective-C project,but it can not work,what else can I do? Thank you.

`#import <UIKit/UIKit.h>
#import <BFWControls/BFWControls.h>
IB_DESIGNABLE
@interface MyCustomView : BFWNibView

@Property (weak, nonatomic) IBOutlet UIButton *button;
@Property (weak, nonatomic) IBOutlet UISegmentedControl *segmentedControl;

@end`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.