Skip to content

Commit

Permalink
Fixed Example.
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuel Guerrero committed Sep 24, 2016
1 parent 850ec90 commit 94a9732
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 40 deletions.
Binary file modified .DS_Store
Binary file not shown.
29 changes: 2 additions & 27 deletions Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,9 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)

let rootViewController: DemoViewController = DemoViewController()
self.window!.rootViewController = rootViewController

self.window!.makeKeyAndVisible()


private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
return true
}

func applicationWillResignActive(application: UIApplication) {
}

func applicationDidEnterBackground(application: UIApplication) {
}

func applicationWillEnterForeground(application: UIApplication) {
}

func applicationDidBecomeActive(application: UIApplication) {
}

func applicationWillTerminate(application: UIApplication) {
}


}

10 changes: 10 additions & 0 deletions Example/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Expand Down
10 changes: 5 additions & 5 deletions Example/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -14,10 +15,9 @@
<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"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down
28 changes: 28 additions & 0 deletions Example/Base.lproj/Storyboard.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="7DP-oA-xhV">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Demo View Controller-->
<scene sceneID="8oO-k9-jt3">
<objects>
<viewController id="7DP-oA-xhV" customClass="DemoViewController" customModule="Loader" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="zL5-cV-1oG"/>
<viewControllerLayoutGuide type="bottom" id="DkK-FI-Xft"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="uto-Fs-Sp2">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="idH-wm-oVg" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-186" y="133"/>
</scene>
</scenes>
</document>
16 changes: 10 additions & 6 deletions Example/DemoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,28 @@ class DemoViewController: UIViewController {

var loader: Loader!

// override var prefersStatusBarHidden: Bool {
// return true
// }

override func loadView() {
super.loadView()

self.view.backgroundColor = UIColor(red: 175.0 / 255.0, green: 85.0 / 255.0, blue: 255.0 / 255.0, alpha: 1.0)

self.loader = Loader(frame: CGRectMake(0.0, 0.0, 80.0, 40.0))
self.loader = Loader(frame: CGRect(x: 0.0, y: 0.0, width: 80.0, height: 40.0))
loader.center = self.view.center

self.view.addSubview(loader)
}

override func viewDidAppear(animated: Bool) {
override func viewDidLoad() {
super.viewDidLoad()
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

self.loader.startAnimating()
}

override func prefersStatusBarHidden() -> Bool {
return true
}
}
2 changes: 2 additions & 0 deletions Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Storyboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
21 changes: 20 additions & 1 deletion Loader.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
88FA7E341D961802006C3CC8 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88FA7E321D961802006C3CC8 /* Storyboard.storyboard */; };
BE57DF201C149DF40071595C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE57DF181C149DF40071595C /* AppDelegate.swift */; };
BE57DF211C149DF40071595C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BE57DF191C149DF40071595C /* Assets.xcassets */; };
BE57DF221C149DF40071595C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BE57DF1A1C149DF40071595C /* LaunchScreen.storyboard */; };
Expand All @@ -16,6 +17,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
88FA7E331D961802006C3CC8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Example/Base.lproj/Storyboard.storyboard; sourceTree = SOURCE_ROOT; };
BE3156741C149D0F00BA4E59 /* Loader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Loader.app; sourceTree = BUILT_PRODUCTS_DIR; };
BE57DF181C149DF40071595C /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Example/AppDelegate.swift; sourceTree = SOURCE_ROOT; };
BE57DF191C149DF40071595C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Example/Assets.xcassets; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -62,6 +64,7 @@
BE57DF1A1C149DF40071595C /* LaunchScreen.storyboard */,
BE57DF1E1C149DF40071595C /* Info.plist */,
BEE0F2851C149EDC00AFA2DE /* DemoViewController.swift */,
88FA7E321D961802006C3CC8 /* Storyboard.storyboard */,
);
path = Loader;
sourceTree = "<group>";
Expand Down Expand Up @@ -102,7 +105,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0710;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = Ekhoo;
TargetAttributes = {
BE3156731C149D0F00BA4E59 = {
Expand Down Expand Up @@ -136,6 +139,7 @@
files = (
BE57DF211C149DF40071595C /* Assets.xcassets in Resources */,
BE57DF221C149DF40071595C /* LaunchScreen.storyboard in Resources */,
88FA7E341D961802006C3CC8 /* Storyboard.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -156,6 +160,14 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
88FA7E321D961802006C3CC8 /* Storyboard.storyboard */ = {
isa = PBXVariantGroup;
children = (
88FA7E331D961802006C3CC8 /* Base */,
);
name = Storyboard.storyboard;
sourceTree = "<group>";
};
BE57DF1A1C149DF40071595C /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand All @@ -180,8 +192,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -224,8 +238,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -244,6 +260,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -253,6 +270,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -268,6 +286,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
2 changes: 1 addition & 1 deletion Source/Loader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class Loader: UIView {
}

public func startAnimating() {
self.animationTimer = Timer.scheduledTimer(timeInterval: 0.4, target: self, selector: "animateLoader", userInfo: nil, repeats: true)
self.animationTimer = Timer.scheduledTimer(timeInterval: 0.4, target: self, selector: #selector(Loader.animateLoader), userInfo: nil, repeats: true)
}

public func stopAnimating() {
Expand Down

0 comments on commit 94a9732

Please sign in to comment.