-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.2.1: Improvements for longPress position & Fix collectionView Reus…
…e caused bugs
- Loading branch information
Showing
15 changed files
with
262 additions
and
77 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
42 changes: 42 additions & 0 deletions
42
Example/JZCalendarWeekViewExample/Source/LongPressViews/LongPressEventCell.swift
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,42 @@ | ||
// | ||
// LongPressEventCell.swift | ||
// JZCalendarWeekViewExample | ||
// | ||
// Created by Jeff Zhang on 2/5/18. | ||
// Copyright © 2018 Jeff Zhang. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import JZCalendarWeekView | ||
|
||
class LongPressEventCell: JZBaseEventCell { | ||
|
||
@IBOutlet weak var titleLabel: UILabel! | ||
@IBOutlet weak var locationLabel: UILabel! | ||
@IBOutlet weak var borderView: UIView! | ||
|
||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
|
||
setupBasic() | ||
} | ||
|
||
func setupBasic() { | ||
self.clipsToBounds = true | ||
layer.shadowColor = UIColor.black.cgColor | ||
layer.shadowOffset = CGSize(width: 0, height: 4) | ||
layer.shadowRadius = 5 | ||
layer.shadowOpacity = 0 | ||
locationLabel.font = UIFont.systemFont(ofSize: 12) | ||
titleLabel.font = UIFont.systemFont(ofSize: 14, weight: .medium) | ||
self.backgroundColor = UIColor(hex: 0xEEF7FF) | ||
borderView.backgroundColor = UIColor(hex: 0x0899FF) | ||
} | ||
|
||
func updateView(event: Event) { | ||
self.event = event | ||
locationLabel.text = event.location | ||
titleLabel.text = event.title | ||
} | ||
|
||
} |
64 changes: 64 additions & 0 deletions
64
Example/JZCalendarWeekViewExample/Source/LongPressViews/LongPressEventCell.xib
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,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
<device id="retina4_7" orientation="portrait"> | ||
<adaptation id="fullscreen"/> | ||
</device> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="25R-T5-CF5" customClass="LongPressEventCell" customModule="JZCalendarWeekViewExample" customModuleProvider="target"> | ||
<rect key="frame" x="0.0" y="0.0" width="220" height="123"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> | ||
<rect key="frame" x="0.0" y="0.0" width="220" height="123"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="characterWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TU0-NI-510"> | ||
<rect key="frame" x="5" y="5" width="212" height="17"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="14"/> | ||
<nil key="textColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ic2-yw-Fo7"> | ||
<rect key="frame" x="0.0" y="0.0" width="2" height="123"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="2" id="ZHE-bM-NrH"/> | ||
</constraints> | ||
</view> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hd0-ZR-rTQ"> | ||
<rect key="frame" x="5" y="24" width="212" height="0.0"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
<nil key="textColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
</view> | ||
<constraints> | ||
<constraint firstItem="hd0-ZR-rTQ" firstAttribute="trailing" secondItem="TU0-NI-510" secondAttribute="trailing" id="DEE-Tn-36V"/> | ||
<constraint firstItem="Ic2-yw-Fo7" firstAttribute="top" secondItem="25R-T5-CF5" secondAttribute="top" id="MzP-zF-rJ0"/> | ||
<constraint firstItem="Ic2-yw-Fo7" firstAttribute="leading" secondItem="25R-T5-CF5" secondAttribute="leading" id="UbL-hJ-Ahd"/> | ||
<constraint firstItem="hd0-ZR-rTQ" firstAttribute="top" secondItem="TU0-NI-510" secondAttribute="bottom" constant="2" id="dfK-9u-IE5"/> | ||
<constraint firstAttribute="trailing" secondItem="TU0-NI-510" secondAttribute="trailing" constant="3" id="lMm-vv-ldl"/> | ||
<constraint firstItem="TU0-NI-510" firstAttribute="leading" secondItem="25R-T5-CF5" secondAttribute="leading" constant="5" id="lTX-m5-GGw"/> | ||
<constraint firstItem="TU0-NI-510" firstAttribute="top" secondItem="25R-T5-CF5" secondAttribute="top" constant="5" id="rlA-Yf-5Ef"/> | ||
<constraint firstItem="hd0-ZR-rTQ" firstAttribute="leading" secondItem="TU0-NI-510" secondAttribute="leading" id="vbe-EU-4eq"/> | ||
<constraint firstAttribute="bottom" secondItem="Ic2-yw-Fo7" secondAttribute="bottom" id="zhL-j8-GPY"/> | ||
</constraints> | ||
<viewLayoutGuide key="safeArea" id="hha-gv-ACH"/> | ||
<size key="customSize" width="220" height="123"/> | ||
<connections> | ||
<outlet property="borderView" destination="Ic2-yw-Fo7" id="XwY-SP-k9X"/> | ||
<outlet property="locationLabel" destination="hd0-ZR-rTQ" id="FAX-PA-bdS"/> | ||
<outlet property="titleLabel" destination="TU0-NI-510" id="0qh-cd-bPg"/> | ||
</connections> | ||
<point key="canvasLocation" x="85" y="76"/> | ||
</collectionViewCell> | ||
</objects> | ||
</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
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
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
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
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
Oops, something went wrong.