Commit d6db0226 by Daniel Dahan

prepare for release with deprecated iOS 9 status bar style and status bar hidden

parent 672c9486
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
name = "Programmatic"> name = "Programmatic">
<Group <Group
location = "container:" location = "container:"
name = "MaterialLayout">
<FileRef
location = "group:Programmatic/MaterialLayout/MaterialLayout.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "MaterialLayer"> name = "MaterialLayer">
<FileRef <FileRef
location = "group:Programmatic/MaterialLayer/MaterialLayer.xcodeproj"> location = "group:Programmatic/MaterialLayer/MaterialLayer.xcodeproj">
......
...@@ -40,8 +40,8 @@ class ViewController: UIViewController { ...@@ -40,8 +40,8 @@ class ViewController: UIViewController {
// Examples of using ImageCardView. // Examples of using ImageCardView.
// Uncomment different examples and read // Uncomment different examples and read
// the comments below. // the comments below.
prepareGeneralImageCardViewExample() // prepareGeneralImageCardViewExample()
// prepareImageCardViewWithoutDetailLabelAndDividerExample() prepareImageCardViewWithoutDetailLabelAndDividerExample()
} }
/** /**
...@@ -150,7 +150,7 @@ class ViewController: UIViewController { ...@@ -150,7 +150,7 @@ class ViewController: UIViewController {
btn3.setImage(img3, forState: .Highlighted) btn3.setImage(img3, forState: .Highlighted)
// Add buttons to right side. // Add buttons to right side.
imageCardView.rightButtons = [btn1, btn2, btn3] imageCardView.rightButtons = [btn1]
imageCardView.rightButtonsInsetsRef.top = imageCardView.contentInsetsRef.top imageCardView.rightButtonsInsetsRef.top = imageCardView.contentInsetsRef.top
// To support orientation changes, use MaterialLayout. // To support orientation changes, use MaterialLayout.
......
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
961F5F2A1C1726A300C94B43 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F5F291C1726A300C94B43 /* AppDelegate.swift */; };
961F5F2C1C1726A300C94B43 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F5F2B1C1726A300C94B43 /* ViewController.swift */; };
961F5F311C1726A300C94B43 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 961F5F301C1726A300C94B43 /* Assets.xcassets */; };
961F5F341C1726A300C94B43 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 961F5F321C1726A300C94B43 /* LaunchScreen.storyboard */; };
961F5F3C1C17299C00C94B43 /* MaterialKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961F5F3B1C17299C00C94B43 /* MaterialKit.framework */; };
961F5F3D1C17299C00C94B43 /* MaterialKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 961F5F3B1C17299C00C94B43 /* MaterialKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
961F5F3E1C17299C00C94B43 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
961F5F3D1C17299C00C94B43 /* MaterialKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
961F5F261C1726A300C94B43 /* MaterialLayout.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MaterialLayout.app; sourceTree = BUILT_PRODUCTS_DIR; };
961F5F291C1726A300C94B43 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
961F5F2B1C1726A300C94B43 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
961F5F301C1726A300C94B43 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
961F5F331C1726A300C94B43 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
961F5F351C1726A300C94B43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
961F5F3B1C17299C00C94B43 /* MaterialKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = MaterialKit.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/MaterialKit-anypxbsecgdqqxevbavirvnffqxd/Build/Products/Debug-iphoneos/MaterialKit.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
961F5F231C1726A300C94B43 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
961F5F3C1C17299C00C94B43 /* MaterialKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
961F5F1D1C1726A300C94B43 = {
isa = PBXGroup;
children = (
961F5F3B1C17299C00C94B43 /* MaterialKit.framework */,
961F5F281C1726A300C94B43 /* MaterialLayout */,
961F5F271C1726A300C94B43 /* Products */,
);
sourceTree = "<group>";
};
961F5F271C1726A300C94B43 /* Products */ = {
isa = PBXGroup;
children = (
961F5F261C1726A300C94B43 /* MaterialLayout.app */,
);
name = Products;
sourceTree = "<group>";
};
961F5F281C1726A300C94B43 /* MaterialLayout */ = {
isa = PBXGroup;
children = (
961F5F291C1726A300C94B43 /* AppDelegate.swift */,
961F5F2B1C1726A300C94B43 /* ViewController.swift */,
961F5F301C1726A300C94B43 /* Assets.xcassets */,
961F5F321C1726A300C94B43 /* LaunchScreen.storyboard */,
961F5F351C1726A300C94B43 /* Info.plist */,
);
path = MaterialLayout;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
961F5F251C1726A300C94B43 /* MaterialLayout */ = {
isa = PBXNativeTarget;
buildConfigurationList = 961F5F381C1726A300C94B43 /* Build configuration list for PBXNativeTarget "MaterialLayout" */;
buildPhases = (
961F5F221C1726A300C94B43 /* Sources */,
961F5F231C1726A300C94B43 /* Frameworks */,
961F5F241C1726A300C94B43 /* Resources */,
961F5F3E1C17299C00C94B43 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = MaterialLayout;
productName = MaterialLayout;
productReference = 961F5F261C1726A300C94B43 /* MaterialLayout.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
961F5F1E1C1726A300C94B43 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = {
961F5F251C1726A300C94B43 = {
CreatedOnToolsVersion = 7.1.1;
};
};
};
buildConfigurationList = 961F5F211C1726A300C94B43 /* Build configuration list for PBXProject "MaterialLayout" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 961F5F1D1C1726A300C94B43;
productRefGroup = 961F5F271C1726A300C94B43 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
961F5F251C1726A300C94B43 /* MaterialLayout */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
961F5F241C1726A300C94B43 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
961F5F341C1726A300C94B43 /* LaunchScreen.storyboard in Resources */,
961F5F311C1726A300C94B43 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
961F5F221C1726A300C94B43 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
961F5F2C1C1726A300C94B43 /* ViewController.swift in Sources */,
961F5F2A1C1726A300C94B43 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
961F5F321C1726A300C94B43 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
961F5F331C1726A300C94B43 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
961F5F361C1726A300C94B43 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
961F5F371C1726A300C94B43 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
961F5F391C1726A300C94B43 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MaterialLayout/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.MaterialLayout;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
961F5F3A1C1726A300C94B43 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MaterialLayout/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.MaterialLayout;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
961F5F211C1726A300C94B43 /* Build configuration list for PBXProject "MaterialLayout" */ = {
isa = XCConfigurationList;
buildConfigurations = (
961F5F361C1726A300C94B43 /* Debug */,
961F5F371C1726A300C94B43 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
961F5F381C1726A300C94B43 /* Build configuration list for PBXNativeTarget "MaterialLayout" */ = {
isa = XCConfigurationList;
buildConfigurations = (
961F5F391C1726A300C94B43 /* Debug */,
961F5F3A1C1726A300C94B43 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 961F5F1E1C1726A300C94B43 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:MaterialLayout.xcodeproj">
</FileRef>
</Workspace>
//
// Copyright (C) 2015 CosmicMind, Inc. <http://cosmicmind.io> and other CosmicMind contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program located at the root of the software package
// in a file called LICENSE. If not, see <http://www.gnu.org/licenses/>.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController()
window!.makeKeyAndVisible()
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-29@2x-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-40@2x-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// Copyright (C) 2015 CosmicMind, Inc. <http://cosmicmind.io> and other CosmicMind contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program located at the root of the software package
// in a file called LICENSE. If not, see <http://www.gnu.org/licenses/>.
//
import UIKit
import MaterialKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
// Examples of using MaterialLayout.
prepareAlignCollectionToParentHorizontallyExample()
}
/**
:name: prepareView
:description: General preparation statements.
*/
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
/**
:name: prepareAlignCollectionToParentHorizontallyExample
:description: General usage example.
*/
private func prepareAlignCollectionToParentHorizontallyExample() {
let view1: MaterialView = MaterialView()
view1.translatesAutoresizingMaskIntoConstraints = false
view1.backgroundColor = MaterialColor.blueGrey.base
view.addSubview(view1)
let view2: MaterialView = MaterialView()
view2.translatesAutoresizingMaskIntoConstraints = false
view2.backgroundColor = MaterialColor.blueGrey.darken1
view.addSubview(view2)
let view3: MaterialView = MaterialView()
view3.translatesAutoresizingMaskIntoConstraints = false
view3.backgroundColor = MaterialColor.blueGrey.darken2
view.addSubview(view3)
let view4: MaterialView = MaterialView()
view4.translatesAutoresizingMaskIntoConstraints = false
view4.backgroundColor = MaterialColor.blueGrey.darken3
view.addSubview(view4)
let view5: MaterialView = MaterialView()
view5.translatesAutoresizingMaskIntoConstraints = false
view5.backgroundColor = MaterialColor.blueGrey.darken4
view.addSubview(view5)
// let children: Array<UIView> = [view1, view2, view3, view4, view5]
// MaterialLayout.alignChildrenToParentHorizontally(view, children: children, left: 10, right: 10, options: [NSLayoutFormatOptions.AlignAllCenterX])
// for v in children {
// MaterialLayout.height(view, child: v, height: 100)
// }
}
}
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'MK' s.name = 'MK'
s.version = '1.24.8' s.version = '1.24.9'
s.license = { :type => "AGPL-3.0", :file => "LICENSE" } s.license = { :type => "AGPL-3.0", :file => "LICENSE" }
s.summary = 'Beautiful Material Design in Swift.' s.summary = 'Beautiful Material Design in Swift.'
s.homepage = 'http://materialkit.io' s.homepage = 'http://materialkit.io'
......
...@@ -332,8 +332,8 @@ ...@@ -332,8 +332,8 @@
96D88C531C132A6900B91418 /* View */ = { 96D88C531C132A6900B91418 /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96D88C0D1C1328D800B91418 /* MaterialPulseView.swift */,
96D88C141C1328D800B91418 /* MaterialView.swift */, 96D88C141C1328D800B91418 /* MaterialView.swift */,
96D88C0D1C1328D800B91418 /* MaterialPulseView.swift */,
); );
name = View; name = View;
sourceTree = "<group>"; sourceTree = "<group>";
......
...@@ -236,12 +236,12 @@ public class CardView : MaterialPulseView { ...@@ -236,12 +236,12 @@ public class CardView : MaterialPulseView {
if divider { if divider {
var y: CGFloat = contentInsetsRef.bottom + dividerInsetsRef.bottom var y: CGFloat = contentInsetsRef.bottom + dividerInsetsRef.bottom
if 0 < leftButtons?.count { if 0 < leftButtons?.count {
y += leftButtonsInsetsRef.top + leftButtonsInsetsRef.bottom + leftButtons![0].frame.size.height y += leftButtonsInsetsRef.top + leftButtonsInsetsRef.bottom + leftButtons![0].frame.height
} else if 0 < rightButtons?.count { } else if 0 < rightButtons?.count {
y += rightButtonsInsetsRef.top + rightButtonsInsetsRef.bottom + rightButtons![0].frame.size.height y += rightButtonsInsetsRef.top + rightButtonsInsetsRef.bottom + rightButtons![0].frame.height
} }
if 0 < y { if 0 < y {
prepareDivider(bounds.size.height - y - 0.5, width: bounds.size.width) prepareDivider(bounds.height - y - 0.5, width: bounds.width)
} }
} else { } else {
dividerLayer?.removeFromSuperlayer() dividerLayer?.removeFromSuperlayer()
......
...@@ -22,7 +22,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -22,7 +22,7 @@ public class ImageCardView : MaterialPulseView {
// //
// :name: dividerLayer // :name: dividerLayer
// //
internal var dividerLayer: CAShapeLayer? private var dividerLayer: CAShapeLayer?
// //
// :name: dividerColor // :name: dividerColor
...@@ -324,18 +324,18 @@ public class ImageCardView : MaterialPulseView { ...@@ -324,18 +324,18 @@ public class ImageCardView : MaterialPulseView {
super.layoutSublayersOfLayer(layer) super.layoutSublayersOfLayer(layer)
if self.layer == layer { if self.layer == layer {
// image // image
imageLayer?.frame.size.width = bounds.size.width imageLayer?.frame.size.width = bounds.width
// divider // divider
if divider { if divider {
var y: CGFloat = contentInsetsRef.bottom + dividerInsetsRef.bottom var y: CGFloat = contentInsetsRef.bottom + dividerInsetsRef.bottom
if 0 < leftButtons?.count { if 0 < leftButtons?.count {
y += leftButtonsInsetsRef.top + leftButtonsInsetsRef.bottom + leftButtons![0].frame.size.height y += leftButtonsInsetsRef.top + leftButtonsInsetsRef.bottom + leftButtons![0].frame.height
} else if 0 < rightButtons?.count { } else if 0 < rightButtons?.count {
y += rightButtonsInsetsRef.top + rightButtonsInsetsRef.bottom + rightButtons![0].frame.size.height y += rightButtonsInsetsRef.top + rightButtonsInsetsRef.bottom + rightButtons![0].frame.height
} }
if 0 < y { if 0 < y {
prepareDivider(bounds.size.height - y - 0.5, width: bounds.size.width) prepareDivider(bounds.height - y - 0.5, width: bounds.width)
} }
} else { } else {
dividerLayer?.removeFromSuperlayer() dividerLayer?.removeFromSuperlayer()
...@@ -381,7 +381,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -381,7 +381,7 @@ public class ImageCardView : MaterialPulseView {
if nil != imageLayer?.contents { if nil != imageLayer?.contents {
verticalFormat += "-(insetTop)" verticalFormat += "-(insetTop)"
metrics["insetTop"] = imageLayer?.frame.size.height metrics["insetTop"] = contentInsetsRef.top + imageLayer!.frame.height
} else if nil != titleLabel { } else if nil != titleLabel {
verticalFormat += "-(insetTop)" verticalFormat += "-(insetTop)"
metrics["insetTop"] = contentInsetsRef.top + titleLabelInsetsRef.top metrics["insetTop"] = contentInsetsRef.top + titleLabelInsetsRef.top
...@@ -521,7 +521,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -521,7 +521,7 @@ public class ImageCardView : MaterialPulseView {
} else { } else {
metrics["insetC"] = (metrics["insetC"] as! CGFloat) + detailLabelInsetsRef.bottom + (divider ? dividerInsetsRef.top + dividerInsetsRef.bottom : 0) metrics["insetC"] = (metrics["insetC"] as! CGFloat) + detailLabelInsetsRef.bottom + (divider ? dividerInsetsRef.top + dividerInsetsRef.bottom : 0)
} }
} else if nil == detailLabel { } else {
if 0 < leftButtons?.count { if 0 < leftButtons?.count {
verticalFormat += "-[button]" verticalFormat += "-[button]"
views["button"] = leftButtons![0] views["button"] = leftButtons![0]
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.24.8</string> <string>1.24.9</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -22,47 +22,81 @@ public struct MaterialLayout { ...@@ -22,47 +22,81 @@ public struct MaterialLayout {
/** /**
:name: width :name: width
*/ */
public static func width(parent: UIView, child: UIView, width: CGFloat = 0) { public static func width(parent: UIView, child: UIView, width: CGFloat = 0, options: NSLayoutFormatOptions = []) {
let metrics: Dictionary<String, AnyObject> = ["width" : width] let metrics: Dictionary<String, AnyObject> = ["width" : width]
let views: Dictionary<String, AnyObject> = ["child" : child] let views: Dictionary<String, AnyObject> = ["child" : child]
parent.addConstraints(constraint("H:[child(width)]", options: [], metrics: metrics, views: views)) parent.addConstraints(constraint("H:[child(width)]", options: options, metrics: metrics, views: views))
} }
/** /**
:name: height :name: height
*/ */
public static func height(parent: UIView, child: UIView, height: CGFloat = 0) { public static func height(parent: UIView, child: UIView, height: CGFloat = 0, options: NSLayoutFormatOptions = []) {
let metrics: Dictionary<String, AnyObject> = ["height" : height] let metrics: Dictionary<String, AnyObject> = ["height" : height]
let views: Dictionary<String, AnyObject> = ["child" : child] let views: Dictionary<String, AnyObject> = ["child" : child]
parent.addConstraints(constraint("V:[child(height)]", options: [], metrics: metrics, views: views)) parent.addConstraints(constraint("V:[child(height)]", options: options, metrics: metrics, views: views))
} }
/** /**
:name: size :name: size
*/ */
public static func size(parent: UIView, child: UIView, width: CGFloat = 0, height: CGFloat = 0) { public static func size(parent: UIView, child: UIView, width: CGFloat = 0, height: CGFloat = 0, options: NSLayoutFormatOptions = []) {
MaterialLayout.width(parent, child: child, width: width) MaterialLayout.width(parent, child: child, width: width)
MaterialLayout.height(parent, child: child, height: height) MaterialLayout.height(parent, child: child, height: height)
} }
// /**
// :name: alignChildrenToParentHorizontally
// */
// public static func alignChildrenToParentHorizontally(parent: UIView, children: Array<UIView>, left: CGFloat = 0, right: CGFloat = 0, minimumInteritemSpacing: CGFloat = 0, options: NSLayoutFormatOptions = []) {
// if 0 < children.count {
// var format: String = "H:"
// var i: Int = 1
// var views: Dictionary<String, UIView> = Dictionary<String, UIView>()
// for v in children {
// let k: String = "view\(i++)"
// views[k] = v
// format += i > children.count ? "[\(k)]" : "[\(k)]"
// }
// print(format)
// parent.addConstraints(constraint(format, options: options, metrics: ["left" : left, "right": right, "minimumInteritemSpacing": minimumInteritemSpacing], views: views))
// }
// }
//
// /**
// :name: alignChildrenToParentVertically
// */
// public static func alignChildrenToParentVertically(parent: UIView, children: Array<UIView>, top: CGFloat = 0, bottom: CGFloat = 0, minimumLineSpacing: CGFloat = 0, options: NSLayoutFormatOptions = []) {
// if 0 < children.count {
// var format: String = "V:|-(left)-"
// var i: Int = 1
// var views: Dictionary<String, UIView> = Dictionary<String, UIView>()
// for v in children {
// views["view\(i++)"] = v
// format += i == children.count ? "[view\(i++)]-(right)-|" : "[view\(i++)]-(>=minimumLineSpacing)-"
// }
// parent.addConstraints(constraint(format, options: options, metrics: ["top" : top, "bottom": bottom, "minimumLineSpacing": minimumLineSpacing], views: views))
// }
// }
/** /**
:name: alignToParentHorizontally :name: alignToParentHorizontally
*/ */
public static func alignToParentHorizontally(parent: UIView, child: UIView, left: CGFloat = 0, right: CGFloat = 0) { public static func alignToParentHorizontally(parent: UIView, child: UIView, left: CGFloat = 0, right: CGFloat = 0, options: NSLayoutFormatOptions = []) {
parent.addConstraints(constraint("H:|-(left)-[child]-(right)-|", options: [], metrics: ["left": left, "right": right], views: ["child" : child])) parent.addConstraints(constraint("H:|-(left)-[child]-(right)-|", options: options, metrics: ["left": left, "right": right], views: ["child" : child]))
} }
/** /**
:name: alignToParentVertically :name: alignToParentVertically
*/ */
public static func alignToParentVertically(parent: UIView, child: UIView, top: CGFloat = 0, bottom: CGFloat = 0) { public static func alignToParentVertically(parent: UIView, child: UIView, top: CGFloat = 0, bottom: CGFloat = 0, options: NSLayoutFormatOptions = []) {
parent.addConstraints(constraint("V:|-(top)-[child]-(bottom)-|", options: [], metrics: ["bottom": bottom, "top": top], views: ["child" : child])) parent.addConstraints(constraint("V:|-(top)-[child]-(bottom)-|", options: options, metrics: ["bottom": bottom, "top": top], views: ["child" : child]))
} }
/** /**
:name: alignToParent :name: alignToParent
*/ */
public static func alignToParent(parent: UIView, child: UIView, top: CGFloat = 0, left: CGFloat = 0, bottom: CGFloat = 0, right: CGFloat = 0) { public static func alignToParent(parent: UIView, child: UIView, top: CGFloat = 0, left: CGFloat = 0, bottom: CGFloat = 0, right: CGFloat = 0, options: NSLayoutFormatOptions = []) {
alignToParentHorizontally(parent, child: child, left: left, right: right) alignToParentHorizontally(parent, child: child, left: left, right: right)
alignToParentVertically(parent, child: child, top: top, bottom: bottom) alignToParentVertically(parent, child: child, top: top, bottom: bottom)
} }
...@@ -70,7 +104,7 @@ public struct MaterialLayout { ...@@ -70,7 +104,7 @@ public struct MaterialLayout {
/** /**
:name: alignFromTopLeft :name: alignFromTopLeft
*/ */
public static func alignFromTopLeft(parent: UIView, child: UIView, top: CGFloat = 0, left: CGFloat = 0) { public static func alignFromTopLeft(parent: UIView, child: UIView, top: CGFloat = 0, left: CGFloat = 0, options: NSLayoutFormatOptions = []) {
alignFromTop(parent, child: child, top: top) alignFromTop(parent, child: child, top: top)
alignFromLeft(parent, child: child, left: left) alignFromLeft(parent, child: child, left: left)
} }
...@@ -78,7 +112,7 @@ public struct MaterialLayout { ...@@ -78,7 +112,7 @@ public struct MaterialLayout {
/** /**
:name: alignFromTopRight :name: alignFromTopRight
*/ */
public static func alignFromTopRight(parent: UIView, child: UIView, top: CGFloat = 0, right: CGFloat = 0) { public static func alignFromTopRight(parent: UIView, child: UIView, top: CGFloat = 0, right: CGFloat = 0, options: NSLayoutFormatOptions = []) {
alignFromTop(parent, child: child, top: top) alignFromTop(parent, child: child, top: top)
alignFromRight(parent, child: child, right: right) alignFromRight(parent, child: child, right: right)
} }
...@@ -86,7 +120,7 @@ public struct MaterialLayout { ...@@ -86,7 +120,7 @@ public struct MaterialLayout {
/** /**
:name: alignFromBottomLeft :name: alignFromBottomLeft
*/ */
public static func alignFromBottomLeft(parent: UIView, child: UIView, bottom: CGFloat = 0, left: CGFloat = 0) { public static func alignFromBottomLeft(parent: UIView, child: UIView, bottom: CGFloat = 0, left: CGFloat = 0, options: NSLayoutFormatOptions = []) {
alignFromBottom(parent, child: child, bottom: bottom) alignFromBottom(parent, child: child, bottom: bottom)
alignFromLeft(parent, child: child, left: left) alignFromLeft(parent, child: child, left: left)
} }
...@@ -94,7 +128,7 @@ public struct MaterialLayout { ...@@ -94,7 +128,7 @@ public struct MaterialLayout {
/** /**
:name: alignFromBottomRight :name: alignFromBottomRight
*/ */
public static func alignFromBottomRight(parent: UIView, child: UIView, bottom: CGFloat = 0, right: CGFloat = 0) { public static func alignFromBottomRight(parent: UIView, child: UIView, bottom: CGFloat = 0, right: CGFloat = 0, options: NSLayoutFormatOptions = []) {
alignFromBottom(parent, child: child, bottom: bottom) alignFromBottom(parent, child: child, bottom: bottom)
alignFromRight(parent, child: child, right: right) alignFromRight(parent, child: child, right: right)
} }
...@@ -102,29 +136,29 @@ public struct MaterialLayout { ...@@ -102,29 +136,29 @@ public struct MaterialLayout {
/** /**
:name: alignFromTop :name: alignFromTop
*/ */
public static func alignFromTop(parent: UIView, child: UIView, top: CGFloat = 0) { public static func alignFromTop(parent: UIView, child: UIView, top: CGFloat = 0, options: NSLayoutFormatOptions = []) {
parent.addConstraints(constraint("V:|-(top)-[child]", options: [], metrics: ["top" : top], views: ["child" : child])) parent.addConstraints(constraint("V:|-(top)-[child]", options: options, metrics: ["top" : top], views: ["child" : child]))
} }
/** /**
:name: alignFromLeft :name: alignFromLeft
*/ */
public static func alignFromLeft(parent: UIView, child: UIView, left: CGFloat = 0) { public static func alignFromLeft(parent: UIView, child: UIView, left: CGFloat = 0, options: NSLayoutFormatOptions = []) {
parent.addConstraints(constraint("H:|-(left)-[child]", options: [], metrics: ["left" : left], views: ["child" : child])) parent.addConstraints(constraint("H:|-(left)-[child]", options: options, metrics: ["left" : left], views: ["child" : child]))
} }
/** /**
:name: alignFromBottom :name: alignFromBottom
*/ */
public static func alignFromBottom(parent: UIView, child: UIView, bottom: CGFloat = 0) { public static func alignFromBottom(parent: UIView, child: UIView, bottom: CGFloat = 0, options: NSLayoutFormatOptions = []) {
parent.addConstraints(constraint("V:[child]-(bottom)-|", options: [], metrics: ["bottom" : bottom], views: ["child" : child])) parent.addConstraints(constraint("V:[child]-(bottom)-|", options: options, metrics: ["bottom" : bottom], views: ["child" : child]))
} }
/** /**
:name: alignFromRight :name: alignFromRight
*/ */
public static func alignFromRight(parent: UIView, child: UIView, right: CGFloat = 0) { public static func alignFromRight(parent: UIView, child: UIView, right: CGFloat = 0, options: NSLayoutFormatOptions = []) {
parent.addConstraints(constraint("H:[child]-(right)-|", options: [], metrics: ["right" : right], views: ["child" : child])) parent.addConstraints(constraint("H:[child]-(right)-|", options: options, metrics: ["right" : right], views: ["child" : child]))
} }
/** /**
......
...@@ -94,13 +94,6 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -94,13 +94,6 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
// //
private var sideTapGesture: UITapGestureRecognizer? private var sideTapGesture: UITapGestureRecognizer?
//
// :name: isViewBasedAppearance
//
private var isViewBasedAppearance: Bool {
return 0 == NSBundle.mainBundle().objectForInfoDictionaryKey("UIViewControllerBasedStatusBarAppearance") as? Int
}
/** /**
:name: delegate :name: delegate
*/ */
...@@ -448,15 +441,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -448,15 +441,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
// //
private func toggleStatusBar(hide: Bool = false) { private func toggleStatusBar(hide: Bool = false) {
if hideStatusBar { if hideStatusBar {
if isViewBasedAppearance { UIApplication.sharedApplication().statusBarHidden = hide
UIApplication.sharedApplication().setStatusBarHidden(hide, withAnimation: .Slide)
} else {
dispatch_async(dispatch_get_main_queue(), {
if let w = UIApplication.sharedApplication().keyWindow {
w.windowLevel = hide ? UIWindowLevelStatusBar + 1 : 0
}
})
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment