In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| extension UIFont { | |
| var withSmallCaps: UIFont { | |
| let upperCaseFeature = [ | |
| UIFontDescriptor.FeatureKey.type : kUpperCaseType, | |
| UIFontDescriptor.FeatureKey.selector : kUpperCaseSmallCapsSelector | |
| ] | |
| let lowerCaseFeature = [ | |
| UIFontDescriptor.FeatureKey.type : kLowerCaseType, | |
| UIFontDescriptor.FeatureKey.selector : kLowerCaseSmallCapsSelector |
| - (UIImage *)compressImage:(UIImage *)image{ | |
| float actualHeight = image.size.height; | |
| float actualWidth = image.size.width; | |
| float maxHeight = 600.0; | |
| float maxWidth = 800.0; | |
| float imgRatio = actualWidth/actualHeight; | |
| float maxRatio = maxWidth/maxHeight; | |
| float compressionQuality = 0.5;//50 percent compression | |
| if (actualHeight > maxHeight || actualWidth > maxWidth) { |