-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Reda Lemeden
committed
Nov 10, 2014
1 parent
4a3816c
commit 0e48455
Showing
20 changed files
with
801 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*.mode1 | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.perspective | ||
*.perspectivev3 | ||
*.pbxuser | ||
*.xccheckout | ||
xcuserdata | ||
build/ | ||
*.o | ||
*.LinkFileList | ||
*.hmap | ||
*~.nib/ | ||
*.swp | ||
*~ | ||
*.dat | ||
*.dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"size" : "29x29", | ||
"idiom" : "iphone", | ||
"filename" : "New [email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "40x40", | ||
"idiom" : "iphone", | ||
"filename" : "New [email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "60x60", | ||
"idiom" : "iphone", | ||
"filename" : "New [email protected]", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
demo/Images.xcassets/LaunchImage.launchimage/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"orientation" : "portrait", | ||
"idiom" : "iphone", | ||
"extent" : "full-screen", | ||
"minimum-system-version" : "7.0", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"orientation" : "portrait", | ||
"idiom" : "iphone", | ||
"subtype" : "retina4", | ||
"extent" : "full-screen", | ||
"minimum-system-version" : "7.0", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?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>co.kaishin.$(PRODUCT_NAME:rfc1034identifier)</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>UIViewControllerBasedStatusBarAppearance</key> | ||
<false/> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSRequiresIPhoneOS</key> | ||
<true/> | ||
<key>UIMainStoryboardFile</key> | ||
<string>Main</string> | ||
<key>UIRequiredDeviceCapabilities</key> | ||
<array> | ||
<string>armv7</string> | ||
</array> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6206.9" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7026.1"/> | ||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Gifu--> | ||
<scene sceneID="ufC-wZ-h7g"> | ||
<objects> | ||
<viewController title="Gifu" id="vXZ-lx-hvc" customClass="ViewController" customModule="gifu_demo" customModuleProvider="target" sceneMemberID="viewController"> | ||
<layoutGuides> | ||
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/> | ||
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/> | ||
</layoutGuides> | ||
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<subviews> | ||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="FSz-xF-Xds"> | ||
<rect key="frame" x="75" y="150" width="450" height="300"/> | ||
<color key="backgroundColor" red="0.7725490196" green="0.1764705882" blue="0.1843137255" alpha="1" colorSpace="calibratedRGB"/> | ||
<constraints> | ||
<constraint firstAttribute="height" constant="300" id="oev-E3-JrW"/> | ||
<constraint firstAttribute="width" secondItem="FSz-xF-Xds" secondAttribute="height" multiplier="1.5:1" id="vUc-PW-K4t"/> | ||
</constraints> | ||
</imageView> | ||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bFY-3J-OXr" customClass="FlatButton" customModule="gifu_demo" customModuleProvider="target"> | ||
<rect key="frame" x="275" y="509" width="50" height="50"/> | ||
<constraints> | ||
<constraint firstAttribute="height" constant="50" id="Lmc-xA-WNU"/> | ||
<constraint firstAttribute="height" constant="50" id="d3c-zA-X4Y"/> | ||
<constraint firstAttribute="width" constant="50" id="eYX-lm-C2V"/> | ||
</constraints> | ||
<fontDescription key="fontDescription" type="system" pointSize="13"/> | ||
<color key="tintColor" red="0.99444444444444446" green="1" blue="0.98888888888888893" alpha="1" colorSpace="calibratedRGB"/> | ||
<state key="normal" title="❙❙"/> | ||
<variation key="default"> | ||
<mask key="constraints"> | ||
<exclude reference="d3c-zA-X4Y"/> | ||
</mask> | ||
</variation> | ||
<connections> | ||
<action selector="toggleAnimation:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="PvH-3E-LbB"/> | ||
</connections> | ||
</button> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Gifu" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c8Y-41-BaC"> | ||
<rect key="frame" x="283" y="45" width="42" height="20.5"/> | ||
<constraints> | ||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="42" id="1Mg-oH-beY"/> | ||
</constraints> | ||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> | ||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Not the Japanese prefecture." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wsv-cU-WO5"> | ||
<rect key="frame" x="217" y="69" width="175" height="13.5"/> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="175" id="qtB-pf-agE"/> | ||
</constraints> | ||
<fontDescription key="fontDescription" type="system" pointSize="11"/> | ||
<color key="textColor" red="1" green="1" blue="1" alpha="0.5" colorSpace="calibratedRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" red="0.2304944545" green="0.24875254929999999" blue="0.2778563201" alpha="1" colorSpace="calibratedRGB"/> | ||
<constraints> | ||
<constraint firstAttribute="centerY" secondItem="bFY-3J-OXr" secondAttribute="centerY" id="09i-ag-RTM"/> | ||
<constraint firstItem="bFY-3J-OXr" firstAttribute="top" secondItem="FSz-xF-Xds" secondAttribute="bottom" constant="-73" id="1KN-hB-V2y"/> | ||
<constraint firstAttribute="centerX" secondItem="bFY-3J-OXr" secondAttribute="centerX" id="CNh-OD-Msi"/> | ||
<constraint firstItem="c8Y-41-BaC" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="25" id="JHy-q1-JuJ"/> | ||
<constraint firstAttribute="centerX" secondItem="c8Y-41-BaC" secondAttribute="centerX" constant="-4" id="Kc0-P5-KMZ"/> | ||
<constraint firstItem="wsv-cU-WO5" firstAttribute="leading" secondItem="c8Y-41-BaC" secondAttribute="trailing" constant="-108" id="WMw-79-FUC"/> | ||
<constraint firstItem="wsv-cU-WO5" firstAttribute="top" secondItem="c8Y-41-BaC" secondAttribute="bottom" constant="3.5" id="cLO-Rh-lrl"/> | ||
<constraint firstItem="bFY-3J-OXr" firstAttribute="centerY" secondItem="FSz-xF-Xds" secondAttribute="centerY" constant="102" id="eTb-IQ-R1d"/> | ||
<constraint firstAttribute="centerY" secondItem="FSz-xF-Xds" secondAttribute="centerY" id="lUc-8z-Gjn"/> | ||
<constraint firstAttribute="centerX" secondItem="FSz-xF-Xds" secondAttribute="centerX" id="oih-yH-vRh"/> | ||
<constraint firstItem="2fi-mo-0CV" firstAttribute="top" secondItem="bFY-3J-OXr" secondAttribute="bottom" constant="41" id="w4g-Xu-ht2"/> | ||
<constraint firstItem="bFY-3J-OXr" firstAttribute="top" secondItem="FSz-xF-Xds" secondAttribute="bottom" constant="-73" id="wKy-oP-72d"/> | ||
<constraint firstAttribute="centerX" secondItem="wsv-cU-WO5" secondAttribute="centerX" constant="-4.5" id="yLb-zR-gfU"/> | ||
</constraints> | ||
<variation key="default"> | ||
<mask key="constraints"> | ||
<exclude reference="09i-ag-RTM"/> | ||
<exclude reference="1KN-hB-V2y"/> | ||
<exclude reference="eTb-IQ-R1d"/> | ||
<exclude reference="wKy-oP-72d"/> | ||
</mask> | ||
</variation> | ||
</view> | ||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/> | ||
<nil key="simulatedTopBarMetrics"/> | ||
<nil key="simulatedBottomBarMetrics"/> | ||
<connections> | ||
<outlet property="button" destination="bFY-3J-OXr" id="MYJ-Xm-nTf"/> | ||
<outlet property="imageView" destination="FSz-xF-Xds" id="gtV-MK-Fwd"/> | ||
</connections> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/> | ||
</objects> | ||
</scene> | ||
</scenes> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import UIKit | ||
|
||
@UIApplicationMain | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
var window: UIWindow? | ||
|
||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | ||
return true | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import UIKit | ||
|
||
class FlatButton: UIButton { | ||
|
||
let horizontalPadding: CGFloat = 14.0 | ||
|
||
var buttonColor: UIColor? | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
customizeAppearance() | ||
} | ||
|
||
required init(coder aDecoder: NSCoder) { | ||
super.init(coder: aDecoder) | ||
customizeAppearance() | ||
} | ||
|
||
override func drawRect(rect: CGRect) { | ||
layer.borderColor = tintColor.CGColor | ||
setTitleColor(tintColor, forState: UIControlState.Normal) | ||
setTitleColor(UIColor.whiteColor(), forState: UIControlState.Selected) | ||
} | ||
|
||
func customizeAppearance() { | ||
let containsEdgeInsets = !UIEdgeInsetsEqualToEdgeInsets(contentEdgeInsets, UIEdgeInsetsZero) | ||
contentEdgeInsets = containsEdgeInsets ? contentEdgeInsets : UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) | ||
layer.borderWidth = 2.0 | ||
layer.borderColor = tintColor.CGColor | ||
layer.cornerRadius = frame.size.height / 2.0 | ||
layer.masksToBounds = true | ||
} | ||
|
||
override var tintColor: UIColor! { | ||
get { | ||
if let color = buttonColor { | ||
return color | ||
} else { | ||
return super.tintColor | ||
} | ||
} | ||
|
||
set { | ||
super.tintColor = newValue | ||
buttonColor = newValue | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import UIKit | ||
|
||
class ViewController: UIViewController { | ||
|
||
@IBOutlet weak var imageView: UIImageView! | ||
@IBOutlet weak var button: FlatButton! | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
imageView.setAnimatableImage(named: "mugen.gif") | ||
imageView.startAnimating() | ||
UIApplication.sharedApplication().setStatusBarStyle(.LightContent, animated: false) | ||
} | ||
|
||
@IBAction func toggleAnimation(button: UIButton) { | ||
if imageView.isAnimating { | ||
imageView.stopAnimating() | ||
button.layer.backgroundColor = UIColor.whiteColor().CGColor | ||
button.setTitleColor(UIColor.blackColor(), forState: .Normal) | ||
} else { | ||
imageView.startAnimating() | ||
button.layer.backgroundColor = UIColor.clearColor().CGColor | ||
button.setTitleColor(UIColor.whiteColor(), forState: .Normal) | ||
} | ||
} | ||
} | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.