Merge branch 'master' of https://github.com/JakubMazur/TGPControls into JakubMazur-master

This commit is contained in:
Xavier Schott 2017-04-14 13:03:55 -07:00
commit 1005779c93
5 changed files with 94 additions and 12 deletions

View File

@ -49,6 +49,12 @@ Using [CocoaPods](http://cocoapods.org/?q=TGPControls)
- **iOS 10 and later down to iOS 8**: install CocoaPods 1.2.0+ [CocoaPods-Frameworks](http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/), add `use_frameworks!` to your podfile.
- **iOS 7**: Use TGPControls version 2.1.0
Using [Carthage](https://github.com/Carthage/Carthage)
```
github "SwiftArchitect/TGPControls"
```
Please note that Carthage is available only for **iOS 8 or higher**
Besides customization, which you can do entirely under Interface Builder in iOS 8 and later, both `TGPDiscreteSlider` and `TGPCamelLabels` require surprisingly little code to integrate.
### DiscreteSlider

View File

@ -104,7 +104,6 @@
TargetAttributes = {
DC56BDFC1E46EA2000AAD0D9 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 55K7THBUV8;
LastSwiftMigration = 0820;
ProvisioningStyle = Automatic;
};
@ -256,7 +255,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 55K7THBUV8;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
@ -278,7 +277,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 55K7THBUV8;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DC56BDFC1E46EA2000AAD0D9"
BuildableName = "TGPControls.framework"
BlueprintName = "TGPControls"
ReferencedContainer = "container:TGPControls.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DC56BDFC1E46EA2000AAD0D9"
BuildableName = "TGPControls.framework"
BlueprintName = "TGPControls"
ReferencedContainer = "container:TGPControls.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DC56BDFC1E46EA2000AAD0D9"
BuildableName = "TGPControls.framework"
BlueprintName = "TGPControls"
ReferencedContainer = "container:TGPControls.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0</string>
<string>3.0.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>

View File

@ -71,7 +71,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
}
}
@IBInspectable public var tickImage:String? = nil {
@IBInspectable public var tickImage:UIImage? = nil {
didSet {
layoutTrack()
}
@ -90,7 +90,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
}
}
@IBInspectable public var trackImage:String? = nil {
@IBInspectable public var trackImage:UIImage? = nil {
didSet {
layoutTrack()
}
@ -339,8 +339,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
case .image:
// Draw image if exists
if let tickImage = tickImage,
let image = UIImage(named: tickImage),
if let image = tickImage,
let cgImage = image.cgImage,
let ctx = UIGraphicsGetCurrentContext() {
let centered = CGRect(x: rectangle.origin.x + (rectangle.width/2) - (image.size.width/2),
@ -392,8 +391,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
trackLayer.frame = CGRect.zero
// Draw image if exists
if let trackImage = trackImage,
let image = UIImage(named: trackImage),
if let image = trackImage,
let cgImage = image.cgImage,
let ctx = UIGraphicsGetCurrentContext() {
let centered = CGRect(x: (frame.width/2) - (image.size.width/2),
@ -531,8 +529,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
var trackSize = CGSize(width: frame.width - thumbWidth,
height: trackHeight)
if(.image == trackComponentStyle) {
if let trackImage = trackImage,
let image = UIImage(named: trackImage) {
if let image = trackImage {
trackSize.width = image.size.width - thumbWidth
}
}