Skip to content

Commit

Permalink
Version 2.1.0.16264:
Browse files Browse the repository at this point in the history
- Migration to Swift 3.0 and ready for iOS 10
  • Loading branch information
Robin Oster committed Sep 20, 2016
1 parent aae1ae4 commit e3bcbc9
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 107 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var color = UIColor(hex:"#A8DBA8")
```
The MIT License (MIT)
Copyright (c) 2015 Robin Oster (http://prine.ch)
Copyright (c) 2016 Robin Oster (http://prine.ch)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
37 changes: 11 additions & 26 deletions ROStorageBar.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,15 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
s.name = "ROStorageBar"
s.version = "2.0.0"
s.summary = "Dynamic Storage Bar (a là iTunes Usage Bar) written in Swift"
s.description = <<-DESC
ROStorageBar is a library which provides an easy way to create an UIView which looks
similar like the iTunes Usage Bar.
DESC
s.homepage = "https://github.com/prine/ROStorageBar"
s.screenshots = "https://camo.githubusercontent.com/54ac217836c172791733d1464e805a7401db3dea/687474703a2f2f7072696e652e63682f2f524f53746f726167654261722e706e67", "https://camo.githubusercontent.com/62c5d8ec8583b876d890236c4c6784e1ef54422b/687474703a2f2f7072696e652e63682f2f524f53746f726167654261725f63617074696f6e2e706e67"
s.license = 'MIT'
s.author = { "Robin Oster" => "[email protected]" }
s.source = { :git => "https://github.com/prine/ROStorageBar.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/prinedev'

s.platform = :ios, '8.0'
s.requires_arc = true

s.source_files = 'Source/**/*'
s.resource_bundles = {
'ROStorageBar' => ['Pod/Assets/*.png']
}

# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
Pod::Spec.new do |spec|
spec.name = 'ROStorageBar'
spec.version = '2.1.0'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/prine/ROStorageBar'
spec.authors = { 'Robin Oster' => '[email protected]' }
spec.summary = 'Dynamic Storage Bar (a là iTunes Usage Bar) written in Swift'
spec.source = { :git => 'https://github.com/prine/ROStorageBar.git', :tag => '2.1.0' }
spec.source_files = 'Source/**/*'
spec.framework = 'SystemConfiguration'
spec.ios.deployment_target = '9.3'
end
19 changes: 11 additions & 8 deletions ROStorageBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@
TargetAttributes = {
CB0D1A941A812C3500FC80A8 = {
CreatedOnToolsVersion = 6.1.1;
DevelopmentTeam = 39J9X3JBYC;
LastSwiftMigration = 0800;
};
CB0D1AA91A812C3500FC80A8 = {
CreatedOnToolsVersion = 6.1.1;
LastSwiftMigration = 0800;
TestTargetID = CB0D1A941A812C3500FC80A8;
};
};
Expand Down Expand Up @@ -355,32 +358,33 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 39J9X3JBYC;
INFOPLIST_FILE = ROStorageBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ch.prine.ios.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
CB0D1AB61A812C3500FC80A8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 39J9X3JBYC;
INFOPLIST_FILE = ROStorageBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ch.prine.ios.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
CB0D1AB81A812C3500FC80A8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand All @@ -389,6 +393,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ch.prine.ios.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ROStorageBar.app/ROStorageBar";
};
name = Debug;
Expand All @@ -397,14 +402,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = ROStorageBarTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ch.prine.ios.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ROStorageBar.app/ROStorageBar";
};
name = Release;
Expand Down
12 changes: 6 additions & 6 deletions ROStorageBar/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(application: UIApplication) {
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) {
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) {
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) {
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) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
9 changes: 6 additions & 3 deletions ROStorageBar/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -16,11 +17,13 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wpx-e3-M1A" customClass="ROStorageBar" customModule="ROStorageBar" customModuleProvider="target">
<view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wpx-e3-M1A" customClass="ROStorageBar" customModule="ROStorageBar" customModuleProvider="target">
<rect key="frame" x="16" y="28" width="568" height="100"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="wpx-e3-M1A" secondAttribute="bottom" constant="512" id="4yV-qu-wIm"/>
Expand Down
4 changes: 2 additions & 2 deletions ROStorageBar/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15265</string>
<string>16264</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
14 changes: 7 additions & 7 deletions ROStorageBar/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

storageBar.add(0.2, title: "Apps", color: UIColor.blackColor())
storageBar.add(0.15, title: "Documents", color: UIColor.orangeColor())
storageBar.add(0.21, title: "Photos", color: UIColor.purpleColor())
storageBar.add(0.3, title: "Movies", color: UIColor.redColor())
storageBar.add(0.2, title: "Apps", color: UIColor.black)
storageBar.add(0.15, title: "Documents", color: UIColor.orange)
storageBar.add(0.21, title: "Photos", color: UIColor.purple)
storageBar.add(0.3, title: "Movies", color: UIColor.red)

// Or if you want to use directly the struct to add an item
storageBar.addStorageBarValue(ROStorageBarValue(value: 0.6, title: "Backups", color: UIColor.greenColor()))
storageBar.addStorageBarValue(ROStorageBarValue(value: 0.6, title: "Backups", color: UIColor.green))

storageBar.unit = "GB"
storageBar.displayTitle = false
Expand All @@ -30,14 +30,14 @@ class ViewController: UIViewController {
storageBar.titleFontSize = 10.0
storageBar.valueFontSize = 10.0

let numberFormatter = NSNumberFormatter()
let numberFormatter = NumberFormatter()
numberFormatter.maximumFractionDigits = 2
numberFormatter.minimumIntegerDigits = 1

storageBar.numberFormatter = numberFormatter
}

override func didRotateFromInterfaceOrientation(fromInterfaceOrientation: UIInterfaceOrientation) {
override func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation) {
// Force the redraw. Otherwise the string is not correctly displayed
storageBar.setNeedsDisplay()
}
Expand Down
2 changes: 1 addition & 1 deletion ROStorageBarTests/ROStorageBarTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ROStorageBarTests: XCTestCase {

func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
self.measure() {
// Put the code you want to measure the time of here.
}
}
Expand Down
Loading

0 comments on commit e3bcbc9

Please sign in to comment.