Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
* development:
  Fix iPhone 5c Problem
  Update swift example.
  • Loading branch information
WenchaoD committed Oct 20, 2016
2 parents d6c9e96 + b7a877a commit 15789aa
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 18 deletions.
7 changes: 4 additions & 3 deletions FSCalendar/FSCalendarExtensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ - (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ...
if (!invocation) return nil;
invocation.target = self;
invocation.selector = selector;

// Parameters
if (firstObject) {
int index = 2;
Expand All @@ -169,7 +168,7 @@ - (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ...
#define PARAM_STRUCT_TYPES(_type,_getter,_default) \
if (!strcmp(argType, @encode(_type))) { \
_type value = [obj respondsToSelector:@selector(_getter)]?[obj _getter]:_default; \
[invocation setArgument:&value atIndex:index++]; \
[invocation setArgument:&value atIndex:index]; \
}
PARAM_STRUCT_TYPES(CGPoint, CGPointValue, CGPointZero)
PARAM_STRUCT_TYPES(CGSize, CGSizeValue, CGSizeZero)
Expand All @@ -182,12 +181,13 @@ - (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ...
PARAM_STRUCT_TYPES(NSRange, rangeValue, NSMakeRange(NSNotFound, 0))

#undef PARAM_STRUCT_TYPES
index++;
} else {
// basic type
#define PARAM_BASIC_TYPES(_type,_getter) \
if (!strcmp(argType, @encode(_type))) { \
_type value = [obj respondsToSelector:@selector(_getter)]?[obj _getter]:0; \
[invocation setArgument:&value atIndex:index++]; \
[invocation setArgument:&value atIndex:index]; \
}
PARAM_BASIC_TYPES(BOOL, boolValue)
PARAM_BASIC_TYPES(int, intValue)
Expand All @@ -202,6 +202,7 @@ - (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ...
PARAM_BASIC_TYPES(double, doubleValue)

#undef PARAM_BASIC_TYPES
index++;
}
}
} while((obj = va_arg(args, id)));
Expand Down
16 changes: 12 additions & 4 deletions SwiftExample/SwiftExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
300414221CD751B200453AEB /* FSCalendarScopeHandle.m in Sources */ = {isa = PBXBuildFile; fileRef = 300414211CD751B200453AEB /* FSCalendarScopeHandle.m */; };
300414261CD751CF00453AEB /* FSCalendar+Deprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = 300414241CD751CF00453AEB /* FSCalendar+Deprecated.m */; };
300BFB121C6446FA00399553 /* FSCalendarEventIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 300BFB111C6446FA00399553 /* FSCalendarEventIndicator.m */; };
303478391DB520C8007BBD2E /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 303478381DB520C8007BBD2E /* TableViewController.swift */; };
303DE6C11DB1CA3A00F43A0F /* FSCalendarConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 303DE6C01DB1CA3A00F43A0F /* FSCalendarConstants.m */; };
3055B1C81DA9338C002AFA13 /* FSCalendarExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3055B1C71DA9338C002AFA13 /* FSCalendarExtensions.m */; };
306DB1461C96700800A10478 /* FSCalendarAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = 306DB1451C96700800A10478 /* FSCalendarAnimator.m */; };
3078A8B11C50C0ED003D33EF /* FSCalendarFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC9C03F1BDCA2D600383A07 /* FSCalendarFlowLayout.m */; };
30D458E91DB4E2DB00B163C7 /* LoadViewExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30D458E81DB4E2DB00B163C7 /* LoadViewExampleViewController.swift */; };
EE0954AD1B97DDE0007F6964 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0954AC1B97DDE0007F6964 /* AppDelegate.swift */; };
EE0954AF1B97DDE0007F6964 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0954AE1B97DDE0007F6964 /* ViewController.swift */; };
EE0954AF1B97DDE0007F6964 /* InterfaceBuilderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0954AE1B97DDE0007F6964 /* InterfaceBuilderViewController.swift */; };
EE0954B21B97DDE0007F6964 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EE0954B01B97DDE0007F6964 /* Main.storyboard */; };
EE0954B41B97DDE0007F6964 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EE0954B31B97DDE0007F6964 /* Images.xcassets */; };
EE0954B71B97DDE0007F6964 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = EE0954B51B97DDE0007F6964 /* LaunchScreen.xib */; };
Expand Down Expand Up @@ -46,16 +48,18 @@
300414241CD751CF00453AEB /* FSCalendar+Deprecated.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "FSCalendar+Deprecated.m"; sourceTree = "<group>"; };
300BFB101C6446FA00399553 /* FSCalendarEventIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarEventIndicator.h; sourceTree = "<group>"; };
300BFB111C6446FA00399553 /* FSCalendarEventIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarEventIndicator.m; sourceTree = "<group>"; };
303478381DB520C8007BBD2E /* TableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = "<group>"; };
303DE6BF1DB1CA3A00F43A0F /* FSCalendarConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarConstants.h; sourceTree = "<group>"; };
303DE6C01DB1CA3A00F43A0F /* FSCalendarConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarConstants.m; sourceTree = "<group>"; };
3055B1C61DA9338C002AFA13 /* FSCalendarExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarExtensions.h; sourceTree = "<group>"; };
3055B1C71DA9338C002AFA13 /* FSCalendarExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarExtensions.m; sourceTree = "<group>"; };
306DB1441C96700800A10478 /* FSCalendarAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarAnimator.h; sourceTree = "<group>"; };
306DB1451C96700800A10478 /* FSCalendarAnimator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarAnimator.m; sourceTree = "<group>"; };
30D458E81DB4E2DB00B163C7 /* LoadViewExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadViewExampleViewController.swift; sourceTree = "<group>"; };
EE0954A71B97DDE0007F6964 /* SwiftExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
EE0954AB1B97DDE0007F6964 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
EE0954AC1B97DDE0007F6964 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
EE0954AE1B97DDE0007F6964 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
EE0954AE1B97DDE0007F6964 /* InterfaceBuilderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterfaceBuilderViewController.swift; sourceTree = "<group>"; };
EE0954B11B97DDE0007F6964 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
EE0954B31B97DDE0007F6964 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
EE0954B61B97DDE0007F6964 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -124,7 +128,9 @@
children = (
EE0954CC1B97DDF4007F6964 /* FSCalendar */,
EE0954AC1B97DDE0007F6964 /* AppDelegate.swift */,
EE0954AE1B97DDE0007F6964 /* ViewController.swift */,
303478381DB520C8007BBD2E /* TableViewController.swift */,
EE0954AE1B97DDE0007F6964 /* InterfaceBuilderViewController.swift */,
30D458E81DB4E2DB00B163C7 /* LoadViewExampleViewController.swift */,
EE0954B01B97DDE0007F6964 /* Main.storyboard */,
EE0954B31B97DDE0007F6964 /* Images.xcassets */,
EE0954B51B97DDE0007F6964 /* LaunchScreen.xib */,
Expand Down Expand Up @@ -307,14 +313,16 @@
EE0954E81B97DDF4007F6964 /* FSCalendarHeader.m in Sources */,
EE0954E31B97DDF4007F6964 /* FSCalendar+IBExtension.m in Sources */,
300BFB121C6446FA00399553 /* FSCalendarEventIndicator.m in Sources */,
303478391DB520C8007BBD2E /* TableViewController.swift in Sources */,
EE2B62831BB6D7FE00ACB430 /* FSCalendarStickyHeader.m in Sources */,
306DB1461C96700800A10478 /* FSCalendarAnimator.m in Sources */,
EE0954E41B97DDF4007F6964 /* FSCalendar.m in Sources */,
3055B1C81DA9338C002AFA13 /* FSCalendarExtensions.m in Sources */,
3078A8B11C50C0ED003D33EF /* FSCalendarFlowLayout.m in Sources */,
30D458E91DB4E2DB00B163C7 /* LoadViewExampleViewController.swift in Sources */,
EE0954E51B97DDF4007F6964 /* FSCalendarAppearance.m in Sources */,
EE0954AD1B97DDE0007F6964 /* AppDelegate.swift in Sources */,
EE0954AF1B97DDE0007F6964 /* ViewController.swift in Sources */,
EE0954AF1B97DDE0007F6964 /* InterfaceBuilderViewController.swift in Sources */,
300414221CD751B200453AEB /* FSCalendarScopeHandle.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
80 changes: 71 additions & 9 deletions SwiftExample/SwiftExample/Base.lproj/Main.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="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="PJf-VN-VRQ">
<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="PJf-VN-VRQ">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
Expand All @@ -14,28 +15,89 @@
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="lty-fT-aMK" kind="relationship" relationship="rootViewController" id="J2g-dr-uYm"/>
<segue destination="pql-xQ-kyz" kind="relationship" relationship="rootViewController" id="HYV-uQ-UNV"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="r7p-cV-Hof" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-769" y="269"/>
</scene>
<!--FSCalendar-->
<scene sceneID="mQI-RU-AqZ">
<objects>
<tableViewController id="pql-xQ-kyz" customClass="TableViewController" customModule="SwiftExample" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Fzs-qM-cOu">
<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"/>
<sections>
<tableViewSection id="rF9-Ar-n8y">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="Drg-hX-Wf1" style="IBUITableViewCellStyleDefault" id="Kfj-Va-Wua">
<rect key="frame" x="0.0" y="64" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Kfj-Va-Wua" id="Ovg-vw-USW">
<frame key="frameInset" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Interface Builder" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Drg-hX-Wf1">
<frame key="frameInset" minX="15" width="345" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="lty-fT-aMK" kind="show" id="W0j-tq-YZy"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="cWM-iX-3Vc" style="IBUITableViewCellStyleDefault" id="Im4-UX-rci">
<rect key="frame" x="0.0" y="108" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Im4-UX-rci" id="82T-qr-tzv">
<frame key="frameInset" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="LoadView" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="cWM-iX-3Vc">
<frame key="frameInset" minX="15" width="345" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="pql-xQ-kyz" id="MoL-de-DZU"/>
<outlet property="delegate" destination="pql-xQ-kyz" id="3Nz-sh-QZl"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="FSCalendar" id="hFo-dn-0Df"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="bb2-XA-uJM" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52" y="269"/>
</scene>
<!--Data Source-->
<scene sceneID="fuI-jA-1gc">
<objects>
<viewController id="lty-fT-aMK" customClass="ViewController" customModule="SwiftExample" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="lty-fT-aMK" customClass="InterfaceBuilderViewController" customModule="SwiftExample" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Euq-Om-XUc"/>
<viewControllerLayoutGuide type="bottom" id="SlA-5t-TA6"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kBR-oK-N7Y">
<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"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wPJ-CL-JyG" customClass="FSCalendar">
<rect key="frame" x="0.0" y="64" width="600" height="300"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="300" id="WIA-b7-boT"/>
</constraints>
Expand All @@ -48,7 +110,7 @@
</connections>
</view>
</subviews>
<color key="backgroundColor" red="0.94117647058823528" green="0.94117647058823528" blue="0.94117647058823528" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.94117647058823528" green="0.94117647058823528" blue="0.94117647058823528" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="wPJ-CL-JyG" secondAttribute="trailing" id="002-Gr-M9c"/>
<constraint firstItem="wPJ-CL-JyG" firstAttribute="top" secondItem="Euq-Om-XUc" secondAttribute="bottom" id="MGn-0L-7MJ"/>
Expand All @@ -63,7 +125,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="o4Q-iq-LTl" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-77" y="269"/>
<point key="canvasLocation" x="958" y="-52"/>
</scene>
</scenes>
</document>
Loading

0 comments on commit 15789aa

Please sign in to comment.