Skip to content

Instantly share code, notes, and snippets.

@DrAma999
DrAma999 / gist:e0f5dadf7d496a74b1b0eee1e2695bd8
Created August 3, 2020 11:18
LittleBluetooth package file second
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "LittleBlueTooth",
platforms: [
// Add support for all platforms starting from a specific version.
.macOS(.v10_15),
@DrAma999
DrAma999 / gist:fa9baa6aa03a92b87a03e2017882fb43
Created August 2, 2020 20:04
LittleBluetooth package file first
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "LittleBlueTooth",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
@DrAma999
DrAma999 / gist:6554189
Created September 13, 2013 18:18
Method to be used inside a VC subclass or VC abstract class to avoid the status bar overlapping feature in iOS7. Actually tested only for single VC not added in hierachy. To use it you should embed all your view subviews into another view called tankView. It should be called before the view controller views has the opportunity to layout its view.
//This should be added before the layout of the view
- (void) adaptToTopLayoutGuide {
//Check if we can get the top layoutguide
if (![self respondsToSelector:@selector(topLayoutGuide)]) {
return;
}
//tankView is a contaner view
NSArray * array = [self.tankView referencingConstraintsInSuperviews]; //<--For this method get the Autolayout Demistified Book Sample made by Erica Sadun
[self.view removeConstraints:array];
NSArray * constraintsVertical = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[topLayoutGuide]-0-[tankView]|" options:0 metrics:nil views:@{@"tankView": self.tankView, @"topLayoutGuide":self.topLayoutGuide}];