Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
lufzi committed Feb 2, 2018
2 parents 60c49b9 + f8411a6 commit a0c7fa3
Show file tree
Hide file tree
Showing 25 changed files with 1,336 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

The changelog for `Pai`. Also see the [releases](https://github.com/lkmfz/Pai/releases) on GitHub.

--------------------------------------
--------------------------------------

## Upcoming Releases

### [Pre-release 0.1.0](https://github.com/lkmfz/Ubud/releases/tag/0.1.0)
3 changes: 3 additions & 0 deletions Pai-Example/Pai-Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,12 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Pai-Example/Pods-Pai-Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Pai/Pai.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Pai.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down
32 changes: 28 additions & 4 deletions Pai-Example/Pai-Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ZJd-OG-i0a">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--Example View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ExampleViewController" customModule="Pai_Example" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="JI2-F6-QRg"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="456.80000000000001" y="117.39130434782609"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="imW-zz-zae">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="ZJd-OG-i0a" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="jsz-Jd-kgb">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="3Md-N3-1vl"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="yVv-iy-esd" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-282" y="117"/>
</scene>
</scenes>
</document>
62 changes: 61 additions & 1 deletion Pai-Example/Pai-Example/ExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,70 @@
//

import UIKit
import Pai

final class ExampleViewController: UIViewController {
final class ExampleViewController: UIViewController, PaiCalendarDelegate, PaiCalendarDataSource {

private var style: PaiStyle = {
let style = PaiStyle.shared
style.dateItemShouldGreyOutPastDates = true
style.dateItemShouldHideOffsetDates = true
style.dateItemShouldDisplayLine = true
/// Date events configuration
style.dateItemDayLabelInset = UIEdgeInsets(top: 3.0, left: 8.0, bottom: 30.0, right: 8.0)
style.dateItemDisplayEventsIfAny = true
return style
}()

private lazy var monthlyView: MonthCollectionView = {
let view = MonthCollectionView(style: self.style, backwardsMonths: 24, forwardsMonths: 24, calendarDataSource: self)
view.calendarDelegate = self
return view
}()

override func viewDidLoad() {
super.viewDidLoad()

navigationController?.navigationBar.titleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.white,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 18.0, weight: .heavy)
]
navigationController?.navigationBar.barTintColor = .red
navigationController?.navigationBar.tintColor = .white
navigationController?.navigationBar.isTranslucent = false
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Today", style: .done, target: self, action: #selector(didTapToday))
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
view.addSubview(monthlyView)

NSLayoutConstraint.activate([
monthlyView.topAnchor.constraint(equalTo: view.topAnchor),
monthlyView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
monthlyView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
monthlyView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
}

@objc func didTapToday() {
monthlyView.scrolltoCurrentMonth()
}

// MARK: - PaiCalendarDelegate

func calendarDateDidSelect(in calendar: MonthCollectionView, at index: Int, date: PaiDate) {
print("Selected date: \(date.date)")
}

func calendarMonthViewDidScroll(in calendar: MonthCollectionView, at index: Int, month: String, year: String) {
title = month + " " + year
}

// MARK: - PaiCalendarDataSourc

func calendarDateEvents(in calendar: MonthCollectionView) -> [PaiDateEvent] {
let events = PaiDateEvent.generateRandom(numberOfEvents: 6)
return events
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
4 changes: 4 additions & 0 deletions Pai-Example/Pai-Example/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<array>
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
2 changes: 1 addition & 1 deletion Pai.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Pai'
s.version = '0.0.1'
s.version = '0.1.0'
s.license = { :type => "MIT", :file => "LICENSE.md" }

s.summary = 'Calendar view library for iOS.'
Expand Down
102 changes: 102 additions & 0 deletions Pai.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,23 @@
objects = {

/* Begin PBXBuildFile section */
D54E06972005D0B3008E0DDD /* PaiStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D54E06962005D0B3008E0DDD /* PaiStyle.swift */; };
D54FC8EF1FECA8FD00EC148D /* MonthCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D54FC8EE1FECA8FD00EC148D /* MonthCollectionView.swift */; };
D54FC8F61FECB04E00EC148D /* DayViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D54FC8F51FECB04E00EC148D /* DayViewCell.swift */; };
D588F2691FEBF48C00AEE201 /* Pai.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D588F25F1FEBF48C00AEE201 /* Pai.framework */; };
D588F26E1FEBF48C00AEE201 /* PaiTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D588F26D1FEBF48C00AEE201 /* PaiTests.swift */; };
D588F2701FEBF48C00AEE201 /* Pai.h in Headers */ = {isa = PBXBuildFile; fileRef = D588F2621FEBF48C00AEE201 /* Pai.h */; settings = {ATTRIBUTES = (Public, ); }; };
D5A0EB682007DA9E00CC4A2E /* PaiDateEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5A0EB672007DA9E00CC4A2E /* PaiDateEvent.swift */; };
D5D3AD8B2006F113002C74E4 /* UICollectionView+Custom.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D3AD8A2006F113002C74E4 /* UICollectionView+Custom.swift */; };
D5D3AD9220071787002C74E4 /* PaiCalendarDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D3AD9120071787002C74E4 /* PaiCalendarDelegate.swift */; };
D5D3AD94200756B1002C74E4 /* PaiMonth.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D3AD93200756B1002C74E4 /* PaiMonth.swift */; };
D5D3AD96200756F8002C74E4 /* PaiDate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D3AD95200756F8002C74E4 /* PaiDate.swift */; };
D5E3FCE51FF28CF90059433E /* MonthHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E3FCE41FF28CF90059433E /* MonthHeaderView.swift */; };
D5E3FCE71FF28D360059433E /* MonthVerticalFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E3FCE61FF28D360059433E /* MonthVerticalFlowLayout.swift */; };
D5E3FCE91FF2A2540059433E /* MonthViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E3FCE81FF2A2540059433E /* MonthViewCell.swift */; };
D5E3FCEB1FF2A78A0059433E /* PaiCalendar.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E3FCEA1FF2A78A0059433E /* PaiCalendar.swift */; };
D5E3FCF11FF2BBFA0059433E /* DayCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E3FCF01FF2BBFA0059433E /* DayCollectionView.swift */; };
D5E3FCF31FF2BC7C0059433E /* DayFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E3FCF21FF2BC7C0059433E /* DayFlowLayout.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -23,12 +37,26 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
D54E06962005D0B3008E0DDD /* PaiStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PaiStyle.swift; path = Configs/PaiStyle.swift; sourceTree = "<group>"; };
D54FC8EE1FECA8FD00EC148D /* MonthCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthCollectionView.swift; sourceTree = "<group>"; };
D54FC8F51FECB04E00EC148D /* DayViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayViewCell.swift; sourceTree = "<group>"; };
D588F25F1FEBF48C00AEE201 /* Pai.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pai.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D588F2621FEBF48C00AEE201 /* Pai.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Pai.h; sourceTree = "<group>"; };
D588F2631FEBF48C00AEE201 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D588F2681FEBF48C00AEE201 /* PaiTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PaiTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
D588F26D1FEBF48C00AEE201 /* PaiTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaiTests.swift; sourceTree = "<group>"; };
D588F26F1FEBF48C00AEE201 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D5A0EB672007DA9E00CC4A2E /* PaiDateEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaiDateEvent.swift; sourceTree = "<group>"; };
D5D3AD8A2006F113002C74E4 /* UICollectionView+Custom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Custom.swift"; sourceTree = "<group>"; };
D5D3AD9120071787002C74E4 /* PaiCalendarDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaiCalendarDelegate.swift; sourceTree = "<group>"; };
D5D3AD93200756B1002C74E4 /* PaiMonth.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaiMonth.swift; sourceTree = "<group>"; };
D5D3AD95200756F8002C74E4 /* PaiDate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaiDate.swift; sourceTree = "<group>"; };
D5E3FCE41FF28CF90059433E /* MonthHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthHeaderView.swift; sourceTree = "<group>"; };
D5E3FCE61FF28D360059433E /* MonthVerticalFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthVerticalFlowLayout.swift; sourceTree = "<group>"; };
D5E3FCE81FF2A2540059433E /* MonthViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthViewCell.swift; sourceTree = "<group>"; };
D5E3FCEA1FF2A78A0059433E /* PaiCalendar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaiCalendar.swift; sourceTree = "<group>"; };
D5E3FCF01FF2BBFA0059433E /* DayCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayCollectionView.swift; sourceTree = "<group>"; };
D5E3FCF21FF2BC7C0059433E /* DayFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayFlowLayout.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -50,6 +78,39 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
D54E06952005D071008E0DDD /* Configs */ = {
isa = PBXGroup;
children = (
D54E06962005D0B3008E0DDD /* PaiStyle.swift */,
);
name = Configs;
sourceTree = "<group>";
};
D54FC8EB1FECA85500EC148D /* Views */ = {
isa = PBXGroup;
children = (
D54FC8EE1FECA8FD00EC148D /* MonthCollectionView.swift */,
D5E3FCE61FF28D360059433E /* MonthVerticalFlowLayout.swift */,
D5E3FCE41FF28CF90059433E /* MonthHeaderView.swift */,
D5E3FCE81FF2A2540059433E /* MonthViewCell.swift */,
D5E3FCF01FF2BBFA0059433E /* DayCollectionView.swift */,
D5E3FCF21FF2BC7C0059433E /* DayFlowLayout.swift */,
D54FC8F51FECB04E00EC148D /* DayViewCell.swift */,
);
path = Views;
sourceTree = "<group>";
};
D54FC8ED1FECA86200EC148D /* Models */ = {
isa = PBXGroup;
children = (
D5E3FCEA1FF2A78A0059433E /* PaiCalendar.swift */,
D5D3AD93200756B1002C74E4 /* PaiMonth.swift */,
D5D3AD95200756F8002C74E4 /* PaiDate.swift */,
D5A0EB672007DA9E00CC4A2E /* PaiDateEvent.swift */,
);
path = Models;
sourceTree = "<group>";
};
D588F2551FEBF48B00AEE201 = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -98,10 +159,31 @@
D588F27A1FEBF4F700AEE201 /* Sources */ = {
isa = PBXGroup;
children = (
D5D3AD8C20070E46002C74E4 /* Protocols */,
D5D3AD892006F0EC002C74E4 /* Extensions */,
D54FC8ED1FECA86200EC148D /* Models */,
D54FC8EB1FECA85500EC148D /* Views */,
D54E06952005D071008E0DDD /* Configs */,
);
path = Sources;
sourceTree = "<group>";
};
D5D3AD892006F0EC002C74E4 /* Extensions */ = {
isa = PBXGroup;
children = (
D5D3AD8A2006F113002C74E4 /* UICollectionView+Custom.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
D5D3AD8C20070E46002C74E4 /* Protocols */ = {
isa = PBXGroup;
children = (
D5D3AD9120071787002C74E4 /* PaiCalendarDelegate.swift */,
);
path = Protocols;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -165,6 +247,7 @@
TargetAttributes = {
D588F25E1FEBF48C00AEE201 = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 0920;
ProvisioningStyle = Automatic;
};
D588F2671FEBF48C00AEE201 = {
Expand Down Expand Up @@ -229,6 +312,20 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D5E3FCEB1FF2A78A0059433E /* PaiCalendar.swift in Sources */,
D5A0EB682007DA9E00CC4A2E /* PaiDateEvent.swift in Sources */,
D54E06972005D0B3008E0DDD /* PaiStyle.swift in Sources */,
D5E3FCE91FF2A2540059433E /* MonthViewCell.swift in Sources */,
D5E3FCE71FF28D360059433E /* MonthVerticalFlowLayout.swift in Sources */,
D5E3FCF31FF2BC7C0059433E /* DayFlowLayout.swift in Sources */,
D5D3AD96200756F8002C74E4 /* PaiDate.swift in Sources */,
D5D3AD94200756B1002C74E4 /* PaiMonth.swift in Sources */,
D5E3FCE51FF28CF90059433E /* MonthHeaderView.swift in Sources */,
D54FC8EF1FECA8FD00EC148D /* MonthCollectionView.swift in Sources */,
D5D3AD9220071787002C74E4 /* PaiCalendarDelegate.swift in Sources */,
D5D3AD8B2006F113002C74E4 /* UICollectionView+Custom.swift in Sources */,
D5E3FCF11FF2BBFA0059433E /* DayCollectionView.swift in Sources */,
D54FC8F61FECB04E00EC148D /* DayViewCell.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -367,6 +464,7 @@
D588F2741FEBF48C00AEE201 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand All @@ -380,6 +478,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.luqmanfauzi.Pai;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -388,6 +487,7 @@
D588F2751FEBF48C00AEE201 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand All @@ -409,6 +509,7 @@
D588F2771FEBF48C00AEE201 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = R2XF3NYPAG;
INFOPLIST_FILE = PaiTests/Info.plist;
Expand All @@ -423,6 +524,7 @@
D588F2781FEBF48C00AEE201 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = R2XF3NYPAG;
INFOPLIST_FILE = PaiTests/Info.plist;
Expand Down
Loading

0 comments on commit a0c7fa3

Please sign in to comment.