Adding local fonts to styled components

I created “fonts” folder in src directory and put MyFont.otf inside it, however, I cannot use it inside a Styled Component (in this case StyledComponent.js). I mean it doesn’t see that font. index.js import React from ‘react’; import ReactDOM from ‘react-dom’; import App from ‘./components/App’; import ‘./index.css’; ReactDOM.render(<App />, document.getElementById(‘root’)); index.css @font-face { font-family: ‘MyFont’;…

Details

UIControl subclass – Unexpectedly found nil while implicitly unwrapping an Optional value

I’m trying to subclass UIControl to create a custom designed UIButton: class CustomButton: UIControl { @IBOutlet var containerView: UIView! required init?(coder: NSCoder) { super.init(coder: coder) self.containerView.roundCorners() } } In a .xib file (say, CatInfoView) I have added a UIView and given it the custom class name of CustomButton. However when I run the app I…

Details