-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from mono0926/1.1
Add FadeIn with Animation
- Loading branch information
Showing
14 changed files
with
317 additions
and
89 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
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
Binary file not shown.
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
30 changes: 30 additions & 0 deletions
30
NativePopup.xcodeproj/project.xcworkspace/xcshareddata/NativePopup.xcscmblueprint
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,30 @@ | ||
{ | ||
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "D303033972D8A193CE6F4FE999E3808CBBD94BFA", | ||
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { | ||
|
||
}, | ||
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { | ||
"D303033972D8A193CE6F4FE999E3808CBBD94BFA" : 9223372036854775807, | ||
"2DFADC9AD84CF9C31D739A31DD9C69332B3E98FE" : 9223372036854775807 | ||
}, | ||
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "7D5F9D4E-23F6-4820-9348-4DF6EFC0F867", | ||
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { | ||
"D303033972D8A193CE6F4FE999E3808CBBD94BFA" : "NativePopup\/", | ||
"2DFADC9AD84CF9C31D739A31DD9C69332B3E98FE" : "" | ||
}, | ||
"DVTSourceControlWorkspaceBlueprintNameKey" : "NativePopup", | ||
"DVTSourceControlWorkspaceBlueprintVersion" : 204, | ||
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "NativePopup.xcodeproj", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ | ||
{ | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:mono0926\/gihyo.git", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "2DFADC9AD84CF9C31D739A31DD9C69332B3E98FE" | ||
}, | ||
{ | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:mono0926\/NativePopup.git", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D303033972D8A193CE6F4FE999E3808CBBD94BFA" | ||
} | ||
] | ||
} |
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,13 @@ | ||
// | ||
// Animatable.swift | ||
// NativePopup | ||
// | ||
// Created by mono on 2017/05/20. | ||
// Copyright © 2017 mono. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol Animatable { | ||
func animate() | ||
} |
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,31 @@ | ||
// | ||
// AnimatableDoneView.swift | ||
// NativePopup | ||
// | ||
// Created by mono on 2017/05/20. | ||
// Copyright © 2017 mono. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class AnimatableDoneView: UIView, HasAnimatableLayer { | ||
|
||
let animatableLayer = CAShapeLayer() | ||
override func layoutSubviews() { | ||
super.layoutSubviews() | ||
|
||
let path = UIBezierPath() | ||
path.move(to: CGPoint(x: 22, y: 59)) | ||
path.addLine(to: CGPoint(x: 53, y: 87)) | ||
path.addLine(to: CGPoint(x: 111, y: 28)) | ||
|
||
animatableLayer.path = path.cgPath | ||
animatableLayer.fillColor = UIColor.clear.cgColor | ||
animatableLayer.strokeColor = tintColor.cgColor | ||
animatableLayer.lineWidth = 9 | ||
animatableLayer.lineCap = kCALineCapRound | ||
animatableLayer.lineJoin = kCALineCapRound | ||
animatableLayer.strokeEnd = 0 | ||
layer.addSublayer(animatableLayer) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
// | ||
// HasAnimatableLayer.swift | ||
// NativePopup | ||
// | ||
// Created by mono on 2017/05/20. | ||
// Copyright © 2017 mono. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol HasAnimatableLayer: Animatable { | ||
var animatableLayer: CAShapeLayer { get } | ||
} | ||
|
||
extension HasAnimatableLayer { | ||
func animate() { | ||
let animation = CABasicAnimation(keyPath: "strokeEnd") | ||
animation.duration = 0.3 | ||
animation.fromValue = 0 | ||
animation.toValue = 1 | ||
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) | ||
animatableLayer.strokeEnd = 1 | ||
animatableLayer.add(animation, forKey: "animation") | ||
} | ||
} |
Oops, something went wrong.